@contentful/experience-design-system-cli 2.34.5-dev-build-d0fcb46e.0 → 2.34.5-dev-build-0dbc122c.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/package.json +1 -1
- package/dist/src/analyze/select/tui/components/FieldEditor.d.ts +2 -1
- package/dist/src/analyze/select/tui/components/FinalizeDialog.d.ts +2 -2
- package/dist/src/import/tui/components/CompactControlBar.d.ts +3 -1
- package/dist/src/import/tui/components/ReviewStatus.d.ts +0 -5
- package/dist/src/import/tui/hooks/review-input.d.ts +1 -1
- package/dist/src/import/tui/lineage-layout.d.ts +2 -2
- package/dist/src/index.js +1187 -1298
- package/package.json +6 -6
- package/dist/src/analyze/select/tui/components/LineagePanel.d.ts +0 -14
- package/dist/src/import/tui/hooks/useLineage.d.ts +0 -32
- package/dist/src/import/tui/lineage-input.d.ts +0 -18
package/dist/src/index.js
CHANGED
|
@@ -3605,19 +3605,33 @@ function copyComponentFromCache(db, sourceSessionId, targetSessionId, componentI
|
|
|
3605
3605
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3606
3606
|
db.exec("BEGIN");
|
|
3607
3607
|
try {
|
|
3608
|
-
const srcComp = db.prepare(
|
|
3608
|
+
const srcComp = db.prepare(
|
|
3609
|
+
`SELECT description, status, component_description_rationale, props_rationale, slots_rationale
|
|
3610
|
+
FROM raw_components WHERE session_id = ? AND component_id = ?`
|
|
3611
|
+
).get(sourceSessionId, componentId);
|
|
3609
3612
|
if (srcComp) {
|
|
3610
3613
|
db.prepare(
|
|
3611
|
-
`UPDATE raw_components
|
|
3612
|
-
|
|
3614
|
+
`UPDATE raw_components
|
|
3615
|
+
SET description = ?, status = ?, component_description_rationale = ?, props_rationale = ?, slots_rationale = ?, extracted_at = ?
|
|
3616
|
+
WHERE session_id = ? AND component_id = ?`
|
|
3617
|
+
).run(
|
|
3618
|
+
srcComp.description,
|
|
3619
|
+
srcComp.status,
|
|
3620
|
+
srcComp.component_description_rationale,
|
|
3621
|
+
srcComp.props_rationale,
|
|
3622
|
+
srcComp.slots_rationale,
|
|
3623
|
+
now,
|
|
3624
|
+
targetSessionId,
|
|
3625
|
+
componentId
|
|
3626
|
+
);
|
|
3613
3627
|
}
|
|
3614
3628
|
const srcProps = db.prepare(
|
|
3615
|
-
`SELECT name, cdf_type, cdf_category, cdf_token_kind, required, description, default_value
|
|
3629
|
+
`SELECT name, cdf_type, cdf_category, cdf_token_kind, required, description, default_value, rationale
|
|
3616
3630
|
FROM raw_props WHERE session_id = ? AND component_id = ?`
|
|
3617
3631
|
).all(sourceSessionId, componentId);
|
|
3618
3632
|
for (const p of srcProps) {
|
|
3619
3633
|
db.prepare(
|
|
3620
|
-
`UPDATE raw_props SET cdf_type = ?, cdf_category = ?, cdf_token_kind = ?, required = ?, description = ?, default_value = ?
|
|
3634
|
+
`UPDATE raw_props SET cdf_type = ?, cdf_category = ?, cdf_token_kind = ?, required = ?, description = ?, default_value = ?, rationale = ?
|
|
3621
3635
|
WHERE session_id = ? AND component_id = ? AND name = ?`
|
|
3622
3636
|
).run(
|
|
3623
3637
|
p.cdf_type,
|
|
@@ -3626,6 +3640,7 @@ function copyComponentFromCache(db, sourceSessionId, targetSessionId, componentI
|
|
|
3626
3640
|
p.required,
|
|
3627
3641
|
p.description,
|
|
3628
3642
|
p.default_value,
|
|
3643
|
+
p.rationale,
|
|
3629
3644
|
targetSessionId,
|
|
3630
3645
|
componentId,
|
|
3631
3646
|
p.name
|
|
@@ -3644,11 +3659,11 @@ function copyComponentFromCache(db, sourceSessionId, targetSessionId, componentI
|
|
|
3644
3659
|
for (const av of srcAV) {
|
|
3645
3660
|
insertAV.run(targetSessionId, componentId, av.prop_name, av.position, av.value);
|
|
3646
3661
|
}
|
|
3647
|
-
const srcSlots = db.prepare(`SELECT name, required, description FROM raw_slots WHERE session_id = ? AND component_id = ?`).all(sourceSessionId, componentId);
|
|
3662
|
+
const srcSlots = db.prepare(`SELECT name, required, description, rationale FROM raw_slots WHERE session_id = ? AND component_id = ?`).all(sourceSessionId, componentId);
|
|
3648
3663
|
for (const s of srcSlots) {
|
|
3649
3664
|
db.prepare(
|
|
3650
|
-
`UPDATE raw_slots SET required = ?, description = ? WHERE session_id = ? AND component_id = ? AND name = ?`
|
|
3651
|
-
).run(s.required, s.description, targetSessionId, componentId, s.name);
|
|
3665
|
+
`UPDATE raw_slots SET required = ?, description = ?, rationale = ? WHERE session_id = ? AND component_id = ? AND name = ?`
|
|
3666
|
+
).run(s.required, s.description, s.rationale, targetSessionId, componentId, s.name);
|
|
3652
3667
|
}
|
|
3653
3668
|
db.prepare(`DELETE FROM raw_slot_allowed_components WHERE session_id = ? AND component_id = ?`).run(
|
|
3654
3669
|
targetSessionId,
|
|
@@ -19748,14 +19763,29 @@ var init_LegendEntry = __esm({
|
|
|
19748
19763
|
// packages/experience-design-system-cli/src/import/tui/components/CompactControlBar.tsx
|
|
19749
19764
|
import { Box as Box26 } from "ink";
|
|
19750
19765
|
import { jsxs as jsxs27 } from "react/jsx-runtime";
|
|
19751
|
-
function CompactControlBar({
|
|
19766
|
+
function CompactControlBar({
|
|
19767
|
+
hasGroupRoots,
|
|
19768
|
+
searchActive,
|
|
19769
|
+
showJson = false,
|
|
19770
|
+
tokenReviewAvailable = false
|
|
19771
|
+
}) {
|
|
19752
19772
|
return /* @__PURE__ */ jsxs27(Box26, { borderStyle: "single", borderColor: PALETTE.border, paddingX: 1, marginTop: 1, flexWrap: "wrap", columnGap: 2, children: [
|
|
19753
19773
|
legendEntry("[\u2191/\u2193]", "move"),
|
|
19754
19774
|
legendEntry("[a/r]", "accept/reject"),
|
|
19775
|
+
legendEntry("[A]", "accept all"),
|
|
19755
19776
|
hasGroupRoots && legendEntry("[space/E/C]", "expand/collapse"),
|
|
19777
|
+
legendEntry("[L]", "flat"),
|
|
19778
|
+
legendEntry("[i]", "focus lineage"),
|
|
19779
|
+
legendEntry("[w]", "only breaking"),
|
|
19780
|
+
legendEntry("[o]", "only cycles"),
|
|
19781
|
+
legendEntry("[c]", "cycle list"),
|
|
19782
|
+
legendEntry("[b]", "breaking changes"),
|
|
19756
19783
|
legendEntry("[/]", "search", searchActive),
|
|
19757
19784
|
legendEntry("[f]", "continue/finalize"),
|
|
19758
19785
|
legendEntry("[h]", "help"),
|
|
19786
|
+
legendEntry("[J]", showJson ? "hide JSON" : "show JSON"),
|
|
19787
|
+
tokenReviewAvailable && legendEntry("[t]", "token review"),
|
|
19788
|
+
legendEntry("[Ctrl+Z/Y/R]", "undo/redo/reload"),
|
|
19759
19789
|
legendEntry("[q]", "quit")
|
|
19760
19790
|
] });
|
|
19761
19791
|
}
|
|
@@ -19861,55 +19891,6 @@ function findAllAncestors(target, components) {
|
|
|
19861
19891
|
}
|
|
19862
19892
|
return ancestors;
|
|
19863
19893
|
}
|
|
19864
|
-
function buildAncestorTree(target, components) {
|
|
19865
|
-
const visited = /* @__PURE__ */ new Set();
|
|
19866
|
-
visited.add(target);
|
|
19867
|
-
function walk(name, depth) {
|
|
19868
|
-
const parents = findDirectParents(name, components);
|
|
19869
|
-
const out = [];
|
|
19870
|
-
for (const { parent, slotName } of parents) {
|
|
19871
|
-
if (parent === target) {
|
|
19872
|
-
out.push({
|
|
19873
|
-
name: parent,
|
|
19874
|
-
incomingSlotName: slotName,
|
|
19875
|
-
depth: depth + 1,
|
|
19876
|
-
shared: false,
|
|
19877
|
-
cycle: true,
|
|
19878
|
-
parents: []
|
|
19879
|
-
});
|
|
19880
|
-
continue;
|
|
19881
|
-
}
|
|
19882
|
-
if (visited.has(parent)) {
|
|
19883
|
-
out.push({
|
|
19884
|
-
name: parent,
|
|
19885
|
-
incomingSlotName: slotName,
|
|
19886
|
-
depth: depth + 1,
|
|
19887
|
-
shared: true,
|
|
19888
|
-
cycle: false,
|
|
19889
|
-
parents: []
|
|
19890
|
-
});
|
|
19891
|
-
continue;
|
|
19892
|
-
}
|
|
19893
|
-
visited.add(parent);
|
|
19894
|
-
out.push({
|
|
19895
|
-
name: parent,
|
|
19896
|
-
incomingSlotName: slotName,
|
|
19897
|
-
depth: depth + 1,
|
|
19898
|
-
shared: false,
|
|
19899
|
-
cycle: false,
|
|
19900
|
-
parents: walk(parent, depth + 1)
|
|
19901
|
-
});
|
|
19902
|
-
}
|
|
19903
|
-
return out;
|
|
19904
|
-
}
|
|
19905
|
-
return {
|
|
19906
|
-
name: target,
|
|
19907
|
-
depth: 0,
|
|
19908
|
-
shared: false,
|
|
19909
|
-
cycle: false,
|
|
19910
|
-
parents: walk(target, 0)
|
|
19911
|
-
};
|
|
19912
|
-
}
|
|
19913
19894
|
var init_lineage = __esm({
|
|
19914
19895
|
"packages/experience-design-system-cli/src/analyze/lineage.ts"() {
|
|
19915
19896
|
"use strict";
|
|
@@ -21298,113 +21279,6 @@ var init_selection_cascade = __esm({
|
|
|
21298
21279
|
}
|
|
21299
21280
|
});
|
|
21300
21281
|
|
|
21301
|
-
// packages/experience-design-system-cli/src/import/tui/hooks/useLineage.ts
|
|
21302
|
-
import { useMemo as useMemo3 } from "react";
|
|
21303
|
-
function renderCleanAncestorTree(node) {
|
|
21304
|
-
const lines = [];
|
|
21305
|
-
lines.push({ text: node.name, jumpTarget: node.name });
|
|
21306
|
-
const walk = (parents, prefix) => {
|
|
21307
|
-
for (let i = 0; i < parents.length; i++) {
|
|
21308
|
-
const child = parents[i];
|
|
21309
|
-
const isLast = i === parents.length - 1;
|
|
21310
|
-
const glyph = isLast ? "\u2514\u2500" : "\u251C\u2500";
|
|
21311
|
-
lines.push({ text: `${prefix}${glyph} ${child.name}`, jumpTarget: child.name });
|
|
21312
|
-
if (child.parents.length > 0) {
|
|
21313
|
-
const nextPrefix = prefix + (isLast ? " " : "\u2502 ");
|
|
21314
|
-
walk(child.parents, nextPrefix);
|
|
21315
|
-
}
|
|
21316
|
-
}
|
|
21317
|
-
};
|
|
21318
|
-
walk(node.parents, "");
|
|
21319
|
-
return lines;
|
|
21320
|
-
}
|
|
21321
|
-
function renderDescendantTree(root, closure, graph) {
|
|
21322
|
-
const lines = [];
|
|
21323
|
-
if (closure.containsCycle) {
|
|
21324
|
-
for (const node of closure.nodes) {
|
|
21325
|
-
if (node.name === root) continue;
|
|
21326
|
-
lines.push({ text: ` ${node.name}`, jumpTarget: node.name });
|
|
21327
|
-
}
|
|
21328
|
-
return lines;
|
|
21329
|
-
}
|
|
21330
|
-
const byName = new Map(graph.map((n) => [n.name, n]));
|
|
21331
|
-
const known = new Set(closure.nodes.map((n) => n.name));
|
|
21332
|
-
const childrenOf = (name) => {
|
|
21333
|
-
const node = byName.get(name);
|
|
21334
|
-
if (!node) return [];
|
|
21335
|
-
const seen = /* @__PURE__ */ new Set();
|
|
21336
|
-
const out = [];
|
|
21337
|
-
for (const slot of node.slots) {
|
|
21338
|
-
for (const target of slot.allowedComponents ?? []) {
|
|
21339
|
-
if (!known.has(target)) continue;
|
|
21340
|
-
if (target === name) continue;
|
|
21341
|
-
if (seen.has(target)) continue;
|
|
21342
|
-
seen.add(target);
|
|
21343
|
-
out.push(target);
|
|
21344
|
-
}
|
|
21345
|
-
}
|
|
21346
|
-
return out.sort((a, b) => a.localeCompare(b));
|
|
21347
|
-
};
|
|
21348
|
-
const visited = /* @__PURE__ */ new Set([root]);
|
|
21349
|
-
const walk = (parent, prefix) => {
|
|
21350
|
-
const kids = childrenOf(parent);
|
|
21351
|
-
for (let i = 0; i < kids.length; i++) {
|
|
21352
|
-
const child = kids[i];
|
|
21353
|
-
if (visited.has(child)) continue;
|
|
21354
|
-
visited.add(child);
|
|
21355
|
-
const isLast = i === kids.length - 1;
|
|
21356
|
-
const glyph = isLast ? "\u2514\u2500" : "\u251C\u2500";
|
|
21357
|
-
lines.push({ text: `${prefix}${glyph} ${child}`, jumpTarget: child });
|
|
21358
|
-
const nextPrefix = prefix + (isLast ? " " : "\u2502 ");
|
|
21359
|
-
walk(child, nextPrefix);
|
|
21360
|
-
}
|
|
21361
|
-
};
|
|
21362
|
-
walk(root, "");
|
|
21363
|
-
return lines;
|
|
21364
|
-
}
|
|
21365
|
-
function useLineage(focusedKey, graph) {
|
|
21366
|
-
const graphKey = useMemo3(() => JSON.stringify(graph), [graph]);
|
|
21367
|
-
const stableGraph = useMemo3(() => graph, [graphKey]);
|
|
21368
|
-
const closures = useMemo3(() => computeAllClosures(stableGraph), [stableGraph]);
|
|
21369
|
-
const entries = useMemo3(() => {
|
|
21370
|
-
if (!focusedKey) return [];
|
|
21371
|
-
const name = focusedKey;
|
|
21372
|
-
const tree = buildAncestorTree(name, stableGraph);
|
|
21373
|
-
const closure = closures.get(name);
|
|
21374
|
-
const out = [];
|
|
21375
|
-
out.push({ kind: "section", label: "Ancestors:" });
|
|
21376
|
-
if (tree.parents.length === 0) {
|
|
21377
|
-
out.push({ kind: "empty", label: " (no ancestors)" });
|
|
21378
|
-
} else {
|
|
21379
|
-
const lines = renderCleanAncestorTree(tree);
|
|
21380
|
-
for (const line of lines) {
|
|
21381
|
-
out.push({ kind: "ancestor", label: " " + line.text, jumpTarget: line.jumpTarget ?? name });
|
|
21382
|
-
}
|
|
21383
|
-
}
|
|
21384
|
-
out.push({ kind: "section", label: "Descendants:" });
|
|
21385
|
-
if (!closure || closure.nodes.length <= 1) {
|
|
21386
|
-
out.push({ kind: "empty", label: " (none)" });
|
|
21387
|
-
} else {
|
|
21388
|
-
for (const line of renderDescendantTree(name, closure, stableGraph)) {
|
|
21389
|
-
out.push({ kind: "descendant", label: " " + line.text, jumpTarget: line.jumpTarget });
|
|
21390
|
-
}
|
|
21391
|
-
}
|
|
21392
|
-
return out;
|
|
21393
|
-
}, [focusedKey, stableGraph, closures]);
|
|
21394
|
-
const jumpables = useMemo3(
|
|
21395
|
-
() => entries.map((entry, i) => ({ entry, i })).filter(({ entry }) => entry.kind === "ancestor" || entry.kind === "descendant"),
|
|
21396
|
-
[entries]
|
|
21397
|
-
);
|
|
21398
|
-
return { entries, jumpables };
|
|
21399
|
-
}
|
|
21400
|
-
var init_useLineage = __esm({
|
|
21401
|
-
"packages/experience-design-system-cli/src/import/tui/hooks/useLineage.ts"() {
|
|
21402
|
-
"use strict";
|
|
21403
|
-
init_composite_closure();
|
|
21404
|
-
init_lineage();
|
|
21405
|
-
}
|
|
21406
|
-
});
|
|
21407
|
-
|
|
21408
21282
|
// packages/experience-design-system-cli/src/import/cycle-auto-reject.ts
|
|
21409
21283
|
function computeCycleAutoRejectTargets(slotCycles, graph) {
|
|
21410
21284
|
const targets = /* @__PURE__ */ new Set();
|
|
@@ -21423,65 +21297,6 @@ var init_cycle_auto_reject = __esm({
|
|
|
21423
21297
|
}
|
|
21424
21298
|
});
|
|
21425
21299
|
|
|
21426
|
-
// packages/experience-design-system-cli/src/analyze/select/tui/components/LineagePanel.tsx
|
|
21427
|
-
import figures4 from "figures";
|
|
21428
|
-
import { Text as Text30 } from "ink";
|
|
21429
|
-
import { jsx as jsx33, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
21430
|
-
function LineagePanel({
|
|
21431
|
-
focusedComponentKey,
|
|
21432
|
-
entries,
|
|
21433
|
-
cursor,
|
|
21434
|
-
jumpables,
|
|
21435
|
-
maxRows,
|
|
21436
|
-
width
|
|
21437
|
-
}) {
|
|
21438
|
-
const rows = entries.map((e) => ({
|
|
21439
|
-
label: e.label,
|
|
21440
|
-
jumpTarget: e.kind === "ancestor" || e.kind === "descendant" ? e.jumpTarget : "",
|
|
21441
|
-
kind: e.kind
|
|
21442
|
-
}));
|
|
21443
|
-
const cursorRowIndex = jumpables[cursor]?.i ?? 0;
|
|
21444
|
-
return /* @__PURE__ */ jsx33(
|
|
21445
|
-
GotoBanner,
|
|
21446
|
-
{
|
|
21447
|
-
title: `Lineage: ${focusedComponentKey}`,
|
|
21448
|
-
rows,
|
|
21449
|
-
cursor,
|
|
21450
|
-
cursorRowIndex,
|
|
21451
|
-
maxRows,
|
|
21452
|
-
width,
|
|
21453
|
-
footerHint: LINEAGE_FOOTER_HINT,
|
|
21454
|
-
renderRow: (row, i, isCursor) => {
|
|
21455
|
-
if (row.kind === "section") {
|
|
21456
|
-
return /* @__PURE__ */ jsxs30(Text30, { bold: true, children: [
|
|
21457
|
-
" ",
|
|
21458
|
-
row.label
|
|
21459
|
-
] }, i);
|
|
21460
|
-
}
|
|
21461
|
-
if (row.kind === "empty") {
|
|
21462
|
-
return /* @__PURE__ */ jsxs30(Text30, { children: [
|
|
21463
|
-
/* @__PURE__ */ jsx33(Text30, { children: " " }),
|
|
21464
|
-
/* @__PURE__ */ jsx33(Text30, { dimColor: true, children: " " + row.label })
|
|
21465
|
-
] }, i);
|
|
21466
|
-
}
|
|
21467
|
-
return /* @__PURE__ */ jsxs30(Text30, { children: [
|
|
21468
|
-
isCursor ? /* @__PURE__ */ jsx33(Text30, { color: PALETTE.info, bold: true, children: figures4.pointer }) : /* @__PURE__ */ jsx33(Text30, { children: " " }),
|
|
21469
|
-
/* @__PURE__ */ jsx33(Text30, { inverse: isCursor, children: " " + row.label })
|
|
21470
|
-
] }, i);
|
|
21471
|
-
}
|
|
21472
|
-
}
|
|
21473
|
-
);
|
|
21474
|
-
}
|
|
21475
|
-
var LINEAGE_FOOTER_HINT;
|
|
21476
|
-
var init_LineagePanel = __esm({
|
|
21477
|
-
"packages/experience-design-system-cli/src/analyze/select/tui/components/LineagePanel.tsx"() {
|
|
21478
|
-
"use strict";
|
|
21479
|
-
init_theme();
|
|
21480
|
-
init_GotoBanner();
|
|
21481
|
-
LINEAGE_FOOTER_HINT = "[\u2191/\u2193] move \xB7 [Enter] jump \xB7 [l/Esc] close";
|
|
21482
|
-
}
|
|
21483
|
-
});
|
|
21484
|
-
|
|
21485
21300
|
// packages/experience-design-system-cli/src/import/tui/steps/auto-reject-decision.ts
|
|
21486
21301
|
function computeAutoRejectDecision(input) {
|
|
21487
21302
|
if (input.loading) return "skip";
|
|
@@ -21549,60 +21364,12 @@ function enumerateCycleBreaks(cycle, components) {
|
|
|
21549
21364
|
}
|
|
21550
21365
|
return out;
|
|
21551
21366
|
}
|
|
21552
|
-
function shouldBreakOverlayGoFullScreen({
|
|
21553
|
-
rows,
|
|
21554
|
-
edgeCount,
|
|
21555
|
-
reservedChrome = 12
|
|
21556
|
-
}) {
|
|
21557
|
-
const OVERLAY_CHROME = 5;
|
|
21558
|
-
const needed = edgeCount + OVERLAY_CHROME;
|
|
21559
|
-
const available = rows - reservedChrome;
|
|
21560
|
-
return needed > available;
|
|
21561
|
-
}
|
|
21562
21367
|
var init_enumerate_cycle_breaks = __esm({
|
|
21563
21368
|
"packages/experience-design-system-cli/src/import/tui/steps/enumerate-cycle-breaks.ts"() {
|
|
21564
21369
|
"use strict";
|
|
21565
21370
|
}
|
|
21566
21371
|
});
|
|
21567
21372
|
|
|
21568
|
-
// packages/experience-design-system-cli/src/import/tui/lineage-input.ts
|
|
21569
|
-
function handleLineageNavigation({
|
|
21570
|
-
key,
|
|
21571
|
-
cursor,
|
|
21572
|
-
jumpables,
|
|
21573
|
-
onCursorChange,
|
|
21574
|
-
onJump,
|
|
21575
|
-
onClose,
|
|
21576
|
-
allowTab
|
|
21577
|
-
}) {
|
|
21578
|
-
if (key.upArrow) {
|
|
21579
|
-
onCursorChange((current) => Math.max(0, current - 1));
|
|
21580
|
-
return true;
|
|
21581
|
-
}
|
|
21582
|
-
if (key.downArrow) {
|
|
21583
|
-
onCursorChange((current) => Math.min(Math.max(0, jumpables.length - 1), current + 1));
|
|
21584
|
-
return true;
|
|
21585
|
-
}
|
|
21586
|
-
if (allowTab && key.tab) {
|
|
21587
|
-
onCursorChange((current) => jumpables.length === 0 ? 0 : (current + 1) % jumpables.length);
|
|
21588
|
-
return true;
|
|
21589
|
-
}
|
|
21590
|
-
if (key.return) {
|
|
21591
|
-
const target = jumpables[cursor];
|
|
21592
|
-
if (target && (target.entry.kind === "ancestor" || target.entry.kind === "descendant")) {
|
|
21593
|
-
onJump(target.entry.jumpTarget);
|
|
21594
|
-
}
|
|
21595
|
-
onClose();
|
|
21596
|
-
return true;
|
|
21597
|
-
}
|
|
21598
|
-
return false;
|
|
21599
|
-
}
|
|
21600
|
-
var init_lineage_input = __esm({
|
|
21601
|
-
"packages/experience-design-system-cli/src/import/tui/lineage-input.ts"() {
|
|
21602
|
-
"use strict";
|
|
21603
|
-
}
|
|
21604
|
-
});
|
|
21605
|
-
|
|
21606
21373
|
// packages/experience-design-system-cli/src/analyze/select/tui/hooks/scroll-offset.ts
|
|
21607
21374
|
function computeNextScrollOffset(current, input, key, totalLines, panelHeight) {
|
|
21608
21375
|
const maxOffset = Math.max(0, totalLines - panelHeight);
|
|
@@ -21637,15 +21404,27 @@ var init_scroll_offset = __esm({
|
|
|
21637
21404
|
});
|
|
21638
21405
|
|
|
21639
21406
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/FieldEditor.tsx
|
|
21640
|
-
import React14, { useState as useState15 } from "react";
|
|
21641
|
-
import
|
|
21642
|
-
import { Box as Box29, Text as
|
|
21407
|
+
import React14, { useEffect as useEffect8, useState as useState15 } from "react";
|
|
21408
|
+
import figures4 from "figures";
|
|
21409
|
+
import { Box as Box29, Text as Text30 } from "ink";
|
|
21643
21410
|
import {
|
|
21644
21411
|
CDF_PROPERTY_TYPES,
|
|
21645
21412
|
CDF_PROPERTY_CATEGORIES,
|
|
21646
21413
|
DESIGN_TOKEN_TYPES as DESIGN_TOKEN_TYPES2
|
|
21647
21414
|
} from "@contentful/experience-design-system-types";
|
|
21648
|
-
import { Fragment as Fragment10, jsx as
|
|
21415
|
+
import { Fragment as Fragment10, jsx as jsx33, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
21416
|
+
function createCommonRowProps(selected, focusLevel, editingField, textCursor, valueCursor, cursorVisible, editingValue, valueText, width) {
|
|
21417
|
+
return {
|
|
21418
|
+
selected,
|
|
21419
|
+
editingField: selected && focusLevel === "field" && editingField,
|
|
21420
|
+
textCursor,
|
|
21421
|
+
valueCursor,
|
|
21422
|
+
cursorVisible,
|
|
21423
|
+
editingValue: selected ? editingValue : null,
|
|
21424
|
+
valueText: selected ? valueText : "",
|
|
21425
|
+
width
|
|
21426
|
+
};
|
|
21427
|
+
}
|
|
21649
21428
|
function removeAt(values, index) {
|
|
21650
21429
|
return values.filter((_, i) => i !== index);
|
|
21651
21430
|
}
|
|
@@ -21768,25 +21547,53 @@ function serializeState(state, originalJson) {
|
|
|
21768
21547
|
return JSON.stringify(entry, null, 2);
|
|
21769
21548
|
}
|
|
21770
21549
|
function Picker({ value, active }) {
|
|
21771
|
-
return /* @__PURE__ */
|
|
21772
|
-
active && /* @__PURE__ */
|
|
21773
|
-
/* @__PURE__ */
|
|
21774
|
-
active && /* @__PURE__ */
|
|
21550
|
+
return /* @__PURE__ */ jsxs30(Box29, { children: [
|
|
21551
|
+
active && /* @__PURE__ */ jsx33(Text30, { color: PALETTE.info, children: "\u2039" }),
|
|
21552
|
+
/* @__PURE__ */ jsx33(Text30, { color: active ? PALETTE.info : PALETTE.inverse, bold: active, children: value }),
|
|
21553
|
+
active && /* @__PURE__ */ jsx33(Text30, { color: PALETTE.info, children: "\u203A" })
|
|
21775
21554
|
] });
|
|
21776
21555
|
}
|
|
21556
|
+
function categorySwitchTarget(category) {
|
|
21557
|
+
return category === "content" ? "design" : "content";
|
|
21558
|
+
}
|
|
21777
21559
|
function Toggle({ value, active }) {
|
|
21778
|
-
return /* @__PURE__ */
|
|
21560
|
+
return /* @__PURE__ */ jsx33(Box29, { children: /* @__PURE__ */ jsx33(Text30, { color: active ? PALETTE.info : value ? PALETTE.success : void 0, children: value ? "[\u2713]" : "[ ]" }) });
|
|
21779
21561
|
}
|
|
21780
|
-
function
|
|
21781
|
-
|
|
21782
|
-
|
|
21783
|
-
|
|
21562
|
+
function InlinePropField({
|
|
21563
|
+
label,
|
|
21564
|
+
selected,
|
|
21565
|
+
focused = false,
|
|
21566
|
+
children,
|
|
21567
|
+
flexible = false
|
|
21568
|
+
}) {
|
|
21569
|
+
return /* @__PURE__ */ jsxs30(Box29, { gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, children: [
|
|
21570
|
+
/* @__PURE__ */ jsxs30(Text30, { color: focused ? PALETTE.warning : void 0, bold: focused, dimColor: !selected && !focused, children: [
|
|
21571
|
+
focused ? "\u203A " : " ",
|
|
21572
|
+
label
|
|
21573
|
+
] }),
|
|
21574
|
+
children
|
|
21575
|
+
] });
|
|
21576
|
+
}
|
|
21577
|
+
function DefaultValueRow({
|
|
21578
|
+
display,
|
|
21579
|
+
active,
|
|
21580
|
+
focused
|
|
21581
|
+
}) {
|
|
21582
|
+
return /* @__PURE__ */ jsxs30(Box29, { paddingLeft: 2, gap: 1, children: [
|
|
21583
|
+
/* @__PURE__ */ jsx33(DefaultLabel, { focused }),
|
|
21584
|
+
active ? /* @__PURE__ */ jsx33(Picker, { value: display, active: true }) : /* @__PURE__ */ jsx33(Text30, { color: PALETTE.inverse, children: display })
|
|
21585
|
+
] });
|
|
21586
|
+
}
|
|
21587
|
+
function DefaultLabel({ focused }) {
|
|
21588
|
+
return /* @__PURE__ */ jsxs30(Text30, { color: focused ? PALETTE.warning : void 0, bold: focused, dimColor: !focused, children: [
|
|
21589
|
+
focused ? "\u203A " : " ",
|
|
21590
|
+
"default:"
|
|
21784
21591
|
] });
|
|
21785
21592
|
}
|
|
21786
21593
|
function RowLabel({ name, selected }) {
|
|
21787
21594
|
const nameDisplay = name.length > 14 ? name.slice(0, 13) + "\u2026" : name.padEnd(14);
|
|
21788
|
-
return /* @__PURE__ */
|
|
21789
|
-
|
|
21595
|
+
return /* @__PURE__ */ jsxs30(
|
|
21596
|
+
Text30,
|
|
21790
21597
|
{
|
|
21791
21598
|
color: selected ? PALETTE.inverse : PALETTE.info,
|
|
21792
21599
|
bold: selected,
|
|
@@ -21804,10 +21611,10 @@ function ValueInputRow({
|
|
|
21804
21611
|
valueText,
|
|
21805
21612
|
cursorVisible
|
|
21806
21613
|
}) {
|
|
21807
|
-
return /* @__PURE__ */
|
|
21808
|
-
/* @__PURE__ */
|
|
21809
|
-
/* @__PURE__ */
|
|
21810
|
-
/* @__PURE__ */
|
|
21614
|
+
return /* @__PURE__ */ jsxs30(Box29, { paddingLeft: 2, children: [
|
|
21615
|
+
/* @__PURE__ */ jsx33(Text30, { color: PALETTE.info, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
21616
|
+
/* @__PURE__ */ jsx33(Text30, { children: valueText }),
|
|
21617
|
+
/* @__PURE__ */ jsx33(Text30, { inverse: cursorVisible, children: " " })
|
|
21811
21618
|
] });
|
|
21812
21619
|
}
|
|
21813
21620
|
function EditableListItem({
|
|
@@ -21820,9 +21627,9 @@ function EditableListItem({
|
|
|
21820
21627
|
}) {
|
|
21821
21628
|
const isBeingEdited = editingValue?.mode === "edit" && editingValue.index === index;
|
|
21822
21629
|
if (isBeingEdited) {
|
|
21823
|
-
return /* @__PURE__ */
|
|
21630
|
+
return /* @__PURE__ */ jsx33(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
21824
21631
|
}
|
|
21825
|
-
return /* @__PURE__ */
|
|
21632
|
+
return /* @__PURE__ */ jsx33(Box29, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx33(Text30, { color: active ? PALETTE.info : PALETTE.inverse, children: active ? `${figures4.pointer} ${value}` : ` ${value}` }) });
|
|
21826
21633
|
}
|
|
21827
21634
|
function EditableValueList({
|
|
21828
21635
|
values,
|
|
@@ -21835,9 +21642,9 @@ function EditableValueList({
|
|
|
21835
21642
|
emptyPaddingLeft,
|
|
21836
21643
|
showAddInput
|
|
21837
21644
|
}) {
|
|
21838
|
-
return /* @__PURE__ */
|
|
21839
|
-
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */
|
|
21840
|
-
values.map((value, index) => /* @__PURE__ */
|
|
21645
|
+
return /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
21646
|
+
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx33(Text30, { dimColor: true, children: emptyMessage }) : /* @__PURE__ */ jsx33(Box29, { paddingLeft: emptyPaddingLeft, children: /* @__PURE__ */ jsx33(Text30, { dimColor: true, children: emptyMessage }) })),
|
|
21647
|
+
values.map((value, index) => /* @__PURE__ */ jsx33(
|
|
21841
21648
|
EditableListItem,
|
|
21842
21649
|
{
|
|
21843
21650
|
value,
|
|
@@ -21849,56 +21656,95 @@ function EditableValueList({
|
|
|
21849
21656
|
},
|
|
21850
21657
|
index
|
|
21851
21658
|
)),
|
|
21852
|
-
showAddInput && editingValue?.mode === "add" && /* @__PURE__ */
|
|
21659
|
+
showAddInput && editingValue?.mode === "add" && /* @__PURE__ */ jsx33(ValueInputRow, { mode: "add", valueText, cursorVisible })
|
|
21853
21660
|
] });
|
|
21854
21661
|
}
|
|
21855
21662
|
function DefaultSubRow({
|
|
21856
21663
|
prop,
|
|
21857
21664
|
active,
|
|
21665
|
+
focused,
|
|
21858
21666
|
textCursor,
|
|
21859
21667
|
cursorVisible
|
|
21860
21668
|
}) {
|
|
21861
21669
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
21862
21670
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
21863
|
-
return /* @__PURE__ */
|
|
21864
|
-
/* @__PURE__ */
|
|
21865
|
-
|
|
21671
|
+
return /* @__PURE__ */ jsxs30(Box29, { paddingLeft: 2, gap: 1, children: [
|
|
21672
|
+
/* @__PURE__ */ jsxs30(Text30, { color: focused ? PALETTE.warning : void 0, bold: focused, dimColor: !focused, children: [
|
|
21673
|
+
focused ? "\u203A " : " ",
|
|
21674
|
+
"default:"
|
|
21675
|
+
] }),
|
|
21676
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, children: "(not applicable)" })
|
|
21866
21677
|
] });
|
|
21867
21678
|
}
|
|
21868
21679
|
if (prop.type === "boolean") {
|
|
21869
21680
|
const display = prop.default === true ? "true" : prop.default === false ? "false" : "(unset)";
|
|
21870
|
-
return /* @__PURE__ */
|
|
21681
|
+
return /* @__PURE__ */ jsx33(DefaultValueRow, { display, active, focused });
|
|
21871
21682
|
}
|
|
21872
21683
|
if (prop.type === "enum") {
|
|
21873
21684
|
if (prop.values.length === 0) {
|
|
21874
|
-
return /* @__PURE__ */
|
|
21875
|
-
/* @__PURE__ */
|
|
21876
|
-
|
|
21685
|
+
return /* @__PURE__ */ jsxs30(Box29, { paddingLeft: 2, gap: 1, children: [
|
|
21686
|
+
/* @__PURE__ */ jsxs30(Text30, { color: focused ? PALETTE.warning : void 0, bold: focused, dimColor: !focused, children: [
|
|
21687
|
+
focused ? "\u203A " : " ",
|
|
21688
|
+
"default:"
|
|
21689
|
+
] }),
|
|
21690
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, children: "(no values defined)" })
|
|
21877
21691
|
] });
|
|
21878
21692
|
}
|
|
21879
21693
|
const display = typeof prop.default === "string" && prop.default !== "" ? prop.default : "(unset)";
|
|
21880
|
-
return /* @__PURE__ */
|
|
21694
|
+
return /* @__PURE__ */ jsx33(DefaultValueRow, { display, active, focused });
|
|
21881
21695
|
}
|
|
21882
21696
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
21883
21697
|
if (active) {
|
|
21884
|
-
return /* @__PURE__ */
|
|
21885
|
-
/* @__PURE__ */
|
|
21886
|
-
/* @__PURE__ */
|
|
21887
|
-
/* @__PURE__ */
|
|
21888
|
-
/* @__PURE__ */
|
|
21889
|
-
/* @__PURE__ */
|
|
21698
|
+
return /* @__PURE__ */ jsxs30(Box29, { paddingLeft: 2, flexDirection: "row", children: [
|
|
21699
|
+
/* @__PURE__ */ jsx33(DefaultLabel, { focused }),
|
|
21700
|
+
/* @__PURE__ */ jsxs30(Box29, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
|
|
21701
|
+
/* @__PURE__ */ jsx33(Text30, { children: value.slice(0, textCursor) }),
|
|
21702
|
+
/* @__PURE__ */ jsx33(Text30, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
21703
|
+
/* @__PURE__ */ jsx33(Text30, { children: value.slice(textCursor + 1) })
|
|
21890
21704
|
] })
|
|
21891
21705
|
] });
|
|
21892
21706
|
}
|
|
21893
|
-
return /* @__PURE__ */
|
|
21894
|
-
/* @__PURE__ */
|
|
21895
|
-
/* @__PURE__ */
|
|
21707
|
+
return /* @__PURE__ */ jsxs30(Box29, { paddingLeft: 2, gap: 1, children: [
|
|
21708
|
+
/* @__PURE__ */ jsx33(DefaultLabel, { focused }),
|
|
21709
|
+
/* @__PURE__ */ jsx33(Text30, { color: value ? PALETTE.inverse : void 0, dimColor: !value, children: value || "(none)" })
|
|
21710
|
+
] });
|
|
21711
|
+
}
|
|
21712
|
+
function DescriptionField({
|
|
21713
|
+
value,
|
|
21714
|
+
focused,
|
|
21715
|
+
editing,
|
|
21716
|
+
textCursor,
|
|
21717
|
+
cursorVisible,
|
|
21718
|
+
width,
|
|
21719
|
+
label = "desc:",
|
|
21720
|
+
compact = false
|
|
21721
|
+
}) {
|
|
21722
|
+
const cursor = cursorVisible ? "\u2588" : " ";
|
|
21723
|
+
const outerWidth = width === void 0 ? void 0 : Math.max(1, width - 2);
|
|
21724
|
+
const contentWidth = outerWidth === void 0 ? void 0 : Math.max(1, outerWidth - 2);
|
|
21725
|
+
if (compact) {
|
|
21726
|
+
return /* @__PURE__ */ jsxs30(Box29, { paddingLeft: 2, width: outerWidth, children: [
|
|
21727
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, children: ` ${label}` }),
|
|
21728
|
+
/* @__PURE__ */ jsx33(Text30, { wrap: "truncate-end", color: value ? PALETTE.success : void 0, dimColor: !value, children: ` ${value || "\u2014"}` })
|
|
21729
|
+
] });
|
|
21730
|
+
}
|
|
21731
|
+
return /* @__PURE__ */ jsxs30(Box29, { paddingLeft: 2, flexDirection: "column", width: outerWidth, children: [
|
|
21732
|
+
/* @__PURE__ */ jsxs30(Text30, { color: focused ? PALETTE.warning : void 0, bold: focused, dimColor: !focused, children: [
|
|
21733
|
+
focused ? "\u203A " : " ",
|
|
21734
|
+
label
|
|
21735
|
+
] }),
|
|
21736
|
+
/* @__PURE__ */ jsx33(Box29, { width: contentWidth, borderStyle: "round", borderColor: focused ? PALETTE.info : PALETTE.border, paddingX: 1, children: editing ? /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
21737
|
+
/* @__PURE__ */ jsx33(Text30, { children: value.slice(0, textCursor) }),
|
|
21738
|
+
/* @__PURE__ */ jsx33(Text30, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
21739
|
+
/* @__PURE__ */ jsx33(Text30, { children: value.slice(textCursor + 1) })
|
|
21740
|
+
] }) : /* @__PURE__ */ jsx33(Text30, { color: PALETTE.success, wrap: "wrap", children: value || "\u2014" }) })
|
|
21896
21741
|
] });
|
|
21897
21742
|
}
|
|
21898
21743
|
function PropRow({
|
|
21899
21744
|
prop,
|
|
21900
21745
|
selected,
|
|
21901
21746
|
activeField,
|
|
21747
|
+
editingField,
|
|
21902
21748
|
textCursor,
|
|
21903
21749
|
valueCursor,
|
|
21904
21750
|
cursorVisible,
|
|
@@ -21908,65 +21754,92 @@ function PropRow({
|
|
|
21908
21754
|
rationale,
|
|
21909
21755
|
rowKey
|
|
21910
21756
|
}) {
|
|
21911
|
-
const
|
|
21912
|
-
const descActive =
|
|
21913
|
-
return /* @__PURE__ */
|
|
21914
|
-
/* @__PURE__ */
|
|
21915
|
-
/* @__PURE__ */
|
|
21916
|
-
/* @__PURE__ */
|
|
21917
|
-
|
|
21918
|
-
|
|
21919
|
-
|
|
21920
|
-
|
|
21921
|
-
|
|
21922
|
-
|
|
21923
|
-
|
|
21924
|
-
"
|
|
21925
|
-
|
|
21926
|
-
|
|
21927
|
-
|
|
21928
|
-
] }),
|
|
21929
|
-
|
|
21930
|
-
|
|
21931
|
-
|
|
21932
|
-
|
|
21757
|
+
const descFocused = activeField === "description";
|
|
21758
|
+
const descActive = editingField && descFocused;
|
|
21759
|
+
return /* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", width, children: [
|
|
21760
|
+
/* @__PURE__ */ jsxs30(Box29, { gap: 1, flexWrap: "wrap", children: [
|
|
21761
|
+
/* @__PURE__ */ jsx33(RowLabel, { name: prop.name, selected }),
|
|
21762
|
+
/* @__PURE__ */ jsx33(InlinePropField, { label: "type:", selected, focused: activeField === "type", children: editingField && activeField === "type" ? /* @__PURE__ */ jsx33(Picker, { value: prop.type, active: true }) : /* @__PURE__ */ jsx33(Text30, { color: selected ? PALETTE.warning : PALETTE.inverse, children: prop.type }) }),
|
|
21763
|
+
/* @__PURE__ */ jsx33(
|
|
21764
|
+
InlinePropField,
|
|
21765
|
+
{
|
|
21766
|
+
label: "category:",
|
|
21767
|
+
selected,
|
|
21768
|
+
focused: activeField === "category",
|
|
21769
|
+
flexible: editingField && activeField === "category",
|
|
21770
|
+
children: editingField && activeField === "category" ? /* @__PURE__ */ jsx33(Text30, { color: selected ? PALETTE.warning : PALETTE.inverse, bold: true, wrap: "wrap", children: `[Enter] switch to ${categorySwitchTarget(prop.category)} property` }) : /* @__PURE__ */ jsx33(Text30, { color: selected ? PALETTE.warning : PALETTE.inverse, children: prop.category })
|
|
21771
|
+
}
|
|
21772
|
+
),
|
|
21773
|
+
/* @__PURE__ */ jsx33(InlinePropField, { label: "req:", selected, focused: activeField === "required", children: /* @__PURE__ */ jsx33(Toggle, { value: prop.required, active: editingField && activeField === "required" }) }),
|
|
21774
|
+
prop.type === "token" && /* @__PURE__ */ jsx33(InlinePropField, { label: "kind:", selected, focused: activeField === "tokenKind", children: editingField && activeField === "tokenKind" ? /* @__PURE__ */ jsx33(Picker, { value: prop.tokenKind || DESIGN_TOKEN_TYPES2[0], active: true }) : /* @__PURE__ */ jsx33(Text30, { color: selected ? PALETTE.success : PALETTE.inverse, children: prop.tokenKind || "\u2014" }) })
|
|
21775
|
+
] }),
|
|
21776
|
+
prop.type === "enum" && /* @__PURE__ */ jsxs30(Box29, { paddingLeft: 2, gap: 1, flexWrap: "wrap", children: [
|
|
21777
|
+
/* @__PURE__ */ jsxs30(
|
|
21778
|
+
Text30,
|
|
21779
|
+
{
|
|
21780
|
+
color: activeField === "values" ? PALETTE.warning : void 0,
|
|
21781
|
+
bold: activeField === "values",
|
|
21782
|
+
dimColor: !selected,
|
|
21783
|
+
children: [
|
|
21784
|
+
activeField === "values" ? "\u203A " : " ",
|
|
21785
|
+
"values:"
|
|
21786
|
+
]
|
|
21787
|
+
}
|
|
21788
|
+
),
|
|
21789
|
+
/* @__PURE__ */ jsx33(Box29, { flexGrow: 1, children: /* @__PURE__ */ jsxs30(Text30, { color: selected ? PALETTE.warning : PALETTE.inverse, wrap: "wrap", children: [
|
|
21790
|
+
"[",
|
|
21791
|
+
prop.values.join(", "),
|
|
21792
|
+
"]"
|
|
21793
|
+
] }) })
|
|
21933
21794
|
] }),
|
|
21934
|
-
|
|
21795
|
+
/* @__PURE__ */ jsx33(
|
|
21935
21796
|
DefaultSubRow,
|
|
21936
21797
|
{
|
|
21937
21798
|
prop,
|
|
21938
|
-
active: activeField === "default",
|
|
21799
|
+
active: selected && editingField && activeField === "default",
|
|
21800
|
+
focused: selected && activeField === "default",
|
|
21939
21801
|
textCursor,
|
|
21940
21802
|
cursorVisible
|
|
21941
21803
|
}
|
|
21942
21804
|
),
|
|
21943
|
-
|
|
21944
|
-
|
|
21945
|
-
|
|
21946
|
-
|
|
21947
|
-
|
|
21948
|
-
|
|
21949
|
-
|
|
21950
|
-
|
|
21951
|
-
|
|
21952
|
-
|
|
21953
|
-
|
|
21954
|
-
|
|
21955
|
-
selected && prop.type === "token" && prop.category === "design" && /* @__PURE__ */
|
|
21956
|
-
/* @__PURE__ */
|
|
21957
|
-
|
|
21805
|
+
/* @__PURE__ */ jsx33(
|
|
21806
|
+
DescriptionField,
|
|
21807
|
+
{
|
|
21808
|
+
value: prop.description,
|
|
21809
|
+
focused: selected && descFocused,
|
|
21810
|
+
editing: selected && descActive,
|
|
21811
|
+
textCursor,
|
|
21812
|
+
cursorVisible,
|
|
21813
|
+
width,
|
|
21814
|
+
compact: !selected
|
|
21815
|
+
}
|
|
21816
|
+
),
|
|
21817
|
+
selected && prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs30(Box29, { paddingLeft: 2, flexDirection: "row", gap: 1, children: [
|
|
21818
|
+
/* @__PURE__ */ jsxs30(
|
|
21819
|
+
Text30,
|
|
21820
|
+
{
|
|
21821
|
+
color: activeField === "allowed" ? PALETTE.warning : void 0,
|
|
21822
|
+
bold: activeField === "allowed",
|
|
21823
|
+
dimColor: !selected,
|
|
21824
|
+
children: [
|
|
21825
|
+
activeField === "allowed" ? "\u203A " : " ",
|
|
21826
|
+
"allowed:"
|
|
21827
|
+
]
|
|
21828
|
+
}
|
|
21829
|
+
),
|
|
21830
|
+
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx33(Box29, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: /* @__PURE__ */ jsx33(Text30, { dimColor: true, children: "press [t] to edit allowed tokens" }) }) : /* @__PURE__ */ jsx33(Text30, { color: prop.allowed.length > 0 ? PALETTE.info : void 0, dimColor: prop.allowed.length === 0, children: prop.allowed.length > 0 ? prop.allowed.join(", ") : "(any)" })
|
|
21958
21831
|
] }),
|
|
21959
|
-
selected && rationale && rationale.trim().length > 0 && /* @__PURE__ */
|
|
21832
|
+
selected && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx33(Box29, { paddingLeft: 2, children: /* @__PURE__ */ jsx33(Text30, { dimColor: true, children: (() => {
|
|
21960
21833
|
const max = Math.max(8, width - 8);
|
|
21961
21834
|
const text = `~ ${rationale}`;
|
|
21962
21835
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
21963
21836
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
21964
|
-
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */
|
|
21965
|
-
/* @__PURE__ */
|
|
21966
|
-
/* @__PURE__ */
|
|
21967
|
-
activeField === "values" && /* @__PURE__ */
|
|
21837
|
+
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs30(Box29, { paddingLeft: 2, flexDirection: "column", children: [
|
|
21838
|
+
/* @__PURE__ */ jsxs30(Box29, { children: [
|
|
21839
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, children: "values:" }),
|
|
21840
|
+
activeField === "values" && /* @__PURE__ */ jsx33(Text30, { dimColor: true, children: " [a]dd [e]dit [r]emove [\u2191\u2193] navigate [K/J] reorder" })
|
|
21968
21841
|
] }),
|
|
21969
|
-
/* @__PURE__ */
|
|
21842
|
+
/* @__PURE__ */ jsx33(
|
|
21970
21843
|
EditableValueList,
|
|
21971
21844
|
{
|
|
21972
21845
|
values: prop.values,
|
|
@@ -21986,6 +21859,7 @@ function SlotRow({
|
|
|
21986
21859
|
slot,
|
|
21987
21860
|
selected,
|
|
21988
21861
|
activeField,
|
|
21862
|
+
editingField,
|
|
21989
21863
|
textCursor,
|
|
21990
21864
|
valueCursor,
|
|
21991
21865
|
cursorVisible,
|
|
@@ -21995,67 +21869,87 @@ function SlotRow({
|
|
|
21995
21869
|
pickerCandidates,
|
|
21996
21870
|
pickerCursor
|
|
21997
21871
|
}) {
|
|
21998
|
-
|
|
21999
|
-
|
|
22000
|
-
|
|
22001
|
-
/* @__PURE__ */
|
|
22002
|
-
/* @__PURE__ */ jsx34(Text31, { dimColor: !selected, children: "req:" }),
|
|
22003
|
-
activeField === "required" ? /* @__PURE__ */ jsx34(Toggle, { value: slot.required, active: true }) : /* @__PURE__ */ jsx34(Toggle, { value: slot.required, active: false })
|
|
21872
|
+
return /* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", width, children: [
|
|
21873
|
+
/* @__PURE__ */ jsxs30(Box29, { gap: 1, flexWrap: "wrap", children: [
|
|
21874
|
+
/* @__PURE__ */ jsx33(RowLabel, { name: slot.name, selected }),
|
|
21875
|
+
/* @__PURE__ */ jsx33(InlinePropField, { label: "req:", selected, focused: activeField === "required", children: /* @__PURE__ */ jsx33(Toggle, { value: slot.required, active: editingField && activeField === "required" }) })
|
|
22004
21876
|
] }),
|
|
22005
|
-
!selected && /* @__PURE__ */
|
|
22006
|
-
/* @__PURE__ */
|
|
22007
|
-
|
|
21877
|
+
!selected && /* @__PURE__ */ jsxs30(Box29, { paddingLeft: 2, gap: 1, flexWrap: "wrap", children: [
|
|
21878
|
+
/* @__PURE__ */ jsxs30(
|
|
21879
|
+
Text30,
|
|
21880
|
+
{
|
|
21881
|
+
color: activeField === "allowedComponents" ? PALETTE.warning : void 0,
|
|
21882
|
+
bold: activeField === "allowedComponents",
|
|
21883
|
+
dimColor: !selected,
|
|
21884
|
+
children: [
|
|
21885
|
+
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
21886
|
+
"allowed:"
|
|
21887
|
+
]
|
|
21888
|
+
}
|
|
21889
|
+
),
|
|
21890
|
+
/* @__PURE__ */ jsx33(Box29, { flexGrow: 1, children: slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx33(Text30, { dimColor: true, children: "(any)" }) : /* @__PURE__ */ jsx33(Text30, { color: PALETTE.info, wrap: "wrap", children: slot.allowedComponents.join(", ") }) })
|
|
22008
21891
|
] }),
|
|
22009
|
-
selected && /* @__PURE__ */
|
|
22010
|
-
/* @__PURE__ */
|
|
22011
|
-
/* @__PURE__ */
|
|
22012
|
-
|
|
21892
|
+
selected && /* @__PURE__ */ jsxs30(Box29, { paddingLeft: 2, flexDirection: "column", children: [
|
|
21893
|
+
/* @__PURE__ */ jsxs30(Box29, { children: [
|
|
21894
|
+
/* @__PURE__ */ jsxs30(
|
|
21895
|
+
Text30,
|
|
21896
|
+
{
|
|
21897
|
+
color: activeField === "allowedComponents" ? PALETTE.warning : void 0,
|
|
21898
|
+
bold: activeField === "allowedComponents",
|
|
21899
|
+
dimColor: !selected,
|
|
21900
|
+
children: [
|
|
21901
|
+
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
21902
|
+
"allowed:"
|
|
21903
|
+
]
|
|
21904
|
+
}
|
|
21905
|
+
),
|
|
21906
|
+
editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsx33(Text30, { dimColor: true, children: slot.allowedComponents.length > 0 ? " [a]dd [e]dit [r]emove [\u2190\u2192] cycle [\u2191\u2193] navigate [K/J] reorder" : " [a]dd [e]dit [r]emove [\u2191\u2193] navigate [K/J] reorder" })
|
|
22013
21907
|
] }),
|
|
22014
|
-
/* @__PURE__ */
|
|
21908
|
+
/* @__PURE__ */ jsx33(
|
|
22015
21909
|
EditableValueList,
|
|
22016
21910
|
{
|
|
22017
21911
|
values: slot.allowedComponents,
|
|
22018
21912
|
valueCursor,
|
|
22019
|
-
cursorActive: activeField === "allowedComponents",
|
|
21913
|
+
cursorActive: editingField && activeField === "allowedComponents",
|
|
22020
21914
|
editingValue,
|
|
22021
21915
|
valueText,
|
|
22022
21916
|
cursorVisible,
|
|
22023
|
-
emptyMessage: activeField === "allowedComponents" ? "(any \u2014 press [a] to add)" : "(any)",
|
|
21917
|
+
emptyMessage: editingField && activeField === "allowedComponents" ? "(any \u2014 press [a] to add)" : "(any)",
|
|
22024
21918
|
emptyPaddingLeft: 2,
|
|
22025
|
-
showAddInput: activeField === "allowedComponents"
|
|
21919
|
+
showAddInput: editingField && activeField === "allowedComponents"
|
|
22026
21920
|
}
|
|
22027
21921
|
),
|
|
22028
|
-
editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */
|
|
21922
|
+
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx33(Box29, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx33(Text30, { dimColor: true, children: "(no valid components to add \u2014 all remaining candidates would create cycles)" }) : (() => {
|
|
22029
21923
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
22030
21924
|
if (filtered.length === 0) {
|
|
22031
|
-
return /* @__PURE__ */
|
|
21925
|
+
return /* @__PURE__ */ jsx33(Text30, { dimColor: true, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
22032
21926
|
}
|
|
22033
|
-
const
|
|
21927
|
+
const cursor = pickerCursor % filtered.length;
|
|
22034
21928
|
const MAX_VISIBLE = 5;
|
|
22035
|
-
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE,
|
|
21929
|
+
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor - 2));
|
|
22036
21930
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
22037
|
-
return /* @__PURE__ */
|
|
22038
|
-
/* @__PURE__ */
|
|
21931
|
+
return /* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", children: [
|
|
21932
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
22039
21933
|
slice.map((name, i) => {
|
|
22040
21934
|
const absIdx = start + i;
|
|
22041
|
-
const isCursor = absIdx ===
|
|
22042
|
-
return /* @__PURE__ */
|
|
21935
|
+
const isCursor = absIdx === cursor;
|
|
21936
|
+
return /* @__PURE__ */ jsx33(Text30, { color: isCursor ? PALETTE.info : void 0, dimColor: !isCursor, children: isCursor ? ` ${figures4.pointer} ${name}` : ` ${name}` }, name);
|
|
22043
21937
|
})
|
|
22044
21938
|
] });
|
|
22045
21939
|
})() })
|
|
22046
21940
|
] }),
|
|
22047
|
-
|
|
22048
|
-
|
|
22049
|
-
|
|
22050
|
-
|
|
22051
|
-
|
|
22052
|
-
|
|
22053
|
-
|
|
22054
|
-
|
|
22055
|
-
|
|
22056
|
-
|
|
22057
|
-
|
|
22058
|
-
|
|
21941
|
+
/* @__PURE__ */ jsx33(
|
|
21942
|
+
DescriptionField,
|
|
21943
|
+
{
|
|
21944
|
+
value: slot.description,
|
|
21945
|
+
focused: selected && activeField === "description",
|
|
21946
|
+
editing: selected && editingField && activeField === "description",
|
|
21947
|
+
textCursor,
|
|
21948
|
+
cursorVisible,
|
|
21949
|
+
width,
|
|
21950
|
+
compact: !selected
|
|
21951
|
+
}
|
|
21952
|
+
)
|
|
22059
21953
|
] });
|
|
22060
21954
|
}
|
|
22061
21955
|
function propFields(prop) {
|
|
@@ -22150,6 +22044,7 @@ function FieldEditor({
|
|
|
22150
22044
|
value,
|
|
22151
22045
|
width,
|
|
22152
22046
|
height,
|
|
22047
|
+
fixedHeight = false,
|
|
22153
22048
|
active = true,
|
|
22154
22049
|
onChange,
|
|
22155
22050
|
onSave,
|
|
@@ -22173,6 +22068,8 @@ function FieldEditor({
|
|
|
22173
22068
|
const { state: initialState, error: parseError } = parseToState(value);
|
|
22174
22069
|
const [editorState, setEditorState] = useState15(initialState);
|
|
22175
22070
|
const [parseErr] = useState15(parseError);
|
|
22071
|
+
const [listScrollStart, setListScrollStart] = useState15(0);
|
|
22072
|
+
const initialFocusScrollApplied = React14.useRef(false);
|
|
22176
22073
|
const initialFocus = (() => {
|
|
22177
22074
|
if (initialFocusTarget?.kind === "description") {
|
|
22178
22075
|
return {
|
|
@@ -22245,6 +22142,7 @@ function FieldEditor({
|
|
|
22245
22142
|
const [inSlots, setInSlots] = useState15(initialFocus.inSlots);
|
|
22246
22143
|
const [inComponentDesc, setInComponentDesc] = useState15(initialFocus.focusLevel === "componentDescription");
|
|
22247
22144
|
const [activeField, setActiveField] = useState15(initialFocus.activeField);
|
|
22145
|
+
const [editingField, setEditingField] = useState15(false);
|
|
22248
22146
|
const [textCursor, setTextCursor] = useState15(initialFocus.textCursor);
|
|
22249
22147
|
const [valueCursor, setValueCursor] = useState15(0);
|
|
22250
22148
|
const [editingValue, setEditingValue] = useState15(null);
|
|
@@ -22310,7 +22208,7 @@ function FieldEditor({
|
|
|
22310
22208
|
setFocusLevel("slot");
|
|
22311
22209
|
}
|
|
22312
22210
|
};
|
|
22313
|
-
const textEntryActive = focusLevel === "field" && activeField === "description" || focusLevel === "field" && activeField === "default" && (editorState.props[propIdx]?.type === "string" || editorState.props[propIdx]?.type === "token") || editingValue != null;
|
|
22211
|
+
const textEntryActive = focusLevel === "field" && editingField && activeField === "description" || focusLevel === "field" && editingField && activeField === "default" && (editorState.props[propIdx]?.type === "string" || editorState.props[propIdx]?.type === "token") || editingValue != null;
|
|
22314
22212
|
React14.useEffect(() => {
|
|
22315
22213
|
onTextEntryActiveChange?.(textEntryActive);
|
|
22316
22214
|
}, [textEntryActive, onTextEntryActiveChange]);
|
|
@@ -22343,9 +22241,7 @@ function FieldEditor({
|
|
|
22343
22241
|
}
|
|
22344
22242
|
}, []);
|
|
22345
22243
|
const initialStateRef = React14.useRef(initialState);
|
|
22346
|
-
const
|
|
22347
|
-
() => canonicalize(serializeState(initialState, value))
|
|
22348
|
-
);
|
|
22244
|
+
const baselineCanonical = canonicalize(serializeState(initialStateRef.current, value));
|
|
22349
22245
|
const currentCanonical = canonicalize(serializeState(editorState, value));
|
|
22350
22246
|
const isDirty = currentCanonical !== baselineCanonical;
|
|
22351
22247
|
React14.useEffect(() => {
|
|
@@ -22362,15 +22258,15 @@ function FieldEditor({
|
|
|
22362
22258
|
useImmediateInput((input, key) => {
|
|
22363
22259
|
if (!active) return;
|
|
22364
22260
|
if (showHelp) {
|
|
22365
|
-
if (input === "
|
|
22261
|
+
if (input === "h" || key.escape) {
|
|
22366
22262
|
setShowHelp(false);
|
|
22367
22263
|
}
|
|
22368
22264
|
return;
|
|
22369
22265
|
}
|
|
22370
|
-
const inDescriptionTextEntryForHelp = focusLevel === "field" && activeField === "description";
|
|
22371
|
-
const inStringDefaultTextEntryForHelp = focusLevel === "field" && activeField === "default" && currentProp != null && (currentProp.type === "string" || currentProp.type === "token");
|
|
22266
|
+
const inDescriptionTextEntryForHelp = focusLevel === "field" && editingField && activeField === "description";
|
|
22267
|
+
const inStringDefaultTextEntryForHelp = focusLevel === "field" && editingField && activeField === "default" && currentProp != null && (currentProp.type === "string" || currentProp.type === "token");
|
|
22372
22268
|
const inValueListTextEntry = editingValue != null;
|
|
22373
|
-
if (input === "
|
|
22269
|
+
if (input === "h" && !key.ctrl && !key.meta && !inDescriptionTextEntryForHelp && !inStringDefaultTextEntryForHelp && !inValueListTextEntry) {
|
|
22374
22270
|
setShowHelp(true);
|
|
22375
22271
|
return;
|
|
22376
22272
|
}
|
|
@@ -22462,16 +22358,8 @@ function FieldEditor({
|
|
|
22462
22358
|
}
|
|
22463
22359
|
return;
|
|
22464
22360
|
}
|
|
22465
|
-
|
|
22466
|
-
|
|
22467
|
-
const canonicalNow = canonicalize(serializeState(editorState, value));
|
|
22468
|
-
setBaselineCanonical(canonicalNow);
|
|
22469
|
-
initialStateRef.current = editorState;
|
|
22470
|
-
onSave();
|
|
22471
|
-
return;
|
|
22472
|
-
}
|
|
22473
|
-
const inDescriptionTextEntry = focusLevel === "field" && activeField === "description";
|
|
22474
|
-
const inComponentDescTextEntry = focusLevel === "field" && inComponentDesc && activeField === "description";
|
|
22361
|
+
const inDescriptionTextEntry = focusLevel === "field" && editingField && activeField === "description";
|
|
22362
|
+
const inComponentDescTextEntry = focusLevel === "field" && editingField && inComponentDesc && activeField === "description";
|
|
22475
22363
|
if (input === "s" && !key.ctrl && !key.meta && !inDescriptionTextEntry && !inComponentDescTextEntry) {
|
|
22476
22364
|
if (onToggleSourceExternal) {
|
|
22477
22365
|
onToggleSourceExternal();
|
|
@@ -22483,8 +22371,8 @@ function FieldEditor({
|
|
|
22483
22371
|
return;
|
|
22484
22372
|
}
|
|
22485
22373
|
if (rationaleOpen && !onTogglePropRationale) {
|
|
22486
|
-
const
|
|
22487
|
-
const next = computeNextScrollOffset(rationaleScrollOffset, input, key, 9999,
|
|
22374
|
+
const PANEL_HEIGHT = 12;
|
|
22375
|
+
const next = computeNextScrollOffset(rationaleScrollOffset, input, key, 9999, PANEL_HEIGHT);
|
|
22488
22376
|
if (next !== null) {
|
|
22489
22377
|
setRationaleScrollOffset(() => next);
|
|
22490
22378
|
return;
|
|
@@ -22496,7 +22384,13 @@ function FieldEditor({
|
|
|
22496
22384
|
}
|
|
22497
22385
|
return;
|
|
22498
22386
|
}
|
|
22499
|
-
|
|
22387
|
+
if (key.ctrl && input === "s") {
|
|
22388
|
+
initialStateRef.current = editorState;
|
|
22389
|
+
onDirtyChange?.(false);
|
|
22390
|
+
onSave();
|
|
22391
|
+
return;
|
|
22392
|
+
}
|
|
22393
|
+
const inStringDefaultTextEntry = focusLevel === "field" && editingField && activeField === "default" && currentProp != null && (currentProp.type === "string" || currentProp.type === "token");
|
|
22500
22394
|
const rationaleKeyAllowed = !key.ctrl && !key.meta && !inDescriptionTextEntry && !inComponentDescTextEntry && !inStringDefaultTextEntry && !inValueListTextEntry;
|
|
22501
22395
|
if (input === propRationaleKey && rationaleKeyAllowed && onTogglePropRationale) {
|
|
22502
22396
|
onTogglePropRationale();
|
|
@@ -22518,9 +22412,16 @@ function FieldEditor({
|
|
|
22518
22412
|
}
|
|
22519
22413
|
if (key.escape) {
|
|
22520
22414
|
if (focusLevel === "field") {
|
|
22521
|
-
if (
|
|
22522
|
-
|
|
22523
|
-
|
|
22415
|
+
if (editingField) {
|
|
22416
|
+
initialStateRef.current = editorState;
|
|
22417
|
+
onDirtyChange?.(false);
|
|
22418
|
+
onSave();
|
|
22419
|
+
setEditingField(false);
|
|
22420
|
+
} else {
|
|
22421
|
+
if (inComponentDesc) setFocusLevel("componentDescription");
|
|
22422
|
+
else setFocusLevel(inSlots ? "slot" : "prop");
|
|
22423
|
+
setActiveField(null);
|
|
22424
|
+
}
|
|
22524
22425
|
return;
|
|
22525
22426
|
}
|
|
22526
22427
|
if (onExit) {
|
|
@@ -22531,10 +22432,10 @@ function FieldEditor({
|
|
|
22531
22432
|
return;
|
|
22532
22433
|
}
|
|
22533
22434
|
if (focusLevel === "componentDescription") {
|
|
22534
|
-
if (key.upArrow
|
|
22435
|
+
if (key.upArrow) {
|
|
22535
22436
|
return;
|
|
22536
22437
|
}
|
|
22537
|
-
if (key.downArrow
|
|
22438
|
+
if (key.downArrow) {
|
|
22538
22439
|
const firstSelectableRow = selectableRows[0];
|
|
22539
22440
|
if (firstSelectableRow) focusSelectableRow(firstSelectableRow);
|
|
22540
22441
|
return;
|
|
@@ -22542,13 +22443,16 @@ function FieldEditor({
|
|
|
22542
22443
|
if (key.return) {
|
|
22543
22444
|
setFocusLevel("field");
|
|
22544
22445
|
setActiveField("description");
|
|
22446
|
+
setEditingField(false);
|
|
22545
22447
|
setTextCursor(editorState.componentDescription.length);
|
|
22546
22448
|
return;
|
|
22547
22449
|
}
|
|
22548
22450
|
return;
|
|
22549
22451
|
}
|
|
22550
22452
|
if (focusLevel === "prop" || focusLevel === "slot") {
|
|
22551
|
-
|
|
22453
|
+
const rowPrevious = key.upArrow || input === "k";
|
|
22454
|
+
const rowNext = key.downArrow || input === "j";
|
|
22455
|
+
if (rowPrevious) {
|
|
22552
22456
|
if (selectedSelectableIndex > 0) {
|
|
22553
22457
|
focusSelectableRow(selectableRows[selectedSelectableIndex - 1]);
|
|
22554
22458
|
} else if (selectedSelectableIndex === 0) {
|
|
@@ -22558,7 +22462,7 @@ function FieldEditor({
|
|
|
22558
22462
|
}
|
|
22559
22463
|
return;
|
|
22560
22464
|
}
|
|
22561
|
-
if (
|
|
22465
|
+
if (rowNext) {
|
|
22562
22466
|
if (selectedSelectableIndex >= 0 && selectedSelectableIndex < selectableRows.length - 1) {
|
|
22563
22467
|
focusSelectableRow(selectableRows[selectedSelectableIndex + 1]);
|
|
22564
22468
|
}
|
|
@@ -22567,12 +22471,14 @@ function FieldEditor({
|
|
|
22567
22471
|
if (focusLevel === "slot" && key.return && currentSlot) {
|
|
22568
22472
|
setFocusLevel("field");
|
|
22569
22473
|
setActiveField(SLOT_FIELDS[0] ?? null);
|
|
22474
|
+
setEditingField(false);
|
|
22570
22475
|
setTextCursor(currentSlot.description.length);
|
|
22571
22476
|
return;
|
|
22572
22477
|
}
|
|
22573
22478
|
if (focusLevel === "prop" && key.return && currentProp) {
|
|
22574
22479
|
setFocusLevel("field");
|
|
22575
22480
|
setActiveField(propFields(currentProp)[0] ?? null);
|
|
22481
|
+
setEditingField(false);
|
|
22576
22482
|
setTextCursor(currentProp.description.length);
|
|
22577
22483
|
return;
|
|
22578
22484
|
}
|
|
@@ -22581,33 +22487,22 @@ function FieldEditor({
|
|
|
22581
22487
|
if (focusLevel === "field") {
|
|
22582
22488
|
const fields = inSlots ? SLOT_FIELDS : currentProp ? propFields(currentProp) : [];
|
|
22583
22489
|
const currentFieldIdx = fields.indexOf(activeField);
|
|
22584
|
-
const isDescriptionTextEntry = activeField === "description";
|
|
22585
|
-
const isDefaultTextEntry = activeField === "default" && currentProp != null && (currentProp.type === "string" || currentProp.type === "token");
|
|
22586
22490
|
const isValuesNav = activeField === "values" || activeField === "allowedComponents";
|
|
22587
22491
|
const arrowUp = key.upArrow;
|
|
22588
22492
|
const arrowDown = key.downArrow;
|
|
22589
|
-
|
|
22590
|
-
|
|
22591
|
-
|
|
22592
|
-
|
|
22593
|
-
|
|
22594
|
-
|
|
22595
|
-
return;
|
|
22596
|
-
}
|
|
22597
|
-
} else if (arrowDown || input === "j") {
|
|
22598
|
-
if (valueCursor < vals.length - 1) {
|
|
22599
|
-
setValueCursor((c2) => Math.min(vals.length - 1, c2 + 1));
|
|
22600
|
-
return;
|
|
22601
|
-
}
|
|
22602
|
-
}
|
|
22493
|
+
const arrowLeft = key.leftArrow;
|
|
22494
|
+
const arrowRight = key.rightArrow;
|
|
22495
|
+
if (!editingField) {
|
|
22496
|
+
if (key.return) {
|
|
22497
|
+
setEditingField(true);
|
|
22498
|
+
return;
|
|
22603
22499
|
}
|
|
22604
|
-
|
|
22605
|
-
|
|
22606
|
-
const
|
|
22607
|
-
|
|
22608
|
-
if ((navUp || navDown) && fields.length > 0) {
|
|
22500
|
+
const navPrevious = arrowUp || arrowLeft;
|
|
22501
|
+
const navNext = arrowDown || arrowRight || input === "j";
|
|
22502
|
+
const navBack = navPrevious || input === "k";
|
|
22503
|
+
if ((navBack || navNext) && fields.length > 0) {
|
|
22609
22504
|
const lastIdx = fields.length - 1;
|
|
22610
|
-
const targetIdx =
|
|
22505
|
+
const targetIdx = navNext ? currentFieldIdx >= lastIdx ? 0 : currentFieldIdx + 1 : currentFieldIdx <= 0 ? lastIdx : currentFieldIdx - 1;
|
|
22611
22506
|
const next = fields[targetIdx];
|
|
22612
22507
|
setActiveField(next);
|
|
22613
22508
|
if (next === "description") {
|
|
@@ -22618,9 +22513,38 @@ function FieldEditor({
|
|
|
22618
22513
|
setTextCursor(cur.length);
|
|
22619
22514
|
} else if (next === "values" || next === "allowedComponents") {
|
|
22620
22515
|
const nextVals = next === "values" && currentProp ? currentProp.values : next === "allowedComponents" && currentSlot ? currentSlot.allowedComponents : [];
|
|
22621
|
-
setValueCursor(
|
|
22516
|
+
setValueCursor(navNext ? 0 : Math.max(0, nextVals.length - 1));
|
|
22517
|
+
}
|
|
22518
|
+
}
|
|
22519
|
+
return;
|
|
22520
|
+
}
|
|
22521
|
+
if (key.return && activeField === "category" && currentProp) {
|
|
22522
|
+
const next = categorySwitchTarget(currentProp.category);
|
|
22523
|
+
const nextProps = props.map((p, i) => i === propIdx ? { ...p, category: next } : p);
|
|
22524
|
+
commit({ ...editorState, props: nextProps });
|
|
22525
|
+
setEditingField(false);
|
|
22526
|
+
setActiveField(null);
|
|
22527
|
+
setFocusLevel("prop");
|
|
22528
|
+
return;
|
|
22529
|
+
}
|
|
22530
|
+
if (key.return) {
|
|
22531
|
+
setEditingField(false);
|
|
22532
|
+
return;
|
|
22533
|
+
}
|
|
22534
|
+
if (isValuesNav) {
|
|
22535
|
+
const vals = activeField === "values" && currentProp ? currentProp.values : activeField === "allowedComponents" && currentSlot ? currentSlot.allowedComponents : null;
|
|
22536
|
+
if (vals !== null) {
|
|
22537
|
+
if (arrowUp) {
|
|
22538
|
+
if (valueCursor > 0) {
|
|
22539
|
+
setValueCursor((c2) => Math.max(0, c2 - 1));
|
|
22540
|
+
return;
|
|
22541
|
+
}
|
|
22542
|
+
} else if (arrowDown) {
|
|
22543
|
+
if (valueCursor < vals.length - 1) {
|
|
22544
|
+
setValueCursor((c2) => Math.min(vals.length - 1, c2 + 1));
|
|
22545
|
+
return;
|
|
22546
|
+
}
|
|
22622
22547
|
}
|
|
22623
|
-
return;
|
|
22624
22548
|
}
|
|
22625
22549
|
}
|
|
22626
22550
|
if (activeField === "type" && (key.leftArrow || key.rightArrow) && currentProp) {
|
|
@@ -22639,14 +22563,6 @@ function FieldEditor({
|
|
|
22639
22563
|
commit({ ...editorState, props: nextProps });
|
|
22640
22564
|
return;
|
|
22641
22565
|
}
|
|
22642
|
-
if (activeField === "category" && (key.leftArrow || key.rightArrow) && currentProp) {
|
|
22643
|
-
const options = CDF_PROPERTY_CATEGORIES;
|
|
22644
|
-
const idx = options.indexOf(currentProp.category);
|
|
22645
|
-
const next = key.leftArrow ? options[(idx - 1 + options.length) % options.length] : options[(idx + 1) % options.length];
|
|
22646
|
-
const nextProps = props.map((p, i) => i === propIdx ? { ...p, category: next } : p);
|
|
22647
|
-
commit({ ...editorState, props: nextProps });
|
|
22648
|
-
return;
|
|
22649
|
-
}
|
|
22650
22566
|
if (activeField === "tokenKind" && (key.leftArrow || key.rightArrow) && currentProp) {
|
|
22651
22567
|
const options = DESIGN_TOKEN_TYPES2;
|
|
22652
22568
|
const cur = currentProp.tokenKind || options[0];
|
|
@@ -22794,20 +22710,32 @@ function FieldEditor({
|
|
|
22794
22710
|
setValueCursor((c2) => Math.max(0, Math.min(c2, nextVals.length - 1)));
|
|
22795
22711
|
return;
|
|
22796
22712
|
}
|
|
22713
|
+
if (key.shift && key.upArrow && valueCursor > 0) {
|
|
22714
|
+
const nextVals = swapValues(currentValueList, valueCursor - 1, valueCursor);
|
|
22715
|
+
setCurrentValueList(nextVals);
|
|
22716
|
+
setValueCursor((c2) => c2 - 1);
|
|
22717
|
+
return;
|
|
22718
|
+
}
|
|
22797
22719
|
if (input === "K" && valueCursor > 0) {
|
|
22798
22720
|
const nextVals = swapValues(currentValueList, valueCursor - 1, valueCursor);
|
|
22799
22721
|
setCurrentValueList(nextVals);
|
|
22800
22722
|
setValueCursor((c2) => c2 - 1);
|
|
22801
22723
|
return;
|
|
22802
22724
|
}
|
|
22803
|
-
if (
|
|
22725
|
+
if (key.shift && key.downArrow && valueCursor < currentValueList.length - 1) {
|
|
22804
22726
|
const nextVals = swapValues(currentValueList, valueCursor, valueCursor + 1);
|
|
22805
22727
|
setCurrentValueList(nextVals);
|
|
22806
22728
|
setValueCursor((c2) => c2 + 1);
|
|
22807
22729
|
return;
|
|
22808
22730
|
}
|
|
22809
|
-
|
|
22810
|
-
|
|
22731
|
+
if (input === "J" && valueCursor < currentValueList.length - 1) {
|
|
22732
|
+
const nextVals = swapValues(currentValueList, valueCursor, valueCursor + 1);
|
|
22733
|
+
setCurrentValueList(nextVals);
|
|
22734
|
+
setValueCursor((c2) => c2 + 1);
|
|
22735
|
+
return;
|
|
22736
|
+
}
|
|
22737
|
+
}
|
|
22738
|
+
if (activeField === "allowedComponents" && currentSlot) {
|
|
22811
22739
|
const vals = currentSlot.allowedComponents;
|
|
22812
22740
|
if ((key.leftArrow || key.rightArrow || input === "h" || input === "l") && vals.length > 0 && projectSlotGraph && currentComponentName) {
|
|
22813
22741
|
const candidates = computeAllowedComponentReplacementCandidates(
|
|
@@ -22839,18 +22767,18 @@ function FieldEditor({
|
|
|
22839
22767
|
});
|
|
22840
22768
|
const innerWidth = Math.max(1, width - 2);
|
|
22841
22769
|
if (parseErr) {
|
|
22842
|
-
return /* @__PURE__ */
|
|
22843
|
-
/* @__PURE__ */
|
|
22844
|
-
/* @__PURE__ */
|
|
22845
|
-
/* @__PURE__ */
|
|
22770
|
+
return /* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.error, children: [
|
|
22771
|
+
/* @__PURE__ */ jsx33(Text30, { bold: true, color: PALETTE.error, children: "FIELD EDITOR \u2014 parse error" }),
|
|
22772
|
+
/* @__PURE__ */ jsx33(Text30, { color: PALETTE.error, children: parseErr }),
|
|
22773
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, children: "Cannot display structured editor. Fix the JSON first." })
|
|
22846
22774
|
] });
|
|
22847
22775
|
}
|
|
22848
22776
|
if (props.length === 0 && slots.length === 0) {
|
|
22849
|
-
return /* @__PURE__ */
|
|
22850
|
-
/* @__PURE__ */
|
|
22851
|
-
/* @__PURE__ */
|
|
22852
|
-
/* @__PURE__ */
|
|
22853
|
-
/* @__PURE__ */
|
|
22777
|
+
return /* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.warning, children: [
|
|
22778
|
+
/* @__PURE__ */ jsx33(Text30, { bold: true, color: PALETTE.warning, children: "FIELD EDITOR \u2014 no fields" }),
|
|
22779
|
+
/* @__PURE__ */ jsx33(Text30, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
|
|
22780
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, children: "You can add fields manually below or reject this component." }),
|
|
22781
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, children: "Enter to save \xB7 Esc to discard" })
|
|
22854
22782
|
] });
|
|
22855
22783
|
}
|
|
22856
22784
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
@@ -22858,22 +22786,28 @@ function FieldEditor({
|
|
|
22858
22786
|
if (editingValue) {
|
|
22859
22787
|
return editingValue.mode === "add" ? "Enter to add \xB7 Esc to cancel" : "Enter to save edit \xB7 Esc to cancel";
|
|
22860
22788
|
}
|
|
22861
|
-
if (focusLevel === "field" && activeField === "description") {
|
|
22862
|
-
return "Type to edit \u2190\u2192 cursor \u2191\u2193 cycle field Esc row
|
|
22789
|
+
if (focusLevel === "field" && editingField && activeField === "description") {
|
|
22790
|
+
return "Type to edit \u2190\u2192 cursor \u2191\u2193 cycle field Esc row Enter save";
|
|
22791
|
+
}
|
|
22792
|
+
if (focusLevel === "field" && editingField && (activeField === "type" || activeField === "tokenKind")) {
|
|
22793
|
+
return "\u2190\u2192 cycle value \u2191\u2193/\u2190\u2192 cycle field Esc row";
|
|
22863
22794
|
}
|
|
22864
|
-
if (focusLevel === "field" &&
|
|
22865
|
-
return "
|
|
22795
|
+
if (focusLevel === "field" && editingField && activeField === "category") {
|
|
22796
|
+
return "Enter switch property group \u2191\u2193/\u2190\u2192 cycle field Esc row";
|
|
22866
22797
|
}
|
|
22867
|
-
if (focusLevel === "field" && activeField === "required") {
|
|
22868
|
-
return "Space
|
|
22798
|
+
if (focusLevel === "field" && editingField && activeField === "required") {
|
|
22799
|
+
return "Space toggle Enter save Esc back";
|
|
22869
22800
|
}
|
|
22870
|
-
if (focusLevel === "field" && (activeField === "values" || activeField === "allowedComponents")) {
|
|
22871
|
-
return "[a]dd [e]dit [r]emove \u2191\u2193
|
|
22801
|
+
if (focusLevel === "field" && editingField && (activeField === "values" || activeField === "allowedComponents")) {
|
|
22802
|
+
return "[a]dd [e]dit [r]emove \u2191\u2193 navigate Shift+\u2191/\u2193 reorder Esc row";
|
|
22803
|
+
}
|
|
22804
|
+
if (focusLevel === "field" && !editingField) {
|
|
22805
|
+
return "\u2191\u2193/\u2190\u2192 navigate fields Enter edit Esc back";
|
|
22872
22806
|
}
|
|
22873
22807
|
if (rationaleOpen) {
|
|
22874
|
-
return "
|
|
22808
|
+
return "\u2191\u2193/Ctrl+u/d scroll i/Esc close rationale panel";
|
|
22875
22809
|
}
|
|
22876
|
-
return `\u2191\u2193
|
|
22810
|
+
return `\u2191\u2193 navigate rows Enter edit fields s source ${propRationaleKey} prop rationale ${componentRationaleKey} component rationale h help Esc exit panel`;
|
|
22877
22811
|
})();
|
|
22878
22812
|
const rows = [];
|
|
22879
22813
|
rows.push({ kind: "component-description" });
|
|
@@ -22898,59 +22832,113 @@ function FieldEditor({
|
|
|
22898
22832
|
const selectedRowIdx = rows.findIndex(
|
|
22899
22833
|
(r) => r.kind === "prop" && !inSlots && !inComponentDesc && r.idx === propIdx || r.kind === "slot" && inSlots && r.idx === slotIdx || r.kind === "component-description" && inComponentDesc
|
|
22900
22834
|
);
|
|
22901
|
-
const visibleRows = Math.max(1, height - 3);
|
|
22902
|
-
|
|
22835
|
+
const visibleRows = focusLevel === "field" || initialFocusTarget ? 1 : fixedHeight ? Math.max(1, Math.floor((height - 3) / 3)) : rows.length;
|
|
22836
|
+
useEffect8(() => {
|
|
22837
|
+
if (focusLevel === "field" || selectedRowIdx < 0) return;
|
|
22838
|
+
setListScrollStart((previous) => {
|
|
22839
|
+
const maxStart = Math.max(0, rows.length - visibleRows);
|
|
22840
|
+
if (initialFocusTarget && !initialFocusScrollApplied.current) {
|
|
22841
|
+
initialFocusScrollApplied.current = true;
|
|
22842
|
+
return Math.min(selectedRowIdx, maxStart);
|
|
22843
|
+
}
|
|
22844
|
+
const clamped = Math.min(previous, maxStart);
|
|
22845
|
+
if (selectedRowIdx < clamped) return selectedRowIdx;
|
|
22846
|
+
if (selectedRowIdx >= clamped + visibleRows) {
|
|
22847
|
+
return Math.min(maxStart, selectedRowIdx - visibleRows + 1);
|
|
22848
|
+
}
|
|
22849
|
+
return clamped;
|
|
22850
|
+
});
|
|
22851
|
+
}, [focusLevel, rows.length, selectedRowIdx, visibleRows]);
|
|
22852
|
+
const scrollStart = Math.min(listScrollStart, Math.max(0, rows.length - visibleRows));
|
|
22853
|
+
const nextHeader = rows.slice(scrollStart + visibleRows).find((row) => row.kind === "header");
|
|
22854
|
+
const categoryBelow = focusLevel !== "field" && nextHeader?.kind === "header" ? nextHeader.label.replace(/^──\s*/, "").trim() : null;
|
|
22903
22855
|
const visibleRowSlice = rows.slice(scrollStart, scrollStart + visibleRows);
|
|
22904
|
-
|
|
22905
|
-
|
|
22856
|
+
const focusedSlotPickerCandidates = focusLevel === "field" && inSlots && editingValue?.mode === "add" && activeField === "allowedComponents" && projectSlotGraph && currentComponentName && currentSlot ? computeAllowedComponentCandidates(projectSlotGraph, currentComponentName, slots, currentSlot.name) : null;
|
|
22857
|
+
return /* @__PURE__ */ jsxs30(
|
|
22858
|
+
FixedPanel,
|
|
22906
22859
|
{
|
|
22907
|
-
flexDirection: "column",
|
|
22908
22860
|
width,
|
|
22861
|
+
...fixedHeight ? { height } : { minHeight: height },
|
|
22862
|
+
clipOverflow: fixedHeight,
|
|
22909
22863
|
borderStyle: "single",
|
|
22910
22864
|
borderColor: hasEmptyProperties ? PALETTE.warning : PALETTE.info,
|
|
22911
22865
|
children: [
|
|
22912
|
-
hasEmptyProperties && /* @__PURE__ */
|
|
22913
|
-
/* @__PURE__ */
|
|
22866
|
+
hasEmptyProperties && /* @__PURE__ */ jsx33(Text30, { 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." }),
|
|
22867
|
+
/* @__PURE__ */ jsx33(Box29, { flexDirection: "column", width: innerWidth, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx33(
|
|
22868
|
+
PropRow,
|
|
22869
|
+
{
|
|
22870
|
+
prop: currentProp,
|
|
22871
|
+
selected: true,
|
|
22872
|
+
activeField,
|
|
22873
|
+
editingField,
|
|
22874
|
+
textCursor,
|
|
22875
|
+
valueCursor,
|
|
22876
|
+
cursorVisible,
|
|
22877
|
+
editingValue,
|
|
22878
|
+
valueText,
|
|
22879
|
+
width: innerWidth,
|
|
22880
|
+
rationale: metadata?.props?.[currentProp.name]?.rationale ?? null
|
|
22881
|
+
}
|
|
22882
|
+
) : focusLevel === "field" && inSlots && currentSlot ? /* @__PURE__ */ jsx33(
|
|
22883
|
+
SlotRow,
|
|
22884
|
+
{
|
|
22885
|
+
slot: currentSlot,
|
|
22886
|
+
selected: true,
|
|
22887
|
+
activeField,
|
|
22888
|
+
editingField,
|
|
22889
|
+
textCursor,
|
|
22890
|
+
valueCursor,
|
|
22891
|
+
cursorVisible,
|
|
22892
|
+
editingValue,
|
|
22893
|
+
valueText,
|
|
22894
|
+
width: innerWidth,
|
|
22895
|
+
pickerCandidates: focusedSlotPickerCandidates,
|
|
22896
|
+
pickerCursor
|
|
22897
|
+
}
|
|
22898
|
+
) : visibleRowSlice.map((row, i) => {
|
|
22914
22899
|
if (row.kind === "header") {
|
|
22915
|
-
return /* @__PURE__ */
|
|
22900
|
+
return /* @__PURE__ */ jsx33(Text30, { bold: true, color: PALETTE.success, children: row.label }, `header-${i}`);
|
|
22916
22901
|
}
|
|
22917
22902
|
if (row.kind === "component-description") {
|
|
22918
22903
|
const isSelected2 = inComponentDesc && active;
|
|
22919
|
-
const isEditing = isSelected2 && focusLevel === "field" && activeField === "description";
|
|
22904
|
+
const isEditing = isSelected2 && focusLevel === "field" && editingField && activeField === "description";
|
|
22920
22905
|
const desc = editorState.componentDescription;
|
|
22921
|
-
return /* @__PURE__ */
|
|
22922
|
-
|
|
22923
|
-
|
|
22924
|
-
|
|
22925
|
-
|
|
22926
|
-
|
|
22927
|
-
|
|
22928
|
-
|
|
22929
|
-
|
|
22930
|
-
|
|
22931
|
-
|
|
22932
|
-
|
|
22933
|
-
|
|
22934
|
-
|
|
22935
|
-
] }) : /* @__PURE__ */ jsx34(Text31, { color: isSelected2 ? PALETTE.warning : PALETTE.inverse, dimColor: !desc, children: desc || "(none \u2014 Return to edit)" })
|
|
22936
|
-
] }) }, `component-description-${i}`);
|
|
22906
|
+
return /* @__PURE__ */ jsx33(
|
|
22907
|
+
DescriptionField,
|
|
22908
|
+
{
|
|
22909
|
+
value: desc,
|
|
22910
|
+
focused: isSelected2,
|
|
22911
|
+
editing: isEditing,
|
|
22912
|
+
textCursor,
|
|
22913
|
+
cursorVisible,
|
|
22914
|
+
width: innerWidth,
|
|
22915
|
+
label: "description:",
|
|
22916
|
+
compact: !isSelected2
|
|
22917
|
+
},
|
|
22918
|
+
`component-description-${i}`
|
|
22919
|
+
);
|
|
22937
22920
|
}
|
|
22938
22921
|
if (row.kind === "prop") {
|
|
22939
22922
|
const p = props[row.idx];
|
|
22940
22923
|
const isSelected2 = !inSlots && !inComponentDesc && row.idx === propIdx;
|
|
22941
22924
|
const propMeta = metadata?.props?.[p.name];
|
|
22942
|
-
|
|
22925
|
+
const commonRowProps2 = createCommonRowProps(
|
|
22926
|
+
isSelected2,
|
|
22927
|
+
focusLevel,
|
|
22928
|
+
editingField,
|
|
22929
|
+
textCursor,
|
|
22930
|
+
valueCursor,
|
|
22931
|
+
cursorVisible,
|
|
22932
|
+
editingValue,
|
|
22933
|
+
valueText,
|
|
22934
|
+
innerWidth
|
|
22935
|
+
);
|
|
22936
|
+
return /* @__PURE__ */ jsx33(
|
|
22943
22937
|
PropRow,
|
|
22944
22938
|
{
|
|
22945
22939
|
prop: p,
|
|
22946
|
-
|
|
22940
|
+
...commonRowProps2,
|
|
22947
22941
|
activeField: isSelected2 && focusLevel === "field" ? activeField : null,
|
|
22948
|
-
textCursor,
|
|
22949
|
-
valueCursor,
|
|
22950
|
-
cursorVisible,
|
|
22951
|
-
editingValue: isSelected2 ? editingValue : null,
|
|
22952
|
-
valueText: isSelected2 ? valueText : "",
|
|
22953
|
-
width: innerWidth,
|
|
22954
22942
|
rationale: showInlineRationales ? propMeta?.rationale ?? null : null,
|
|
22955
22943
|
rowKey: String(row.idx)
|
|
22956
22944
|
},
|
|
@@ -22960,24 +22948,30 @@ function FieldEditor({
|
|
|
22960
22948
|
const s = slots[row.idx];
|
|
22961
22949
|
const isSelected = inSlots && row.idx === slotIdx;
|
|
22962
22950
|
const slotPickerCandidates = isSelected && editingValue?.mode === "add" && activeField === "allowedComponents" && projectSlotGraph && currentComponentName ? computeAllowedComponentCandidates(projectSlotGraph, currentComponentName, slots, s.name) : null;
|
|
22963
|
-
|
|
22951
|
+
const commonRowProps = createCommonRowProps(
|
|
22952
|
+
isSelected,
|
|
22953
|
+
focusLevel,
|
|
22954
|
+
editingField,
|
|
22955
|
+
textCursor,
|
|
22956
|
+
valueCursor,
|
|
22957
|
+
cursorVisible,
|
|
22958
|
+
editingValue,
|
|
22959
|
+
valueText,
|
|
22960
|
+
innerWidth
|
|
22961
|
+
);
|
|
22962
|
+
return /* @__PURE__ */ jsx33(
|
|
22964
22963
|
SlotRow,
|
|
22965
22964
|
{
|
|
22966
22965
|
slot: s,
|
|
22967
|
-
|
|
22966
|
+
...commonRowProps,
|
|
22968
22967
|
activeField: isSelected && focusLevel === "field" ? activeField : null,
|
|
22969
|
-
textCursor,
|
|
22970
|
-
valueCursor,
|
|
22971
|
-
cursorVisible,
|
|
22972
|
-
editingValue: isSelected ? editingValue : null,
|
|
22973
|
-
valueText: isSelected ? valueText : "",
|
|
22974
|
-
width: innerWidth,
|
|
22975
22968
|
pickerCandidates: slotPickerCandidates,
|
|
22976
22969
|
pickerCursor
|
|
22977
22970
|
},
|
|
22978
22971
|
`slot-${row.idx}`
|
|
22979
22972
|
);
|
|
22980
22973
|
}) }),
|
|
22974
|
+
categoryBelow && /* @__PURE__ */ jsx33(Text30, { color: PALETTE.success, bold: true, children: `(${categoryBelow} below)` }),
|
|
22981
22975
|
sourceOpen && !onToggleSourceExternal && (() => {
|
|
22982
22976
|
const propMeta = !inSlots && !inComponentDesc && currentProp ? metadata?.props?.[currentProp.name] : void 0;
|
|
22983
22977
|
const start = propMeta?.sourceStartLine ?? null;
|
|
@@ -22986,50 +22980,50 @@ function FieldEditor({
|
|
|
22986
22980
|
const src = metadata?.componentSource ?? null;
|
|
22987
22981
|
const headerPath = path ?? "<unknown source path>";
|
|
22988
22982
|
if (!start || !end || !src) {
|
|
22989
|
-
return /* @__PURE__ */
|
|
22990
|
-
/* @__PURE__ */
|
|
22991
|
-
/* @__PURE__ */
|
|
22992
|
-
/* @__PURE__ */
|
|
22983
|
+
return /* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
22984
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, bold: true, children: `source: ${headerPath}` }),
|
|
22985
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, children: "(no source location captured for this prop)" }),
|
|
22986
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, children: "[s] close" })
|
|
22993
22987
|
] });
|
|
22994
22988
|
}
|
|
22995
22989
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end);
|
|
22996
|
-
return /* @__PURE__ */
|
|
22997
|
-
/* @__PURE__ */
|
|
22998
|
-
lines.map((ln, i) => /* @__PURE__ */
|
|
22999
|
-
/* @__PURE__ */
|
|
22990
|
+
return /* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
22991
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, bold: true, children: `${headerPath}: lines ${start}\u2013${end}` }),
|
|
22992
|
+
lines.map((ln, i) => /* @__PURE__ */ jsx33(Text30, { dimColor: true, children: ln }, `source-line-${i}`)),
|
|
22993
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, children: "[s] close \xB7 [Esc] close" })
|
|
23000
22994
|
] });
|
|
23001
22995
|
})(),
|
|
23002
|
-
showHelp && /* @__PURE__ */
|
|
23003
|
-
/* @__PURE__ */
|
|
23004
|
-
/* @__PURE__ */
|
|
23005
|
-
/* @__PURE__ */
|
|
23006
|
-
/* @__PURE__ */
|
|
23007
|
-
/* @__PURE__ */
|
|
23008
|
-
/* @__PURE__ */
|
|
23009
|
-
/* @__PURE__ */
|
|
23010
|
-
/* @__PURE__ */
|
|
23011
|
-
/* @__PURE__ */
|
|
23012
|
-
/* @__PURE__ */
|
|
23013
|
-
/* @__PURE__ */
|
|
23014
|
-
/* @__PURE__ */
|
|
23015
|
-
/* @__PURE__ */
|
|
23016
|
-
/* @__PURE__ */
|
|
23017
|
-
/* @__PURE__ */
|
|
23018
|
-
/* @__PURE__ */
|
|
23019
|
-
/* @__PURE__ */
|
|
23020
|
-
/* @__PURE__ */
|
|
23021
|
-
/* @__PURE__ */
|
|
23022
|
-
/* @__PURE__ */
|
|
23023
|
-
/* @__PURE__ */
|
|
23024
|
-
/* @__PURE__ */
|
|
23025
|
-
/* @__PURE__ */
|
|
23026
|
-
/* @__PURE__ */
|
|
23027
|
-
/* @__PURE__ */
|
|
23028
|
-
/* @__PURE__ */
|
|
23029
|
-
/* @__PURE__ */
|
|
22996
|
+
showHelp && /* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
|
|
22997
|
+
/* @__PURE__ */ jsx33(Text30, { bold: true, color: PALETTE.info, children: "Keybindings" }),
|
|
22998
|
+
/* @__PURE__ */ jsx33(Text30, { children: " " }),
|
|
22999
|
+
/* @__PURE__ */ jsx33(Text30, { bold: true, children: "Row navigation" }),
|
|
23000
|
+
/* @__PURE__ */ jsx33(Text30, { children: " \u2191/\u2193 move between rows" }),
|
|
23001
|
+
/* @__PURE__ */ jsx33(Text30, { children: " Enter edit fields on the current row" }),
|
|
23002
|
+
/* @__PURE__ */ jsx33(Text30, { children: " Esc exit the panel" }),
|
|
23003
|
+
/* @__PURE__ */ jsx33(Text30, { children: " " }),
|
|
23004
|
+
/* @__PURE__ */ jsx33(Text30, { bold: true, children: "Field editing" }),
|
|
23005
|
+
/* @__PURE__ */ jsx33(Text30, { children: " \u2191/\u2193/\u2190\u2192 cycle through fields" }),
|
|
23006
|
+
/* @__PURE__ */ jsx33(Text30, { children: " \u2190/\u2192 cycle picker values \xB7 move cursor in text inputs" }),
|
|
23007
|
+
/* @__PURE__ */ jsx33(Text30, { children: " Space/Enter toggle required" }),
|
|
23008
|
+
/* @__PURE__ */ jsx33(Text30, { children: " Type edit description / string default" }),
|
|
23009
|
+
/* @__PURE__ */ jsx33(Text30, { children: " Esc exit field-edit back to the row" }),
|
|
23010
|
+
/* @__PURE__ */ jsx33(Text30, { children: " " }),
|
|
23011
|
+
/* @__PURE__ */ jsx33(Text30, { bold: true, children: "Values / allowedComponents" }),
|
|
23012
|
+
/* @__PURE__ */ jsx33(Text30, { children: " a / e / r add \xB7 edit \xB7 remove" }),
|
|
23013
|
+
/* @__PURE__ */ jsx33(Text30, { children: " \u2191\u2193 navigate the list" }),
|
|
23014
|
+
/* @__PURE__ */ jsx33(Text30, { children: " K / J reorder up \xB7 down" }),
|
|
23015
|
+
/* @__PURE__ */ jsx33(Text30, { children: " " }),
|
|
23016
|
+
/* @__PURE__ */ jsx33(Text30, { bold: true, children: "Panels" }),
|
|
23017
|
+
/* @__PURE__ */ jsx33(Text30, { children: " s toggle source-view for the current prop" }),
|
|
23018
|
+
/* @__PURE__ */ jsx33(Text30, { children: " Ctrl+S save field edits" }),
|
|
23019
|
+
/* @__PURE__ */ jsx33(Text30, { children: " " + propRationaleKey.padEnd(16) + " toggle prop rationale panel" }),
|
|
23020
|
+
/* @__PURE__ */ jsx33(Text30, { children: " " + componentRationaleKey.padEnd(16) + " toggle component rationale panel" }),
|
|
23021
|
+
/* @__PURE__ */ jsx33(Text30, { children: " ? toggle this overlay" }),
|
|
23022
|
+
/* @__PURE__ */ jsx33(Text30, { children: " " }),
|
|
23023
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, children: "press ? or Esc to close" })
|
|
23030
23024
|
] }),
|
|
23031
|
-
validationError && /* @__PURE__ */
|
|
23032
|
-
/* @__PURE__ */
|
|
23025
|
+
validationError && /* @__PURE__ */ jsx33(Text30, { color: PALETTE.error, children: "\u2717 " + validationError }),
|
|
23026
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, children: modeLabel })
|
|
23033
23027
|
]
|
|
23034
23028
|
}
|
|
23035
23029
|
);
|
|
@@ -23042,6 +23036,7 @@ var init_FieldEditor = __esm({
|
|
|
23042
23036
|
init_useImmediateInput();
|
|
23043
23037
|
init_scroll_offset();
|
|
23044
23038
|
init_cycle_detection();
|
|
23039
|
+
init_windowed_panel();
|
|
23045
23040
|
SLOT_FIELDS = ["required", "allowedComponents", "description"];
|
|
23046
23041
|
}
|
|
23047
23042
|
});
|
|
@@ -23084,23 +23079,23 @@ var init_wrap_text = __esm({
|
|
|
23084
23079
|
});
|
|
23085
23080
|
|
|
23086
23081
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/RationaleLine.tsx
|
|
23087
|
-
import { Box as Box30, Text as
|
|
23088
|
-
import { jsx as
|
|
23082
|
+
import { Box as Box30, Text as Text31 } from "ink";
|
|
23083
|
+
import { jsx as jsx34, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
23089
23084
|
function RationaleLine({ line, active }) {
|
|
23090
23085
|
if (line.kind === "blank") {
|
|
23091
|
-
return /* @__PURE__ */
|
|
23086
|
+
return /* @__PURE__ */ jsx34(Box30, { children: /* @__PURE__ */ jsx34(Text31, { children: " " }) });
|
|
23092
23087
|
}
|
|
23093
23088
|
if (line.kind === "heading") {
|
|
23094
|
-
return /* @__PURE__ */
|
|
23089
|
+
return /* @__PURE__ */ jsx34(Box30, { children: /* @__PURE__ */ jsx34(Text31, { bold: true, color: PALETTE.info, dimColor: !active, children: line.text }) });
|
|
23095
23090
|
}
|
|
23096
23091
|
if (line.kind === "label") {
|
|
23097
|
-
return /* @__PURE__ */
|
|
23098
|
-
line.prefix && /* @__PURE__ */
|
|
23099
|
-
/* @__PURE__ */
|
|
23100
|
-
line.suffix && /* @__PURE__ */
|
|
23092
|
+
return /* @__PURE__ */ jsxs31(Box30, { children: [
|
|
23093
|
+
line.prefix && /* @__PURE__ */ jsx34(Text31, { children: line.prefix }),
|
|
23094
|
+
/* @__PURE__ */ jsx34(Text31, { bold: true, color: line.color, dimColor: !active, children: line.text }),
|
|
23095
|
+
line.suffix && /* @__PURE__ */ jsx34(Text31, { dimColor: true, children: line.suffix })
|
|
23101
23096
|
] });
|
|
23102
23097
|
}
|
|
23103
|
-
return /* @__PURE__ */
|
|
23098
|
+
return /* @__PURE__ */ jsx34(Box30, { children: /* @__PURE__ */ jsx34(Text31, { dimColor: !active || line.dim, children: line.text }) });
|
|
23104
23099
|
}
|
|
23105
23100
|
var init_RationaleLine = __esm({
|
|
23106
23101
|
"packages/experience-design-system-cli/src/analyze/select/tui/components/RationaleLine.tsx"() {
|
|
@@ -23110,8 +23105,8 @@ var init_RationaleLine = __esm({
|
|
|
23110
23105
|
});
|
|
23111
23106
|
|
|
23112
23107
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/ComponentRationalePanel.tsx
|
|
23113
|
-
import { Box as Box31, Text as
|
|
23114
|
-
import { jsx as
|
|
23108
|
+
import { Box as Box31, Text as Text32 } from "ink";
|
|
23109
|
+
import { jsx as jsx35, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
23115
23110
|
function renderComponentRationaleLines(data, innerWidth) {
|
|
23116
23111
|
const out = [];
|
|
23117
23112
|
const pushSection = (heading, body) => {
|
|
@@ -23178,7 +23173,7 @@ function ComponentRationalePanel({
|
|
|
23178
23173
|
const overflowed = totalLines > contentHeight;
|
|
23179
23174
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
23180
23175
|
const visibleEnd = Math.min(totalLines, scrollOffset + contentHeight);
|
|
23181
|
-
return /* @__PURE__ */
|
|
23176
|
+
return /* @__PURE__ */ jsxs32(
|
|
23182
23177
|
Box31,
|
|
23183
23178
|
{
|
|
23184
23179
|
flexDirection: "column",
|
|
@@ -23187,9 +23182,9 @@ function ComponentRationalePanel({
|
|
|
23187
23182
|
borderStyle: "single",
|
|
23188
23183
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
23189
23184
|
children: [
|
|
23190
|
-
/* @__PURE__ */
|
|
23191
|
-
visible.map((line, i) => /* @__PURE__ */
|
|
23192
|
-
/* @__PURE__ */
|
|
23185
|
+
/* @__PURE__ */ jsx35(Box31, { children: /* @__PURE__ */ jsx35(Text32, { bold: true, dimColor: !active, children: `Component rationale: ${data.name}` }) }),
|
|
23186
|
+
visible.map((line, i) => /* @__PURE__ */ jsx35(RationaleLine, { line, active }, i)),
|
|
23187
|
+
/* @__PURE__ */ jsx35(Box31, { children: overflowed ? /* @__PURE__ */ jsx35(Text32, { dimColor: true, children: `${visibleStart}-${visibleEnd}/${totalLines} [\u2191\u2193] scroll [I/Esc] close` }) : /* @__PURE__ */ jsx35(Text32, { dimColor: true, children: "[I/Esc] close" }) })
|
|
23193
23188
|
]
|
|
23194
23189
|
}
|
|
23195
23190
|
);
|
|
@@ -23206,10 +23201,10 @@ var init_ComponentRationalePanel = __esm({
|
|
|
23206
23201
|
});
|
|
23207
23202
|
|
|
23208
23203
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/HighlightedLine.tsx
|
|
23209
|
-
import { Text as
|
|
23210
|
-
import { Fragment as Fragment11, jsx as
|
|
23204
|
+
import { Text as Text33 } from "ink";
|
|
23205
|
+
import { Fragment as Fragment11, jsx as jsx36 } from "react/jsx-runtime";
|
|
23211
23206
|
function HighlightedLine({ parts }) {
|
|
23212
|
-
return /* @__PURE__ */
|
|
23207
|
+
return /* @__PURE__ */ jsx36(Fragment11, { children: parts.map((part, i) => /* @__PURE__ */ jsx36(Text33, { color: part.color, dimColor: part.dim, children: part.text }, i)) });
|
|
23213
23208
|
}
|
|
23214
23209
|
var init_HighlightedLine = __esm({
|
|
23215
23210
|
"packages/experience-design-system-cli/src/analyze/select/tui/components/HighlightedLine.tsx"() {
|
|
@@ -23218,8 +23213,8 @@ var init_HighlightedLine = __esm({
|
|
|
23218
23213
|
});
|
|
23219
23214
|
|
|
23220
23215
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/ScrollablePanel.tsx
|
|
23221
|
-
import { Box as Box32, Text as
|
|
23222
|
-
import { Fragment as Fragment12, jsx as
|
|
23216
|
+
import { Box as Box32, Text as Text34 } from "ink";
|
|
23217
|
+
import { Fragment as Fragment12, jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
23223
23218
|
function ScrollablePanel({
|
|
23224
23219
|
header,
|
|
23225
23220
|
width,
|
|
@@ -23232,12 +23227,12 @@ function ScrollablePanel({
|
|
|
23232
23227
|
children
|
|
23233
23228
|
}) {
|
|
23234
23229
|
const overflowed = totalLines > height;
|
|
23235
|
-
return /* @__PURE__ */
|
|
23236
|
-
/* @__PURE__ */
|
|
23230
|
+
return /* @__PURE__ */ jsxs33(Box32, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
|
|
23231
|
+
/* @__PURE__ */ jsxs33(Box32, { children: [
|
|
23237
23232
|
header,
|
|
23238
|
-
overflowed && /* @__PURE__ */
|
|
23239
|
-
/* @__PURE__ */
|
|
23240
|
-
/* @__PURE__ */
|
|
23233
|
+
overflowed && /* @__PURE__ */ jsxs33(Fragment12, { children: [
|
|
23234
|
+
/* @__PURE__ */ jsx37(Box32, { flexGrow: 1 }),
|
|
23235
|
+
/* @__PURE__ */ jsx37(Text34, { dimColor: !active, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
|
|
23241
23236
|
] })
|
|
23242
23237
|
] }),
|
|
23243
23238
|
children
|
|
@@ -23250,8 +23245,8 @@ var init_ScrollablePanel = __esm({
|
|
|
23250
23245
|
});
|
|
23251
23246
|
|
|
23252
23247
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/JsonPanel.tsx
|
|
23253
|
-
import { Box as Box33, Text as
|
|
23254
|
-
import { jsx as
|
|
23248
|
+
import { Box as Box33, Text as Text35 } from "ink";
|
|
23249
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
23255
23250
|
function highlightJson(line) {
|
|
23256
23251
|
const parts = [];
|
|
23257
23252
|
let remaining = line;
|
|
@@ -23289,7 +23284,7 @@ function highlightJson(line) {
|
|
|
23289
23284
|
parts.push({ text: remaining[0] });
|
|
23290
23285
|
remaining = remaining.slice(1);
|
|
23291
23286
|
}
|
|
23292
|
-
return /* @__PURE__ */
|
|
23287
|
+
return /* @__PURE__ */ jsx38(HighlightedLine, { parts });
|
|
23293
23288
|
}
|
|
23294
23289
|
function truncateLine(line, maxWidth) {
|
|
23295
23290
|
if (line.length <= maxWidth) return line;
|
|
@@ -23302,10 +23297,10 @@ function JsonPanel({ label, value, scrollOffset, width, height, active }) {
|
|
|
23302
23297
|
const totalLines = allLines.length;
|
|
23303
23298
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
23304
23299
|
const visibleEnd = Math.min(totalLines, scrollOffset + height);
|
|
23305
|
-
return /* @__PURE__ */
|
|
23300
|
+
return /* @__PURE__ */ jsx38(
|
|
23306
23301
|
ScrollablePanel,
|
|
23307
23302
|
{
|
|
23308
|
-
header: /* @__PURE__ */
|
|
23303
|
+
header: /* @__PURE__ */ jsx38(Text35, { bold: true, dimColor: !active, children: label }),
|
|
23309
23304
|
width,
|
|
23310
23305
|
height,
|
|
23311
23306
|
active,
|
|
@@ -23315,7 +23310,7 @@ function JsonPanel({ label, value, scrollOffset, width, height, active }) {
|
|
|
23315
23310
|
borderColor: active ? "white" : void 0,
|
|
23316
23311
|
children: visibleLines.map((line, i) => {
|
|
23317
23312
|
const truncated = truncateLine(line, innerWidth);
|
|
23318
|
-
return /* @__PURE__ */
|
|
23313
|
+
return /* @__PURE__ */ jsx38(Box33, { children: highlightJson(truncated) }, i);
|
|
23319
23314
|
})
|
|
23320
23315
|
}
|
|
23321
23316
|
);
|
|
@@ -23329,8 +23324,8 @@ var init_JsonPanel = __esm({
|
|
|
23329
23324
|
});
|
|
23330
23325
|
|
|
23331
23326
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/RationalePanel.tsx
|
|
23332
|
-
import { Text as
|
|
23333
|
-
import { jsx as
|
|
23327
|
+
import { Text as Text36 } from "ink";
|
|
23328
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
23334
23329
|
function renderRationaleLines(rows, innerWidth) {
|
|
23335
23330
|
const out = [];
|
|
23336
23331
|
rows.forEach((row, idx) => {
|
|
@@ -23363,10 +23358,10 @@ function RationalePanel({
|
|
|
23363
23358
|
const visible = allLines.slice(scrollOffset, scrollOffset + height);
|
|
23364
23359
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
23365
23360
|
const visibleEnd = Math.min(totalLines, scrollOffset + height);
|
|
23366
|
-
return /* @__PURE__ */
|
|
23361
|
+
return /* @__PURE__ */ jsx39(
|
|
23367
23362
|
ScrollablePanel,
|
|
23368
23363
|
{
|
|
23369
|
-
header: /* @__PURE__ */
|
|
23364
|
+
header: /* @__PURE__ */ jsx39(Text36, { bold: true, dimColor: !active, children: `RATIONALE \u2014 ${componentName}` }),
|
|
23370
23365
|
width,
|
|
23371
23366
|
height,
|
|
23372
23367
|
active,
|
|
@@ -23374,7 +23369,7 @@ function RationalePanel({
|
|
|
23374
23369
|
visibleStart,
|
|
23375
23370
|
visibleEnd,
|
|
23376
23371
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
23377
|
-
children: visible.map((line, i) => /* @__PURE__ */
|
|
23372
|
+
children: visible.map((line, i) => /* @__PURE__ */ jsx39(RationaleLine, { line, active }, i))
|
|
23378
23373
|
}
|
|
23379
23374
|
);
|
|
23380
23375
|
}
|
|
@@ -23389,9 +23384,9 @@ var init_RationalePanel = __esm({
|
|
|
23389
23384
|
});
|
|
23390
23385
|
|
|
23391
23386
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/TokenReviewPanel.tsx
|
|
23392
|
-
import
|
|
23393
|
-
import { Box as Box34, Text as
|
|
23394
|
-
import { jsx as
|
|
23387
|
+
import figures5 from "figures";
|
|
23388
|
+
import { Box as Box34, Text as Text37 } from "ink";
|
|
23389
|
+
import { jsx as jsx40, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
23395
23390
|
function collectTokenSuggestions(entry, availableTokens = []) {
|
|
23396
23391
|
return Object.entries(entry.$properties).filter(([, def]) => {
|
|
23397
23392
|
const rawKind = def["$token.kind"];
|
|
@@ -23425,7 +23420,7 @@ function TokenReviewPanel({
|
|
|
23425
23420
|
const scrollStart = Math.max(0, Math.min(editCursor - Math.floor(visibleCount / 2), maxStart));
|
|
23426
23421
|
const visiblePaths = current.paths.slice(scrollStart, scrollStart + visibleCount);
|
|
23427
23422
|
const rangeLabel = current.paths.length === 0 ? "no compatible tokens" : `${scrollStart + 1}-${scrollStart + visiblePaths.length} of ${current.paths.length}`;
|
|
23428
|
-
return /* @__PURE__ */
|
|
23423
|
+
return /* @__PURE__ */ jsxs34(
|
|
23429
23424
|
Box34,
|
|
23430
23425
|
{
|
|
23431
23426
|
flexDirection: "column",
|
|
@@ -23434,24 +23429,24 @@ function TokenReviewPanel({
|
|
|
23434
23429
|
borderStyle: "single",
|
|
23435
23430
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
23436
23431
|
children: [
|
|
23437
|
-
/* @__PURE__ */
|
|
23438
|
-
/* @__PURE__ */
|
|
23439
|
-
/* @__PURE__ */
|
|
23440
|
-
current.paths.length === 0 && /* @__PURE__ */
|
|
23432
|
+
/* @__PURE__ */ jsx40(Text37, { bold: true, dimColor: !active, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
|
|
23433
|
+
/* @__PURE__ */ jsx40(Text37, { dimColor: true, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
|
|
23434
|
+
/* @__PURE__ */ jsx40(Text37, { children: " " }),
|
|
23435
|
+
current.paths.length === 0 && /* @__PURE__ */ jsx40(Text37, { dimColor: true, children: "(no compatible tokens found for this token kind)" }),
|
|
23441
23436
|
visiblePaths.map((path, i) => {
|
|
23442
23437
|
const pathIndex = scrollStart + i;
|
|
23443
23438
|
const checked = editSelection.has(path);
|
|
23444
23439
|
const focused = pathIndex === editCursor;
|
|
23445
|
-
return /* @__PURE__ */
|
|
23440
|
+
return /* @__PURE__ */ jsx40(Box34, { children: /* @__PURE__ */ jsx40(Text37, { color: focused ? PALETTE.info : void 0, bold: focused, dimColor: !active, wrap: "truncate", children: ` [${checked ? "x" : " "}] ${path}` }) }, path);
|
|
23446
23441
|
}),
|
|
23447
|
-
/* @__PURE__ */
|
|
23448
|
-
/* @__PURE__ */
|
|
23449
|
-
/* @__PURE__ */
|
|
23442
|
+
/* @__PURE__ */ jsx40(Text37, { children: " " }),
|
|
23443
|
+
/* @__PURE__ */ jsx40(Text37, { dimColor: true, wrap: "truncate", children: "[\u2191/\u2193] move [Space] toggle" }),
|
|
23444
|
+
/* @__PURE__ */ jsx40(Text37, { dimColor: true, wrap: "truncate", children: "[Ctrl+S] save [Esc] cancel" })
|
|
23450
23445
|
]
|
|
23451
23446
|
}
|
|
23452
23447
|
);
|
|
23453
23448
|
}
|
|
23454
|
-
return /* @__PURE__ */
|
|
23449
|
+
return /* @__PURE__ */ jsxs34(
|
|
23455
23450
|
Box34,
|
|
23456
23451
|
{
|
|
23457
23452
|
flexDirection: "column",
|
|
@@ -23460,18 +23455,18 @@ function TokenReviewPanel({
|
|
|
23460
23455
|
borderStyle: "single",
|
|
23461
23456
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
23462
23457
|
children: [
|
|
23463
|
-
/* @__PURE__ */
|
|
23464
|
-
suggestions.length === 0 && /* @__PURE__ */
|
|
23458
|
+
/* @__PURE__ */ jsx40(Text37, { bold: true, dimColor: !active, children: `TOKEN REVIEW \u2014 ${componentName}` }),
|
|
23459
|
+
suggestions.length === 0 && /* @__PURE__ */ jsx40(Text37, { dimColor: true, children: "(no token suggestions for this component)" }),
|
|
23465
23460
|
suggestions.map((s, i) => {
|
|
23466
23461
|
const focused = i === selectedRow;
|
|
23467
|
-
return /* @__PURE__ */
|
|
23468
|
-
/* @__PURE__ */
|
|
23469
|
-
/* @__PURE__ */
|
|
23470
|
-
/* @__PURE__ */
|
|
23462
|
+
return /* @__PURE__ */ jsxs34(Box34, { flexDirection: "column", children: [
|
|
23463
|
+
/* @__PURE__ */ jsx40(Box34, { children: /* @__PURE__ */ jsx40(Text37, { color: focused ? PALETTE.info : void 0, bold: focused, dimColor: !active, children: `${focused ? figures5.pointer : " "} ${s.propName}` }) }),
|
|
23464
|
+
/* @__PURE__ */ jsx40(Text37, { dimColor: true, children: ` suggested: ${s.suggested.join(", ")}` }),
|
|
23465
|
+
/* @__PURE__ */ jsx40(Text37, { dimColor: true, children: ` allowed: ${s.allowed.join(", ")}` })
|
|
23471
23466
|
] }, s.propName);
|
|
23472
23467
|
}),
|
|
23473
|
-
/* @__PURE__ */
|
|
23474
|
-
/* @__PURE__ */
|
|
23468
|
+
/* @__PURE__ */ jsx40(Text37, { children: " " }),
|
|
23469
|
+
/* @__PURE__ */ jsx40(Text37, { dimColor: true, children: "[\u2191/\u2193] move [Enter] edit allowed [Esc] close" })
|
|
23475
23470
|
]
|
|
23476
23471
|
}
|
|
23477
23472
|
);
|
|
@@ -23484,8 +23479,8 @@ var init_TokenReviewPanel = __esm({
|
|
|
23484
23479
|
});
|
|
23485
23480
|
|
|
23486
23481
|
// packages/experience-design-system-cli/src/import/tui/steps/review-details-panel.tsx
|
|
23487
|
-
import { Text as
|
|
23488
|
-
import { Fragment as Fragment13, jsx as
|
|
23482
|
+
import { Text as Text38 } from "ink";
|
|
23483
|
+
import { Fragment as Fragment13, jsx as jsx41, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
23489
23484
|
function ReviewDetailsPanel({
|
|
23490
23485
|
selectedKey,
|
|
23491
23486
|
panelOpen,
|
|
@@ -23520,7 +23515,7 @@ function ReviewDetailsPanel({
|
|
|
23520
23515
|
rationale: s.rationale ?? ""
|
|
23521
23516
|
}))
|
|
23522
23517
|
];
|
|
23523
|
-
return /* @__PURE__ */
|
|
23518
|
+
return /* @__PURE__ */ jsx41(
|
|
23524
23519
|
RationalePanel,
|
|
23525
23520
|
{
|
|
23526
23521
|
componentName: componentRationale?.name ?? selectedKey,
|
|
@@ -23533,7 +23528,7 @@ function ReviewDetailsPanel({
|
|
|
23533
23528
|
);
|
|
23534
23529
|
}
|
|
23535
23530
|
if (panelOpen === "component-rationale") {
|
|
23536
|
-
return /* @__PURE__ */
|
|
23531
|
+
return /* @__PURE__ */ jsx41(
|
|
23537
23532
|
ComponentRationalePanel,
|
|
23538
23533
|
{
|
|
23539
23534
|
data: componentRationale ?? {
|
|
@@ -23558,14 +23553,14 @@ function ReviewDetailsPanel({
|
|
|
23558
23553
|
const headerPath = path ?? "<unknown source path>";
|
|
23559
23554
|
const sourceLineCount = Math.max(1, height - 4);
|
|
23560
23555
|
const lines = source ? source.split("\n").slice(panelScrollOffset, panelScrollOffset + sourceLineCount) : [];
|
|
23561
|
-
return /* @__PURE__ */
|
|
23562
|
-
/* @__PURE__ */
|
|
23563
|
-
source ? lines.map((line, index) => /* @__PURE__ */
|
|
23564
|
-
/* @__PURE__ */
|
|
23556
|
+
return /* @__PURE__ */ jsxs35(FixedPanel, { width, height, borderStyle: "single", borderColor: sourceBorderColor, paddingLeft: 1, children: [
|
|
23557
|
+
/* @__PURE__ */ jsx41(Text38, { dimColor: true, bold: true, wrap: "truncate-end", children: `source: ${headerPath}` }),
|
|
23558
|
+
source ? lines.map((line, index) => /* @__PURE__ */ jsx41(Text38, { dimColor: true, wrap: "truncate-end", children: line }, `source-line-${index}`)) : /* @__PURE__ */ jsx41(Text38, { dimColor: true, children: "(no source captured)" }),
|
|
23559
|
+
/* @__PURE__ */ jsx41(Text38, { dimColor: true, wrap: "truncate-end", children: "[s/Esc] close" })
|
|
23565
23560
|
] });
|
|
23566
23561
|
}
|
|
23567
23562
|
if (panelOpen === "token-review") {
|
|
23568
|
-
return /* @__PURE__ */
|
|
23563
|
+
return /* @__PURE__ */ jsx41(
|
|
23569
23564
|
TokenReviewPanel,
|
|
23570
23565
|
{
|
|
23571
23566
|
componentName: selectedKey,
|
|
@@ -23581,7 +23576,7 @@ function ReviewDetailsPanel({
|
|
|
23581
23576
|
);
|
|
23582
23577
|
}
|
|
23583
23578
|
if (showJson) {
|
|
23584
|
-
return /* @__PURE__ */
|
|
23579
|
+
return /* @__PURE__ */ jsx41(
|
|
23585
23580
|
JsonPanel,
|
|
23586
23581
|
{
|
|
23587
23582
|
label: "GENERATED DEFINITION (read-only)",
|
|
@@ -23593,7 +23588,7 @@ function ReviewDetailsPanel({
|
|
|
23593
23588
|
}
|
|
23594
23589
|
);
|
|
23595
23590
|
}
|
|
23596
|
-
return /* @__PURE__ */
|
|
23591
|
+
return /* @__PURE__ */ jsx41(Fragment13, { children: editor });
|
|
23597
23592
|
}
|
|
23598
23593
|
var init_review_details_panel = __esm({
|
|
23599
23594
|
"packages/experience-design-system-cli/src/import/tui/steps/review-details-panel.tsx"() {
|
|
@@ -23607,7 +23602,7 @@ var init_review_details_panel = __esm({
|
|
|
23607
23602
|
});
|
|
23608
23603
|
|
|
23609
23604
|
// packages/experience-design-system-cli/src/import/tui/components/ReviewDetailsEditor.tsx
|
|
23610
|
-
import { jsx as
|
|
23605
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
23611
23606
|
import { createElement as createElement5 } from "react";
|
|
23612
23607
|
function toFieldEditorMetadata(reviewMetadata) {
|
|
23613
23608
|
if (!reviewMetadata) return void 0;
|
|
@@ -23640,7 +23635,7 @@ function ReviewDetailsEditor({
|
|
|
23640
23635
|
jsonScrollOffset,
|
|
23641
23636
|
currentTokenSuggestions
|
|
23642
23637
|
} = reviewEditor;
|
|
23643
|
-
return /* @__PURE__ */
|
|
23638
|
+
return /* @__PURE__ */ jsx42(
|
|
23644
23639
|
ReviewDetailsPanel,
|
|
23645
23640
|
{
|
|
23646
23641
|
selectedKey,
|
|
@@ -23664,10 +23659,12 @@ function ReviewDetailsEditor({
|
|
|
23664
23659
|
FieldEditor,
|
|
23665
23660
|
{
|
|
23666
23661
|
...fieldEditor,
|
|
23667
|
-
key: fieldEditor.key ?? selectedKey
|
|
23662
|
+
key: `${fieldEditor.key ?? selectedKey}:${sidebarFocused ? "list" : "panel"}`,
|
|
23668
23663
|
width,
|
|
23669
23664
|
height,
|
|
23665
|
+
fixedHeight: true,
|
|
23670
23666
|
active: !sidebarFocused,
|
|
23667
|
+
initialFocusTarget: sidebarFocused ? void 0 : fieldEditor.initialFocusTarget,
|
|
23671
23668
|
metadata: toFieldEditorMetadata(reviewMetadata),
|
|
23672
23669
|
showInlineRationales: false
|
|
23673
23670
|
}
|
|
@@ -23684,8 +23681,8 @@ var init_ReviewDetailsEditor = __esm({
|
|
|
23684
23681
|
});
|
|
23685
23682
|
|
|
23686
23683
|
// packages/experience-design-system-cli/src/import/tui/components/ReviewComponentPanel.tsx
|
|
23687
|
-
import { Box as Box35, Text as
|
|
23688
|
-
import { Fragment as Fragment14, jsx as
|
|
23684
|
+
import { Box as Box35, Text as Text39 } from "ink";
|
|
23685
|
+
import { Fragment as Fragment14, jsx as jsx43, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
23689
23686
|
function buildReviewFieldEditor(reviewEditor, selectedJson, onExit, overrides = {}) {
|
|
23690
23687
|
return {
|
|
23691
23688
|
value: reviewEditor.draftValue || selectedJson,
|
|
@@ -23725,17 +23722,17 @@ function ReviewEmptyComponentsWarning({
|
|
|
23725
23722
|
hidden
|
|
23726
23723
|
}) {
|
|
23727
23724
|
if (hidden || count === 0) return null;
|
|
23728
|
-
return /* @__PURE__ */
|
|
23725
|
+
return /* @__PURE__ */ jsx43(Text39, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
|
|
23729
23726
|
}
|
|
23730
23727
|
function ReviewNoSelection() {
|
|
23731
|
-
return /* @__PURE__ */
|
|
23728
|
+
return /* @__PURE__ */ jsx43(Box35, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx43(Text39, { dimColor: true, children: "No component selected" }) });
|
|
23732
23729
|
}
|
|
23733
23730
|
function ReviewFinalizeError({
|
|
23734
23731
|
message,
|
|
23735
23732
|
hidden
|
|
23736
23733
|
}) {
|
|
23737
23734
|
if (hidden || !message) return null;
|
|
23738
|
-
return /* @__PURE__ */
|
|
23735
|
+
return /* @__PURE__ */ jsx43(Text39, { color: PALETTE.error, children: `\u26A0 ${message}` });
|
|
23739
23736
|
}
|
|
23740
23737
|
function ReviewPanelFooter({
|
|
23741
23738
|
reviewEditor,
|
|
@@ -23744,10 +23741,10 @@ function ReviewPanelFooter({
|
|
|
23744
23741
|
livePreview,
|
|
23745
23742
|
livePreviewSpinner
|
|
23746
23743
|
}) {
|
|
23747
|
-
return /* @__PURE__ */
|
|
23748
|
-
reviewEditor.panelOpen === "token-review" ? " [\u2191/\u2193] move [Enter] edit allowed [Esc] close" : sidebarFocused ? sidebarFooter : reviewEditor.showJson ? " [
|
|
23749
|
-
livePreview.status === "running" && /* @__PURE__ */
|
|
23750
|
-
livePreview.disabled && /* @__PURE__ */
|
|
23744
|
+
return /* @__PURE__ */ jsxs36(Fragment14, { children: [
|
|
23745
|
+
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" : ""),
|
|
23746
|
+
livePreview.status === "running" && /* @__PURE__ */ jsx43(Text39, { children: ` ${livePreviewSpinner} live preview` }),
|
|
23747
|
+
livePreview.disabled && /* @__PURE__ */ jsx43(Text39, { children: " \xB7 live preview disabled" })
|
|
23751
23748
|
] });
|
|
23752
23749
|
}
|
|
23753
23750
|
function ReviewComponentPanel({
|
|
@@ -23771,11 +23768,11 @@ function ReviewComponentPanel({
|
|
|
23771
23768
|
const slotCount = selectedEntry.$slots ? Object.keys(selectedEntry.$slots).length : 0;
|
|
23772
23769
|
const contentHeight = Math.max(1, height - 3);
|
|
23773
23770
|
const contentWidth = Math.max(1, width - 1);
|
|
23774
|
-
return /* @__PURE__ */
|
|
23775
|
-
/* @__PURE__ */
|
|
23776
|
-
/* @__PURE__ */
|
|
23777
|
-
/* @__PURE__ */
|
|
23778
|
-
/* @__PURE__ */
|
|
23771
|
+
return /* @__PURE__ */ jsx43(FixedPanel, { width, height, borderStyle: void 0, paddingLeft: 1, children: /* @__PURE__ */ jsxs36(Box35, { flexDirection: "column", width: contentWidth, height, flexShrink: 0, overflowY: "hidden", children: [
|
|
23772
|
+
/* @__PURE__ */ jsxs36(Box35, { width: contentWidth, height: 1, flexShrink: 0, children: [
|
|
23773
|
+
/* @__PURE__ */ jsx43(Text39, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
23774
|
+
/* @__PURE__ */ jsx43(Box35, { flexGrow: 1 }),
|
|
23775
|
+
/* @__PURE__ */ jsxs36(Text39, { dimColor: true, wrap: "truncate-end", children: [
|
|
23779
23776
|
propCount,
|
|
23780
23777
|
" prop",
|
|
23781
23778
|
propCount !== 1 ? "s" : "",
|
|
@@ -23784,7 +23781,7 @@ function ReviewComponentPanel({
|
|
|
23784
23781
|
sidebarFocused ? "[Tab] focus panel" : "[Tab] focus list"
|
|
23785
23782
|
] })
|
|
23786
23783
|
] }),
|
|
23787
|
-
/* @__PURE__ */
|
|
23784
|
+
/* @__PURE__ */ jsx43(Box35, { width: contentWidth, height: contentHeight, flexShrink: 0, overflowY: "hidden", children: /* @__PURE__ */ jsx43(
|
|
23788
23785
|
ReviewDetailsEditor,
|
|
23789
23786
|
{
|
|
23790
23787
|
selectedKey,
|
|
@@ -23799,8 +23796,8 @@ function ReviewComponentPanel({
|
|
|
23799
23796
|
fieldEditor
|
|
23800
23797
|
}
|
|
23801
23798
|
) }),
|
|
23802
|
-
/* @__PURE__ */
|
|
23803
|
-
/* @__PURE__ */
|
|
23799
|
+
/* @__PURE__ */ jsx43(Box35, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx43(Text39, { color: saveError ? PALETTE.error : void 0, wrap: "truncate-end", children: saveError ? "\u2717 " + saveError : " " }) }),
|
|
23800
|
+
/* @__PURE__ */ jsx43(Box35, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx43(Text39, { dimColor: true, wrap: "truncate-end", children: /* @__PURE__ */ jsx43(
|
|
23804
23801
|
ReviewPanelFooter,
|
|
23805
23802
|
{
|
|
23806
23803
|
reviewEditor,
|
|
@@ -23822,43 +23819,9 @@ var init_ReviewComponentPanel = __esm({
|
|
|
23822
23819
|
}
|
|
23823
23820
|
});
|
|
23824
23821
|
|
|
23825
|
-
// packages/experience-design-system-cli/src/analyze/select/tui/components/StatusBar.tsx
|
|
23826
|
-
import { Box as Box36, Text as Text41 } from "ink";
|
|
23827
|
-
import { jsx as jsx45, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
23828
|
-
function StatusBar({ accepted, rejected, reviewed, needsReview }) {
|
|
23829
|
-
const allResolved = needsReview === 0;
|
|
23830
|
-
return /* @__PURE__ */ jsxs38(Box36, { gap: 2, flexWrap: "wrap", children: [
|
|
23831
|
-
/* @__PURE__ */ jsxs38(Text41, { color: PALETTE.success, children: [
|
|
23832
|
-
accepted,
|
|
23833
|
-
" accepted"
|
|
23834
|
-
] }),
|
|
23835
|
-
/* @__PURE__ */ jsxs38(Text41, { color: PALETTE.error, children: [
|
|
23836
|
-
rejected,
|
|
23837
|
-
" rejected"
|
|
23838
|
-
] }),
|
|
23839
|
-
/* @__PURE__ */ jsxs38(Text41, { dimColor: true, children: [
|
|
23840
|
-
needsReview,
|
|
23841
|
-
" pending"
|
|
23842
|
-
] }),
|
|
23843
|
-
/* @__PURE__ */ jsxs38(Text41, { color: PALETTE.info, children: [
|
|
23844
|
-
reviewed,
|
|
23845
|
-
" reviewed"
|
|
23846
|
-
] }),
|
|
23847
|
-
/* @__PURE__ */ jsx45(Text41, { dimColor: true, children: "\xB7" }),
|
|
23848
|
-
/* @__PURE__ */ jsx45(Text41, { dimColor: true, children: "[A] accept all" }),
|
|
23849
|
-
/* @__PURE__ */ jsx45(Text41, { bold: allResolved, color: allResolved ? PALETTE.success : PALETTE.fg, children: "[F] finalize" })
|
|
23850
|
-
] });
|
|
23851
|
-
}
|
|
23852
|
-
var init_StatusBar = __esm({
|
|
23853
|
-
"packages/experience-design-system-cli/src/analyze/select/tui/components/StatusBar.tsx"() {
|
|
23854
|
-
"use strict";
|
|
23855
|
-
init_theme();
|
|
23856
|
-
}
|
|
23857
|
-
});
|
|
23858
|
-
|
|
23859
23822
|
// packages/experience-design-system-cli/src/import/tui/components/ReviewStatus.tsx
|
|
23860
|
-
import { Box as
|
|
23861
|
-
import { jsx as
|
|
23823
|
+
import { Box as Box36, Text as Text40 } from "ink";
|
|
23824
|
+
import { jsx as jsx44, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
23862
23825
|
function countReviewStatuses(entries) {
|
|
23863
23826
|
return entries.reduce(
|
|
23864
23827
|
(counts, entry) => {
|
|
@@ -23870,39 +23833,20 @@ function countReviewStatuses(entries) {
|
|
|
23870
23833
|
{ accepted: 0, rejected: 0, needsReview: 0 }
|
|
23871
23834
|
);
|
|
23872
23835
|
}
|
|
23873
|
-
function ReviewStatusBar({
|
|
23874
|
-
entries,
|
|
23875
|
-
onApproveAll,
|
|
23876
|
-
onFinalize
|
|
23877
|
-
}) {
|
|
23878
|
-
const { accepted, rejected, needsReview } = countReviewStatuses(entries);
|
|
23879
|
-
return /* @__PURE__ */ jsx46(
|
|
23880
|
-
StatusBar,
|
|
23881
|
-
{
|
|
23882
|
-
accepted,
|
|
23883
|
-
rejected,
|
|
23884
|
-
reviewed: 0,
|
|
23885
|
-
needsReview,
|
|
23886
|
-
onApproveAll,
|
|
23887
|
-
onFinalize
|
|
23888
|
-
}
|
|
23889
|
-
);
|
|
23890
|
-
}
|
|
23891
23836
|
function ReviewLoadingState() {
|
|
23892
|
-
return /* @__PURE__ */
|
|
23837
|
+
return /* @__PURE__ */ jsx44(Box36, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx44(Text40, { dimColor: true, children: "Loading generated definitions..." }) });
|
|
23893
23838
|
}
|
|
23894
23839
|
function ReviewLoadError({ message }) {
|
|
23895
|
-
return /* @__PURE__ */
|
|
23896
|
-
/* @__PURE__ */
|
|
23897
|
-
/* @__PURE__ */
|
|
23898
|
-
/* @__PURE__ */
|
|
23840
|
+
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
23841
|
+
/* @__PURE__ */ jsx44(Text40, { color: PALETTE.error, children: message }),
|
|
23842
|
+
/* @__PURE__ */ jsx44(Text40, { children: " " }),
|
|
23843
|
+
/* @__PURE__ */ jsx44(Text40, { dimColor: true, children: "[q / Enter / Esc] Quit" })
|
|
23899
23844
|
] });
|
|
23900
23845
|
}
|
|
23901
23846
|
var init_ReviewStatus = __esm({
|
|
23902
23847
|
"packages/experience-design-system-cli/src/import/tui/components/ReviewStatus.tsx"() {
|
|
23903
23848
|
"use strict";
|
|
23904
23849
|
init_theme();
|
|
23905
|
-
init_StatusBar();
|
|
23906
23850
|
}
|
|
23907
23851
|
});
|
|
23908
23852
|
|
|
@@ -24030,8 +23974,8 @@ var init_runLivePreview = __esm({
|
|
|
24030
23974
|
});
|
|
24031
23975
|
|
|
24032
23976
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/FinalizeDialog.tsx
|
|
24033
|
-
import { Box as
|
|
24034
|
-
import { Fragment as Fragment15, jsx as
|
|
23977
|
+
import { Box as Box37, Text as Text41 } from "ink";
|
|
23978
|
+
import { Fragment as Fragment15, jsx as jsx45, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
24035
23979
|
function FinalizeDialog({
|
|
24036
23980
|
accepted,
|
|
24037
23981
|
rejected,
|
|
@@ -24045,7 +23989,7 @@ function FinalizeDialog({
|
|
|
24045
23989
|
removedScrollOffset = 0
|
|
24046
23990
|
}) {
|
|
24047
23991
|
useImmediateInput((input, key) => {
|
|
24048
|
-
if (
|
|
23992
|
+
if (key.upArrow || key.downArrow) return;
|
|
24049
23993
|
if (input === "y" || key.return) {
|
|
24050
23994
|
onConfirm();
|
|
24051
23995
|
} else if (input === "n" || key.escape) {
|
|
@@ -24059,51 +24003,51 @@ function FinalizeDialog({
|
|
|
24059
24003
|
const windowed = removed.slice(offset, offset + FINALIZE_REMOVED_WINDOW);
|
|
24060
24004
|
const hasMoreBelow = offset + FINALIZE_REMOVED_WINDOW < removed.length;
|
|
24061
24005
|
const hasMoreAbove = offset > 0;
|
|
24062
|
-
return /* @__PURE__ */
|
|
24063
|
-
/* @__PURE__ */
|
|
24064
|
-
/* @__PURE__ */
|
|
24065
|
-
/* @__PURE__ */
|
|
24066
|
-
/* @__PURE__ */
|
|
24006
|
+
return /* @__PURE__ */ jsxs38(Box37, { flexDirection: "column", borderStyle: "round", padding: 1, width: 58, children: [
|
|
24007
|
+
/* @__PURE__ */ jsx45(Text41, { bold: true, children: "\u2500".repeat(17) + " Finalize " + "\u2500".repeat(17) }),
|
|
24008
|
+
/* @__PURE__ */ jsx45(Text41, { children: " " }),
|
|
24009
|
+
/* @__PURE__ */ jsxs38(Text41, { children: [
|
|
24010
|
+
/* @__PURE__ */ jsxs38(Text41, { color: PALETTE.success, children: [
|
|
24067
24011
|
accepted,
|
|
24068
24012
|
" accepted"
|
|
24069
24013
|
] }),
|
|
24070
|
-
/* @__PURE__ */
|
|
24071
|
-
/* @__PURE__ */
|
|
24014
|
+
/* @__PURE__ */ jsx45(Text41, { children: " \xB7 " }),
|
|
24015
|
+
/* @__PURE__ */ jsxs38(Text41, { color: PALETTE.error, children: [
|
|
24072
24016
|
rejected,
|
|
24073
24017
|
" rejected"
|
|
24074
24018
|
] }),
|
|
24075
|
-
/* @__PURE__ */
|
|
24076
|
-
/* @__PURE__ */
|
|
24019
|
+
/* @__PURE__ */ jsx45(Text41, { children: " \xB7 " }),
|
|
24020
|
+
/* @__PURE__ */ jsxs38(Text41, { dimColor: true, children: [
|
|
24077
24021
|
needsReview,
|
|
24078
24022
|
" unresolved"
|
|
24079
24023
|
] })
|
|
24080
24024
|
] }),
|
|
24081
|
-
/* @__PURE__ */
|
|
24082
|
-
noneAccepted && /* @__PURE__ */
|
|
24083
|
-
/* @__PURE__ */
|
|
24084
|
-
/* @__PURE__ */
|
|
24085
|
-
/* @__PURE__ */
|
|
24025
|
+
/* @__PURE__ */ jsx45(Text41, { children: " " }),
|
|
24026
|
+
noneAccepted && /* @__PURE__ */ jsxs38(Fragment15, { children: [
|
|
24027
|
+
/* @__PURE__ */ jsx45(Text41, { bold: true, color: PALETTE.warning, children: "\u26A0 No components are accepted \u2014 nothing will be pushed." }),
|
|
24028
|
+
/* @__PURE__ */ jsx45(Text41, { color: PALETTE.warning, children: " Accept at least one component ([a] a row, [A] accept all) to push." }),
|
|
24029
|
+
/* @__PURE__ */ jsx45(Text41, { children: " " })
|
|
24086
24030
|
] }),
|
|
24087
|
-
!allResolved && /* @__PURE__ */
|
|
24088
|
-
/* @__PURE__ */
|
|
24089
|
-
/* @__PURE__ */
|
|
24090
|
-
/* @__PURE__ */
|
|
24031
|
+
!allResolved && /* @__PURE__ */ jsxs38(Fragment15, { children: [
|
|
24032
|
+
/* @__PURE__ */ jsx45(Text41, { color: PALETTE.warning, children: "\u26A0 " + needsReview + " unresolved component" + (needsReview === 1 ? "" : "s") + " will not be pushed." }),
|
|
24033
|
+
/* @__PURE__ */ jsx45(Text41, { color: PALETTE.warning, children: " Only explicitly accepted components ship." }),
|
|
24034
|
+
/* @__PURE__ */ jsx45(Text41, { children: " " })
|
|
24091
24035
|
] }),
|
|
24092
|
-
/* @__PURE__ */
|
|
24093
|
-
previewStatus === "running" ? /* @__PURE__ */
|
|
24094
|
-
/* @__PURE__ */
|
|
24036
|
+
/* @__PURE__ */ jsxs38(Box37, { flexDirection: "column", height: 2, children: [
|
|
24037
|
+
previewStatus === "running" ? /* @__PURE__ */ jsx45(Text41, { dimColor: true, children: "Previewing deletions against the target space\u2026" }) : previewStatus === "error" ? /* @__PURE__ */ jsx45(Text41, { color: PALETTE.warning, children: "\u26A0 Could not preview deletions (the push will still proceed)." }) : /* @__PURE__ */ jsx45(Text41, { children: " " }),
|
|
24038
|
+
/* @__PURE__ */ jsx45(Text41, { children: " " })
|
|
24095
24039
|
] }),
|
|
24096
|
-
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */
|
|
24097
|
-
/* @__PURE__ */
|
|
24098
|
-
hasMoreAbove && /* @__PURE__ */
|
|
24099
|
-
windowed.map((rc) => /* @__PURE__ */
|
|
24100
|
-
hasMoreBelow && /* @__PURE__ */
|
|
24101
|
-
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */
|
|
24102
|
-
/* @__PURE__ */
|
|
24040
|
+
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs38(Fragment15, { children: [
|
|
24041
|
+
/* @__PURE__ */ jsx45(Text41, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removed.length, false) }),
|
|
24042
|
+
hasMoreAbove && /* @__PURE__ */ jsx45(Text41, { dimColor: true, children: " \u2191 more above" }),
|
|
24043
|
+
windowed.map((rc) => /* @__PURE__ */ jsx45(Text41, { color: PALETTE.error, children: removedComponentLine(rc) }, rc.id)),
|
|
24044
|
+
hasMoreBelow && /* @__PURE__ */ jsx45(Text41, { dimColor: true, children: " \u2193 more below" }),
|
|
24045
|
+
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */ jsx45(Text41, { dimColor: true, children: " [\u2191\u2193] scroll deletions" }),
|
|
24046
|
+
/* @__PURE__ */ jsx45(Text41, { children: " " })
|
|
24103
24047
|
] }),
|
|
24104
|
-
/* @__PURE__ */
|
|
24105
|
-
/* @__PURE__ */
|
|
24106
|
-
/* @__PURE__ */
|
|
24048
|
+
/* @__PURE__ */ jsx45(Text41, { children: noneAccepted ? "Confirm exit with nothing accepted?" : allResolved ? "Save decisions and exit? All components resolved." : "Save decisions and exit?" }),
|
|
24049
|
+
/* @__PURE__ */ jsx45(Text41, { children: " " }),
|
|
24050
|
+
/* @__PURE__ */ jsx45(Text41, { children: " [y / Enter] Confirm [n / Esc] Cancel" })
|
|
24107
24051
|
] });
|
|
24108
24052
|
}
|
|
24109
24053
|
var FINALIZE_REMOVED_WINDOW;
|
|
@@ -24118,7 +24062,7 @@ var init_FinalizeDialog = __esm({
|
|
|
24118
24062
|
});
|
|
24119
24063
|
|
|
24120
24064
|
// packages/experience-design-system-cli/src/import/tui/useFinalizePreview.ts
|
|
24121
|
-
import { useEffect as
|
|
24065
|
+
import { useEffect as useEffect9, useRef as useRef5, useState as useState16 } from "react";
|
|
24122
24066
|
function useReviewFinalizePreview({
|
|
24123
24067
|
components,
|
|
24124
24068
|
...options
|
|
@@ -24135,7 +24079,7 @@ function useFinalizePreview(opts) {
|
|
|
24135
24079
|
const [scrollOffset, setScrollOffset] = useState16(0);
|
|
24136
24080
|
const generationRef = useRef5(0);
|
|
24137
24081
|
const acceptedKey = [...acceptedKeys].sort().join("\0");
|
|
24138
|
-
|
|
24082
|
+
useEffect9(() => {
|
|
24139
24083
|
if (!open) {
|
|
24140
24084
|
setStatus("idle");
|
|
24141
24085
|
setRemoved([]);
|
|
@@ -24187,7 +24131,7 @@ var init_useFinalizePreview = __esm({
|
|
|
24187
24131
|
});
|
|
24188
24132
|
|
|
24189
24133
|
// packages/experience-design-system-cli/src/import/tui/hooks/useReviewSession.ts
|
|
24190
|
-
import { useCallback as useCallback3, useEffect as
|
|
24134
|
+
import { useCallback as useCallback3, useEffect as useEffect10, useRef as useRef6, useState as useState17 } from "react";
|
|
24191
24135
|
function loadReviewSessionState({
|
|
24192
24136
|
extractSessionId,
|
|
24193
24137
|
tokenSessionId,
|
|
@@ -24246,7 +24190,7 @@ function useReviewSession({
|
|
|
24246
24190
|
}));
|
|
24247
24191
|
return { result, catalog };
|
|
24248
24192
|
}, [loadSession, tokensPath]);
|
|
24249
|
-
|
|
24193
|
+
useEffect10(() => {
|
|
24250
24194
|
let disposed = false;
|
|
24251
24195
|
void (async () => {
|
|
24252
24196
|
try {
|
|
@@ -24299,7 +24243,7 @@ function useReviewSession({
|
|
|
24299
24243
|
function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
|
|
24300
24244
|
const [reviewMetadata, setReviewMetadata] = useState17(null);
|
|
24301
24245
|
const [componentRationale, setComponentRationale] = useState17(null);
|
|
24302
|
-
|
|
24246
|
+
useEffect10(() => {
|
|
24303
24247
|
const current = components[selectedIdx];
|
|
24304
24248
|
if (!current) {
|
|
24305
24249
|
setReviewMetadata(null);
|
|
@@ -24342,7 +24286,7 @@ function createReviewHistorySnapshot(components, options = {}) {
|
|
|
24342
24286
|
function useReviewHistory({ loading, components, createSnapshot, applySnapshot }) {
|
|
24343
24287
|
const historyRef = useRef6(null);
|
|
24344
24288
|
const historySeededRef = useRef6(false);
|
|
24345
|
-
|
|
24289
|
+
useEffect10(() => {
|
|
24346
24290
|
if (loading || historySeededRef.current) return;
|
|
24347
24291
|
historySeededRef.current = true;
|
|
24348
24292
|
historyRef.current = createHistoryStack(createSnapshot(components));
|
|
@@ -24431,7 +24375,7 @@ var init_useReviewSession = __esm({
|
|
|
24431
24375
|
});
|
|
24432
24376
|
|
|
24433
24377
|
// packages/experience-design-system-cli/src/import/tui/hooks/useReviewEditor.ts
|
|
24434
|
-
import { useEffect as
|
|
24378
|
+
import { useEffect as useEffect11, useRef as useRef7, useState as useState18 } from "react";
|
|
24435
24379
|
function parseReviewEntry(draftValue) {
|
|
24436
24380
|
const parsed = JSON.parse(draftValue);
|
|
24437
24381
|
const keys = Object.keys(parsed);
|
|
@@ -24465,7 +24409,7 @@ function useReviewEditor({
|
|
|
24465
24409
|
const [tokenReviewEditSelection, setTokenReviewEditSelection] = useState18(/* @__PURE__ */ new Set());
|
|
24466
24410
|
const tokenReviewSuggestedRef = useRef7(/* @__PURE__ */ new Map());
|
|
24467
24411
|
const pendingGRef = useRef7(false);
|
|
24468
|
-
|
|
24412
|
+
useEffect11(() => {
|
|
24469
24413
|
setTokenReviewRow(0);
|
|
24470
24414
|
setTokenReviewEditing(false);
|
|
24471
24415
|
setTokenReviewEditCursor(0);
|
|
@@ -24485,6 +24429,7 @@ function useReviewEditor({
|
|
|
24485
24429
|
const handleEditSave = () => {
|
|
24486
24430
|
const current = components[selectedIdx];
|
|
24487
24431
|
if (!current) return;
|
|
24432
|
+
if (draftValue.trim() === "") return;
|
|
24488
24433
|
try {
|
|
24489
24434
|
const entry = parseReviewEntry(draftValue);
|
|
24490
24435
|
const next = components.map(
|
|
@@ -24608,8 +24553,8 @@ var init_useReviewSurfaceState = __esm({
|
|
|
24608
24553
|
});
|
|
24609
24554
|
|
|
24610
24555
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/QuitDialog.tsx
|
|
24611
|
-
import { Box as
|
|
24612
|
-
import { Fragment as Fragment16, jsx as
|
|
24556
|
+
import { Box as Box38, Text as Text42 } from "ink";
|
|
24557
|
+
import { Fragment as Fragment16, jsx as jsx46, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
24613
24558
|
function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
24614
24559
|
useImmediateInput((input, key) => {
|
|
24615
24560
|
if (input === "y" || key.return) {
|
|
@@ -24618,16 +24563,16 @@ function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
|
24618
24563
|
onCancel();
|
|
24619
24564
|
}
|
|
24620
24565
|
});
|
|
24621
|
-
return /* @__PURE__ */
|
|
24622
|
-
/* @__PURE__ */
|
|
24623
|
-
/* @__PURE__ */
|
|
24624
|
-
hasUnsavedDrafts ? /* @__PURE__ */
|
|
24625
|
-
/* @__PURE__ */
|
|
24626
|
-
/* @__PURE__ */
|
|
24627
|
-
/* @__PURE__ */
|
|
24628
|
-
] }) : /* @__PURE__ */
|
|
24629
|
-
/* @__PURE__ */
|
|
24630
|
-
/* @__PURE__ */
|
|
24566
|
+
return /* @__PURE__ */ jsxs39(Box38, { flexDirection: "column", borderStyle: "round", padding: 1, width: 50, children: [
|
|
24567
|
+
/* @__PURE__ */ jsx46(Text42, { bold: true, children: "\u2500".repeat(19) + " Quit " + "\u2500".repeat(19) }),
|
|
24568
|
+
/* @__PURE__ */ jsx46(Text42, { children: " " }),
|
|
24569
|
+
hasUnsavedDrafts ? /* @__PURE__ */ jsxs39(Fragment16, { children: [
|
|
24570
|
+
/* @__PURE__ */ jsx46(Text42, { children: "You have unsaved draft edits." }),
|
|
24571
|
+
/* @__PURE__ */ jsx46(Text42, { children: "Session state is preserved \u2014 you can resume" }),
|
|
24572
|
+
/* @__PURE__ */ jsx46(Text42, { children: "by running the same review command again." })
|
|
24573
|
+
] }) : /* @__PURE__ */ jsx46(Text42, { children: "Session is saved. Quit without finalizing?" }),
|
|
24574
|
+
/* @__PURE__ */ jsx46(Text42, { children: " " }),
|
|
24575
|
+
/* @__PURE__ */ jsx46(Text42, { children: " [y / Enter] Quit [n / Esc] Stay" })
|
|
24631
24576
|
] });
|
|
24632
24577
|
}
|
|
24633
24578
|
var init_QuitDialog = __esm({
|
|
@@ -24638,8 +24583,8 @@ var init_QuitDialog = __esm({
|
|
|
24638
24583
|
});
|
|
24639
24584
|
|
|
24640
24585
|
// packages/experience-design-system-cli/src/import/tui/components/ReviewDialogs.tsx
|
|
24641
|
-
import { Box as
|
|
24642
|
-
import { Fragment as Fragment17, jsx as
|
|
24586
|
+
import { Box as Box39, Text as Text43 } from "ink";
|
|
24587
|
+
import { Fragment as Fragment17, jsx as jsx47, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
24643
24588
|
function ReviewFinalizeDialogs({
|
|
24644
24589
|
showFinalize,
|
|
24645
24590
|
showQuit,
|
|
@@ -24653,8 +24598,8 @@ function ReviewFinalizeDialogs({
|
|
|
24653
24598
|
onQuitCancel
|
|
24654
24599
|
}) {
|
|
24655
24600
|
const { accepted, rejected, needsReview } = countReviewStatuses(components);
|
|
24656
|
-
return /* @__PURE__ */
|
|
24657
|
-
showFinalize && /* @__PURE__ */
|
|
24601
|
+
return /* @__PURE__ */ jsxs40(Fragment17, { children: [
|
|
24602
|
+
showFinalize && /* @__PURE__ */ jsx47(
|
|
24658
24603
|
FinalizeDialog,
|
|
24659
24604
|
{
|
|
24660
24605
|
accepted,
|
|
@@ -24667,7 +24612,7 @@ function ReviewFinalizeDialogs({
|
|
|
24667
24612
|
onCancel: onFinalizeCancel
|
|
24668
24613
|
}
|
|
24669
24614
|
),
|
|
24670
|
-
showQuit && /* @__PURE__ */
|
|
24615
|
+
showQuit && /* @__PURE__ */ jsx47(QuitDialog, { hasUnsavedDrafts: false, onConfirm: onQuitConfirm, onCancel: onQuitCancel })
|
|
24671
24616
|
] });
|
|
24672
24617
|
}
|
|
24673
24618
|
function ReviewStepDialogs({
|
|
@@ -24677,7 +24622,7 @@ function ReviewStepDialogs({
|
|
|
24677
24622
|
onFinalize,
|
|
24678
24623
|
onQuit
|
|
24679
24624
|
}) {
|
|
24680
|
-
return /* @__PURE__ */
|
|
24625
|
+
return /* @__PURE__ */ jsx47(
|
|
24681
24626
|
ReviewFinalizeDialogs,
|
|
24682
24627
|
{
|
|
24683
24628
|
showFinalize: surfaceState.showFinalize,
|
|
@@ -24695,12 +24640,12 @@ function ReviewStepDialogs({
|
|
|
24695
24640
|
}
|
|
24696
24641
|
function ReviewReloadDialog({ open }) {
|
|
24697
24642
|
if (!open) return null;
|
|
24698
|
-
return /* @__PURE__ */
|
|
24699
|
-
/* @__PURE__ */
|
|
24700
|
-
/* @__PURE__ */
|
|
24701
|
-
/* @__PURE__ */
|
|
24702
|
-
/* @__PURE__ */
|
|
24703
|
-
/* @__PURE__ */
|
|
24643
|
+
return /* @__PURE__ */ jsxs40(Box39, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
24644
|
+
/* @__PURE__ */ jsx47(Text43, { bold: true, color: PALETTE.warning, children: "Reload from saved state?" }),
|
|
24645
|
+
/* @__PURE__ */ jsx47(Text43, { children: "Unsaved in-memory changes will be lost." }),
|
|
24646
|
+
/* @__PURE__ */ jsx47(Text43, { children: " " }),
|
|
24647
|
+
/* @__PURE__ */ jsx47(Text43, { children: " [Enter] Confirm" }),
|
|
24648
|
+
/* @__PURE__ */ jsx47(Text43, { children: " [Esc] Cancel" })
|
|
24704
24649
|
] });
|
|
24705
24650
|
}
|
|
24706
24651
|
var init_ReviewDialogs = __esm({
|
|
@@ -24721,11 +24666,11 @@ function handleReviewOverlayInput(input, key, state) {
|
|
|
24721
24666
|
return true;
|
|
24722
24667
|
}
|
|
24723
24668
|
if (state.showFinalize) {
|
|
24724
|
-
if (
|
|
24669
|
+
if (key.downArrow) {
|
|
24725
24670
|
state.finalizePreview.scrollBy(1);
|
|
24726
24671
|
return true;
|
|
24727
24672
|
}
|
|
24728
|
-
if (
|
|
24673
|
+
if (key.upArrow) {
|
|
24729
24674
|
state.finalizePreview.scrollBy(-1);
|
|
24730
24675
|
return true;
|
|
24731
24676
|
}
|
|
@@ -24763,6 +24708,10 @@ function handleTokenReviewInput(input, key, state) {
|
|
|
24763
24708
|
const suggestions = state.currentTokenSuggestions();
|
|
24764
24709
|
const row = suggestions[state.tokenReviewRow];
|
|
24765
24710
|
if (state.tokenReviewEditing) {
|
|
24711
|
+
if (key.ctrl && input === "s" && row) {
|
|
24712
|
+
state.handleTokenEditSave(row);
|
|
24713
|
+
return true;
|
|
24714
|
+
}
|
|
24766
24715
|
if (row && row.paths.length > 0) {
|
|
24767
24716
|
if (key.upArrow || input === "k") {
|
|
24768
24717
|
state.setTokenReviewEditCursor((cursor) => Math.max(0, cursor - 1));
|
|
@@ -24783,10 +24732,6 @@ function handleTokenReviewInput(input, key, state) {
|
|
|
24783
24732
|
});
|
|
24784
24733
|
return true;
|
|
24785
24734
|
}
|
|
24786
|
-
if (key.ctrl && input === "s") {
|
|
24787
|
-
state.handleTokenEditSave(row);
|
|
24788
|
-
return true;
|
|
24789
|
-
}
|
|
24790
24735
|
}
|
|
24791
24736
|
if (key.escape) {
|
|
24792
24737
|
state.setTokenReviewEditing(false);
|
|
@@ -24865,12 +24810,6 @@ function handleReviewViewToggleInput(input, state) {
|
|
|
24865
24810
|
state.pendingGRef.current = false;
|
|
24866
24811
|
return true;
|
|
24867
24812
|
}
|
|
24868
|
-
if (input === "H") {
|
|
24869
|
-
state.setShowHiddenProps((previous) => !previous);
|
|
24870
|
-
state.setJsonScrollOffset(0);
|
|
24871
|
-
state.pendingGRef.current = false;
|
|
24872
|
-
return true;
|
|
24873
|
-
}
|
|
24874
24813
|
return false;
|
|
24875
24814
|
}
|
|
24876
24815
|
function handleJsonPanelInput(input, key, state) {
|
|
@@ -24943,7 +24882,7 @@ var init_preview_annotations = __esm({
|
|
|
24943
24882
|
});
|
|
24944
24883
|
|
|
24945
24884
|
// packages/experience-design-system-cli/src/import/tui/useLivePreview.ts
|
|
24946
|
-
import { useCallback as useCallback4, useEffect as
|
|
24885
|
+
import { useCallback as useCallback4, useEffect as useEffect12, useRef as useRef8, useState as useState20 } from "react";
|
|
24947
24886
|
function useLivePreview(opts) {
|
|
24948
24887
|
const debounceMs = opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
24949
24888
|
const [status, setStatus] = useState20("idle");
|
|
@@ -24953,14 +24892,14 @@ function useLivePreview(opts) {
|
|
|
24953
24892
|
const latestRef = useRef8(0);
|
|
24954
24893
|
const inflightRef = useRef8(0);
|
|
24955
24894
|
const optsRef = useRef8(opts);
|
|
24956
|
-
|
|
24895
|
+
useEffect12(() => {
|
|
24957
24896
|
optsRef.current = opts;
|
|
24958
24897
|
});
|
|
24959
24898
|
const disabledRef = useRef8(disabled);
|
|
24960
|
-
|
|
24899
|
+
useEffect12(() => {
|
|
24961
24900
|
disabledRef.current = disabled;
|
|
24962
24901
|
}, [disabled]);
|
|
24963
|
-
|
|
24902
|
+
useEffect12(() => {
|
|
24964
24903
|
return () => {
|
|
24965
24904
|
if (timerRef.current) {
|
|
24966
24905
|
clearTimeout(timerRef.current);
|
|
@@ -25041,7 +24980,7 @@ var init_useLivePreview = __esm({
|
|
|
25041
24980
|
});
|
|
25042
24981
|
|
|
25043
24982
|
// packages/experience-design-system-cli/src/import/tui/hooks/useReviewPreview.ts
|
|
25044
|
-
import { useCallback as useCallback5, useEffect as
|
|
24983
|
+
import { useCallback as useCallback5, useEffect as useEffect13, useState as useState21 } from "react";
|
|
25045
24984
|
function useReviewPreview({
|
|
25046
24985
|
components,
|
|
25047
24986
|
loading,
|
|
@@ -25083,13 +25022,13 @@ function useReviewPreview({
|
|
|
25083
25022
|
deleteAllComponents
|
|
25084
25023
|
});
|
|
25085
25024
|
const [spinnerTick, setSpinnerTick] = useState21(0);
|
|
25086
|
-
|
|
25025
|
+
useEffect13(() => {
|
|
25087
25026
|
if (livePreviewHook.status !== "running") return;
|
|
25088
25027
|
const id = setInterval(() => setSpinnerTick((tick2) => tick2 + 1), 80);
|
|
25089
25028
|
return () => clearInterval(id);
|
|
25090
25029
|
}, [livePreviewHook.status]);
|
|
25091
25030
|
const livePreviewSpinner = SPINNER_FRAMES2[spinnerTick % SPINNER_FRAMES2.length];
|
|
25092
|
-
|
|
25031
|
+
useEffect13(() => {
|
|
25093
25032
|
if (loading) return;
|
|
25094
25033
|
if (!livePreview) return;
|
|
25095
25034
|
if (components.length === 0) return;
|
|
@@ -25108,8 +25047,8 @@ var init_useReviewPreview = __esm({
|
|
|
25108
25047
|
});
|
|
25109
25048
|
|
|
25110
25049
|
// packages/experience-design-system-cli/src/import/tui/components/LivePreviewSummary.tsx
|
|
25111
|
-
import { Box as
|
|
25112
|
-
import { jsx as
|
|
25050
|
+
import { Box as Box40, Text as Text44 } from "ink";
|
|
25051
|
+
import { jsx as jsx48, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
25113
25052
|
function LivePreviewSummary({
|
|
25114
25053
|
enabled,
|
|
25115
25054
|
previewAnnotations,
|
|
@@ -25123,19 +25062,19 @@ function LivePreviewSummary({
|
|
|
25123
25062
|
const counts = { new: 0, changed: 0, removed: 0, breaking: 0 };
|
|
25124
25063
|
for (const annotation of previewAnnotations.values()) counts[annotation] += 1;
|
|
25125
25064
|
const hasCounts = counts.new + counts.changed + counts.removed + counts.breaking > 0;
|
|
25126
|
-
if (disabled) return /* @__PURE__ */
|
|
25127
|
-
if (status === "running" && !hasCounts) return /* @__PURE__ */
|
|
25065
|
+
if (disabled) return /* @__PURE__ */ jsx48(Text44, { dimColor: true, children: "Preview: disabled (creds rejected)" });
|
|
25066
|
+
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx48(Text44, { dimColor: true, children: `Preview: ${spinner} running...` });
|
|
25128
25067
|
if (!hasCounts) return null;
|
|
25129
|
-
return /* @__PURE__ */
|
|
25130
|
-
/* @__PURE__ */
|
|
25131
|
-
/* @__PURE__ */
|
|
25132
|
-
/* @__PURE__ */
|
|
25133
|
-
/* @__PURE__ */
|
|
25134
|
-
/* @__PURE__ */
|
|
25135
|
-
/* @__PURE__ */
|
|
25136
|
-
showRemovedListHint && removedCount > 0 && /* @__PURE__ */
|
|
25137
|
-
/* @__PURE__ */
|
|
25138
|
-
/* @__PURE__ */
|
|
25068
|
+
return /* @__PURE__ */ jsxs41(Box40, { children: [
|
|
25069
|
+
/* @__PURE__ */ jsx48(Text44, { children: "Preview: " }),
|
|
25070
|
+
/* @__PURE__ */ jsx48(Text44, { color: PALETTE.success, children: `${counts.new} new` }),
|
|
25071
|
+
/* @__PURE__ */ jsx48(Text44, { children: " \xB7 " }),
|
|
25072
|
+
/* @__PURE__ */ jsx48(Text44, { color: PALETTE.warning, children: `${counts.changed} changed` }),
|
|
25073
|
+
/* @__PURE__ */ jsx48(Text44, { children: " \xB7 " }),
|
|
25074
|
+
/* @__PURE__ */ jsx48(Text44, { dimColor: true, children: `${counts.removed} removed` }),
|
|
25075
|
+
showRemovedListHint && removedCount > 0 && /* @__PURE__ */ jsx48(Text44, { dimColor: true, children: " ([d] removed list)" }),
|
|
25076
|
+
/* @__PURE__ */ jsx48(Text44, { children: " \xB7 " }),
|
|
25077
|
+
/* @__PURE__ */ jsx48(Text44, { color: PALETTE.error, bold: true, children: `${counts.breaking} breaking` })
|
|
25139
25078
|
] });
|
|
25140
25079
|
}
|
|
25141
25080
|
var init_LivePreviewSummary = __esm({
|
|
@@ -25146,10 +25085,10 @@ var init_LivePreviewSummary = __esm({
|
|
|
25146
25085
|
});
|
|
25147
25086
|
|
|
25148
25087
|
// packages/experience-design-system-cli/src/import/tui/steps/GenerateReviewStep.tsx
|
|
25149
|
-
import { useCallback as useCallback6, useEffect as
|
|
25150
|
-
import
|
|
25151
|
-
import { Box as
|
|
25152
|
-
import { Fragment as Fragment18, jsx as
|
|
25088
|
+
import { useCallback as useCallback6, useEffect as useEffect14, useMemo as useMemo3, useRef as useRef9, useState as useState22 } from "react";
|
|
25089
|
+
import figures6 from "figures";
|
|
25090
|
+
import { Box as Box41, Text as Text45 } from "ink";
|
|
25091
|
+
import { Fragment as Fragment18, jsx as jsx49, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
25153
25092
|
function sortComponentsForSidebar(components, cycleParticipants) {
|
|
25154
25093
|
const isEmpty2 = (entry) => Object.keys(entry.$properties ?? {}).length === 0 && Object.keys(entry.$slots ?? {}).length === 0;
|
|
25155
25094
|
const tier = (c2) => {
|
|
@@ -25190,13 +25129,66 @@ function CyclePathLine({
|
|
|
25190
25129
|
highlightComponents = false,
|
|
25191
25130
|
highlightLine = false
|
|
25192
25131
|
}) {
|
|
25193
|
-
return /* @__PURE__ */
|
|
25132
|
+
return /* @__PURE__ */ jsxs42(Text45, { color: highlightLine ? PALETTE.warning : void 0, children: [
|
|
25194
25133
|
prefix,
|
|
25195
25134
|
segments.map(
|
|
25196
|
-
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */
|
|
25135
|
+
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx49(Text45, { color: PALETTE.info, children: segment.text }, index) : segment.kind === "arrow" ? /* @__PURE__ */ jsx49(Text45, { dimColor: true, children: segment.text }, index) : /* @__PURE__ */ jsx49(Text45, { color: highlightComponents ? PALETTE.warning : void 0, children: segment.text }, index)
|
|
25197
25136
|
)
|
|
25198
25137
|
] });
|
|
25199
25138
|
}
|
|
25139
|
+
function CycleDetailPanel({
|
|
25140
|
+
cycles,
|
|
25141
|
+
cursor,
|
|
25142
|
+
scrollOffset,
|
|
25143
|
+
width,
|
|
25144
|
+
height
|
|
25145
|
+
}) {
|
|
25146
|
+
const lines = [
|
|
25147
|
+
/* @__PURE__ */ jsx49(Text45, { bold: true, color: PALETTE.warning, children: `SLOT DEPENDENCY CYCLES (${cycles.length})` }, "cyc-title"),
|
|
25148
|
+
/* @__PURE__ */ jsx49(Text45, { dimColor: true, children: "push will fail until these are resolved" }, "cyc-sub"),
|
|
25149
|
+
/* @__PURE__ */ jsx49(Text45, { dimColor: true, children: "Reject a cycle member or remove a slot edge to break the cycle." }, "cyc-guidance"),
|
|
25150
|
+
/* @__PURE__ */ jsx49(Text45, { children: " " }, "cyc-space")
|
|
25151
|
+
];
|
|
25152
|
+
cycles.forEach((cycle, index) => {
|
|
25153
|
+
const nodeCount = new Set(cycle.path).size;
|
|
25154
|
+
const isCursor = index === cursor;
|
|
25155
|
+
lines.push(
|
|
25156
|
+
/* @__PURE__ */ jsx49(Text45, { bold: true, inverse: isCursor, children: `${isCursor ? figures6.pointer : " "} Cycle ${index + 1} (${nodeCount} component${nodeCount === 1 ? "" : "s"}):` }, `cyc-h-${index}`),
|
|
25157
|
+
/* @__PURE__ */ jsx49(CyclePathLine, { segments: formatCyclePathSegments(cycle, 16), prefix: " " }, `cyc-p-${index}`)
|
|
25158
|
+
);
|
|
25159
|
+
if (cycle.suggestedBreak) {
|
|
25160
|
+
lines.push(
|
|
25161
|
+
/* @__PURE__ */ jsx49(Text45, { dimColor: true, children: ` Suggested fix: remove [${cycle.suggestedBreak.slotName}] from ${cycle.suggestedBreak.fromComponent}` }, `cyc-fix-${index}`)
|
|
25162
|
+
);
|
|
25163
|
+
}
|
|
25164
|
+
lines.push(/* @__PURE__ */ jsx49(Text45, { children: " " }, `cyc-s-${index}`));
|
|
25165
|
+
});
|
|
25166
|
+
const footer = "[\u2191\u2193] move [Enter] fix cycle [c/q/Esc] close";
|
|
25167
|
+
const viewportHeight = Math.max(1, height - 3);
|
|
25168
|
+
const visible = lines.slice(scrollOffset, scrollOffset + viewportHeight - 1);
|
|
25169
|
+
return /* @__PURE__ */ jsxs42(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
25170
|
+
visible,
|
|
25171
|
+
/* @__PURE__ */ jsx49(Text45, { dimColor: true, children: footer })
|
|
25172
|
+
] });
|
|
25173
|
+
}
|
|
25174
|
+
function BreakCyclePanel({
|
|
25175
|
+
cycle,
|
|
25176
|
+
edges,
|
|
25177
|
+
cursor,
|
|
25178
|
+
confirming,
|
|
25179
|
+
width,
|
|
25180
|
+
height
|
|
25181
|
+
}) {
|
|
25182
|
+
return /* @__PURE__ */ jsxs42(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
25183
|
+
/* @__PURE__ */ jsx49(Text45, { bold: true, color: PALETTE.warning, children: "BREAK CYCLE \u2014 remove a slot edge" }),
|
|
25184
|
+
cycle && /* @__PURE__ */ jsx49(CyclePathLine, { segments: formatCyclePathSegments(cycle), prefix: " ", highlightComponents: true }),
|
|
25185
|
+
/* @__PURE__ */ jsx49(Text45, { dimColor: true, children: cycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
|
|
25186
|
+
/* @__PURE__ */ jsx49(Text45, { children: " " }),
|
|
25187
|
+
edges.length > 0 && /* @__PURE__ */ jsx49(Text45, { dimColor: true, children: "remove slot edge:" }),
|
|
25188
|
+
edges.map((edge, index) => /* @__PURE__ */ jsx49(Text45, { inverse: index === cursor, children: `${index === cursor ? figures6.pointer : " "} remove '${edge.toComponent}' from ${edge.fromComponent}.$slots.${edge.slotName}.$allowedComponents` }, `${edge.fromComponent}-${edge.slotName}-${edge.toComponent}`)),
|
|
25189
|
+
confirming ? /* @__PURE__ */ jsx49(Text45, { bold: true, color: PALETTE.warning, children: "Delete this slot edge? [y] confirm [n] cancel" }) : /* @__PURE__ */ jsx49(Text45, { dimColor: true, children: "[\u2191\u2193] move [Enter] delete [x/Esc] close" })
|
|
25190
|
+
] });
|
|
25191
|
+
}
|
|
25200
25192
|
function buildBreakingRows(breakingChanges) {
|
|
25201
25193
|
const out = [];
|
|
25202
25194
|
for (const b of breakingChanges) {
|
|
@@ -25240,9 +25232,9 @@ function deriveBreakingChanges(response) {
|
|
|
25240
25232
|
}
|
|
25241
25233
|
function GenerateReviewStep(props) {
|
|
25242
25234
|
if (!props.extractSessionId) {
|
|
25243
|
-
return /* @__PURE__ */
|
|
25235
|
+
return /* @__PURE__ */ jsx49(Box41, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx49(Text45, { color: PALETTE.error, children: "Error: no session ID \u2014 cannot load generated definitions." }) });
|
|
25244
25236
|
}
|
|
25245
|
-
return /* @__PURE__ */
|
|
25237
|
+
return /* @__PURE__ */ jsx49(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
|
|
25246
25238
|
}
|
|
25247
25239
|
function GenerateReviewStepView({
|
|
25248
25240
|
extractSessionId,
|
|
@@ -25257,8 +25249,7 @@ function GenerateReviewStepView({
|
|
|
25257
25249
|
tokensPath = "",
|
|
25258
25250
|
initialFinalizeError = null
|
|
25259
25251
|
}) {
|
|
25260
|
-
const {
|
|
25261
|
-
const terminalWidth = stdout?.columns ?? 80;
|
|
25252
|
+
const { columns: terminalWidth, rows: terminalRows } = useTerminalSize();
|
|
25262
25253
|
const [slotCycles, setSlotCycles] = useState22([]);
|
|
25263
25254
|
const setLoadedSlotCycles = useCallback6((cycles) => {
|
|
25264
25255
|
setSlotCycles(cycles ?? []);
|
|
@@ -25345,8 +25336,6 @@ function GenerateReviewStepView({
|
|
|
25345
25336
|
showHelp,
|
|
25346
25337
|
setShowHelp
|
|
25347
25338
|
} = useSidebarSearchState();
|
|
25348
|
-
const lineagePanel = useOverlayPanel({ toggleKey: "l" });
|
|
25349
|
-
const [lineageCursor, setLineageCursor] = useState22(0);
|
|
25350
25339
|
const breakingPanel = useOverlayPanel({ toggleKey: "b", onClose: () => setBreakingDetailOpen(false) });
|
|
25351
25340
|
const [breakingChanges, setBreakingChanges] = useState22([]);
|
|
25352
25341
|
const [breakingCursor, setBreakingCursor] = useState22(0);
|
|
@@ -25355,10 +25344,6 @@ function GenerateReviewStepView({
|
|
|
25355
25344
|
const [autoRejected, setAutoRejected] = useState22([]);
|
|
25356
25345
|
const [undoSnapshot, setUndoSnapshot] = useState22(null);
|
|
25357
25346
|
const autoRejectFiredRef = useRef9(false);
|
|
25358
|
-
const [editorDirty, setEditorDirty] = useState22(false);
|
|
25359
|
-
const [showUnsavedWarning, setShowUnsavedWarning] = useState22(false);
|
|
25360
|
-
const [pendingFocusAway, setPendingFocusAway] = useState22(null);
|
|
25361
|
-
const [discardTrigger, setDiscardTrigger] = useState22(0);
|
|
25362
25347
|
const [showReloadDialog, setShowReloadDialog] = useState22(false);
|
|
25363
25348
|
const acceptedCountForPreview = components.filter((c2) => c2.status === "accepted").length;
|
|
25364
25349
|
const { previewAnnotations, removedComponents, livePreviewHook, livePreviewSpinner } = useReviewPreview({
|
|
@@ -25415,13 +25400,13 @@ function GenerateReviewStepView({
|
|
|
25415
25400
|
} catch {
|
|
25416
25401
|
}
|
|
25417
25402
|
};
|
|
25418
|
-
const componentGraph =
|
|
25419
|
-
const sidebarGraph =
|
|
25403
|
+
const componentGraph = useMemo3(() => buildComponentGraph(components), [components]);
|
|
25404
|
+
const sidebarGraph = useMemo3(
|
|
25420
25405
|
() => buildComponentGraph(components, { stripRejectedEdges: true }),
|
|
25421
25406
|
[components]
|
|
25422
25407
|
);
|
|
25423
|
-
const closures =
|
|
25424
|
-
|
|
25408
|
+
const closures = useMemo3(() => computeAllClosures(componentGraph), [componentGraph]);
|
|
25409
|
+
useEffect14(() => {
|
|
25425
25410
|
if (seededGroupsRef.current) return;
|
|
25426
25411
|
if (closures.size === 0 && slotCycles.length === 0) return;
|
|
25427
25412
|
seededGroupsRef.current = true;
|
|
@@ -25432,15 +25417,23 @@ function GenerateReviewStepView({
|
|
|
25432
25417
|
)
|
|
25433
25418
|
);
|
|
25434
25419
|
}, [closures, slotCycles]);
|
|
25435
|
-
const directIssues =
|
|
25420
|
+
const directIssues = useMemo3(() => {
|
|
25436
25421
|
const m = /* @__PURE__ */ new Map();
|
|
25437
25422
|
for (const c2 of components) {
|
|
25438
25423
|
if (c2.status === "rejected") m.set(c2.key, "error");
|
|
25439
25424
|
}
|
|
25440
25425
|
return m;
|
|
25441
25426
|
}, [components]);
|
|
25442
|
-
const cycleView =
|
|
25443
|
-
|
|
25427
|
+
const cycleView = useMemo3(() => computeCycleView(components), [components]);
|
|
25428
|
+
const cycleRows = useMemo3(() => {
|
|
25429
|
+
if (slotCycles.length > 0) return slotCycles;
|
|
25430
|
+
return cycleView.pushBlocking.map((cycle) => ({
|
|
25431
|
+
path: cycle.path,
|
|
25432
|
+
edges: cycle.edges,
|
|
25433
|
+
suggestedBreak: cycle.edges.length > 0 ? suggestCycleBreakEdge(cycle, cycleView.pushBlocking) : null
|
|
25434
|
+
}));
|
|
25435
|
+
}, [slotCycles, cycleView]);
|
|
25436
|
+
useEffect14(() => {
|
|
25444
25437
|
const decision = computeAutoRejectDecision({
|
|
25445
25438
|
loading,
|
|
25446
25439
|
autoRejectFired: autoRejectFiredRef.current,
|
|
@@ -25484,7 +25477,7 @@ function GenerateReviewStepView({
|
|
|
25484
25477
|
applySnapshot: applyHistorySnapshot
|
|
25485
25478
|
});
|
|
25486
25479
|
const autoRejectPushedRef = useRef9(false);
|
|
25487
|
-
|
|
25480
|
+
useEffect14(() => {
|
|
25488
25481
|
if (loading) return;
|
|
25489
25482
|
if (!historySeededRef.current) return;
|
|
25490
25483
|
if (!autoRejectFiredRef.current) return;
|
|
@@ -25510,7 +25503,7 @@ function GenerateReviewStepView({
|
|
|
25510
25503
|
reviewEditor.setSaveError(null);
|
|
25511
25504
|
setFinalizeError(null);
|
|
25512
25505
|
};
|
|
25513
|
-
const groupedItemsMemo =
|
|
25506
|
+
const groupedItemsMemo = useMemo3(
|
|
25514
25507
|
() => components.map((c2) => ({
|
|
25515
25508
|
key: c2.key,
|
|
25516
25509
|
entry: c2.entry,
|
|
@@ -25518,12 +25511,12 @@ function GenerateReviewStepView({
|
|
|
25518
25511
|
})),
|
|
25519
25512
|
[components, directIssues]
|
|
25520
25513
|
);
|
|
25521
|
-
const brokenKeys =
|
|
25514
|
+
const brokenKeys = useMemo3(
|
|
25522
25515
|
() => new Set(breakingChanges.map((b) => b.componentName)),
|
|
25523
25516
|
[breakingChanges]
|
|
25524
25517
|
);
|
|
25525
|
-
const breakingRows =
|
|
25526
|
-
const filterVisibleKeys =
|
|
25518
|
+
const breakingRows = useMemo3(() => buildBreakingRows(breakingChanges), [breakingChanges]);
|
|
25519
|
+
const filterVisibleKeys = useMemo3(() => {
|
|
25527
25520
|
if (jumpFilterTarget) {
|
|
25528
25521
|
return findAllAncestors2(jumpFilterTarget, sidebarGraph);
|
|
25529
25522
|
}
|
|
@@ -25539,7 +25532,7 @@ function GenerateReviewStepView({
|
|
|
25539
25532
|
})();
|
|
25540
25533
|
return intersectFilterKeys(categoryKeys, searchKeys);
|
|
25541
25534
|
}, [jumpFilterTarget, activeFilters, cycleView, brokenKeys, searchQuery, groupedItemsMemo, sidebarGraph]);
|
|
25542
|
-
const visibleRowsMemo =
|
|
25535
|
+
const visibleRowsMemo = useMemo3(
|
|
25543
25536
|
() => buildVisibleRows({
|
|
25544
25537
|
items: groupedItemsMemo,
|
|
25545
25538
|
cycleParticipants: cycleView.structural,
|
|
@@ -25550,7 +25543,7 @@ function GenerateReviewStepView({
|
|
|
25550
25543
|
}),
|
|
25551
25544
|
[groupedItemsMemo, cycleView, expandedGroups, columnOneView, sidebarGraph, filterVisibleKeys]
|
|
25552
25545
|
);
|
|
25553
|
-
const selectableRowPositions =
|
|
25546
|
+
const selectableRowPositions = useMemo3(() => {
|
|
25554
25547
|
const out = [];
|
|
25555
25548
|
for (let i = 0; i < visibleRowsMemo.length; i++) {
|
|
25556
25549
|
if (visibleRowsMemo[i].itemIdx >= 0) out.push(i);
|
|
@@ -25559,13 +25552,16 @@ function GenerateReviewStepView({
|
|
|
25559
25552
|
}, [visibleRowsMemo]);
|
|
25560
25553
|
const selectedIdx = visibleRowsMemo[cursorRowIdx]?.itemIdx ?? -1;
|
|
25561
25554
|
const focusedComponentKey = components[selectedIdx]?.key ?? null;
|
|
25562
|
-
const { entries: lineageEntries, jumpables: lineageJumpables } = useLineage(focusedComponentKey, componentGraph);
|
|
25563
25555
|
const { sidebarVisibleCount: visibleCount, panelMaxRows } = computeSidebarBudget({
|
|
25564
|
-
rows:
|
|
25565
|
-
panelOpen:
|
|
25566
|
-
entryCount:
|
|
25556
|
+
rows: terminalRows || FALLBACK_ROWS,
|
|
25557
|
+
panelOpen: false,
|
|
25558
|
+
entryCount: 0
|
|
25567
25559
|
});
|
|
25568
|
-
|
|
25560
|
+
const leftPanelHeight = visibleCount + 4;
|
|
25561
|
+
const panelHeight = leftPanelHeight + 2;
|
|
25562
|
+
const panelContentHeight = Math.max(1, panelHeight - 3);
|
|
25563
|
+
const cycleViewportHeight = Math.max(1, panelHeight - 4);
|
|
25564
|
+
useEffect14(() => {
|
|
25569
25565
|
if (selectableRowPositions.length === 0) return;
|
|
25570
25566
|
const cursorInRange = selectableRowPositions.includes(cursorRowIdx);
|
|
25571
25567
|
const maxScroll = Math.max(0, visibleRowsMemo.length - visibleCount);
|
|
@@ -25596,7 +25592,7 @@ function GenerateReviewStepView({
|
|
|
25596
25592
|
selectedIdx,
|
|
25597
25593
|
extractSessionId
|
|
25598
25594
|
});
|
|
25599
|
-
const renderStatusByKey =
|
|
25595
|
+
const renderStatusByKey = useMemo3(() => {
|
|
25600
25596
|
const merged = /* @__PURE__ */ new Map();
|
|
25601
25597
|
for (const closure of closures.values()) {
|
|
25602
25598
|
const per = computeRenderStatuses(closure, directIssues);
|
|
@@ -25609,7 +25605,7 @@ function GenerateReviewStepView({
|
|
|
25609
25605
|
}
|
|
25610
25606
|
return merged;
|
|
25611
25607
|
}, [closures, directIssues]);
|
|
25612
|
-
const selectionStateByKey =
|
|
25608
|
+
const selectionStateByKey = useMemo3(() => {
|
|
25613
25609
|
const map = /* @__PURE__ */ new Map();
|
|
25614
25610
|
for (const c2 of components) {
|
|
25615
25611
|
if (c2.status === "accepted") map.set(c2.key, "accepted");
|
|
@@ -25618,7 +25614,7 @@ function GenerateReviewStepView({
|
|
|
25618
25614
|
}
|
|
25619
25615
|
return map;
|
|
25620
25616
|
}, [components]);
|
|
25621
|
-
const searchMatches =
|
|
25617
|
+
const searchMatches = useMemo3(() => {
|
|
25622
25618
|
if (!searchQuery) return [];
|
|
25623
25619
|
const out = [];
|
|
25624
25620
|
for (const pos of selectableRowPositions) {
|
|
@@ -25628,7 +25624,7 @@ function GenerateReviewStepView({
|
|
|
25628
25624
|
}
|
|
25629
25625
|
return out;
|
|
25630
25626
|
}, [searchQuery, selectableRowPositions, visibleRowsMemo, components]);
|
|
25631
|
-
const searchMatchCount =
|
|
25627
|
+
const searchMatchCount = useMemo3(() => {
|
|
25632
25628
|
if (searchMatches.length === 0) return 0;
|
|
25633
25629
|
const seen = /* @__PURE__ */ new Set();
|
|
25634
25630
|
for (const pos of searchMatches) {
|
|
@@ -25637,7 +25633,7 @@ function GenerateReviewStepView({
|
|
|
25637
25633
|
}
|
|
25638
25634
|
return seen.size;
|
|
25639
25635
|
}, [searchMatches, visibleRowsMemo]);
|
|
25640
|
-
const dimPredicate =
|
|
25636
|
+
const dimPredicate = useMemo3(
|
|
25641
25637
|
() => buildFlatDimPredicate({
|
|
25642
25638
|
viewMode: columnOneView,
|
|
25643
25639
|
searchQuery,
|
|
@@ -25654,7 +25650,7 @@ function GenerateReviewStepView({
|
|
|
25654
25650
|
return { cursorRowIdx: rowIdx, sidebarScrollOffset: nextOff };
|
|
25655
25651
|
});
|
|
25656
25652
|
reviewEditor.setJsonScrollOffset(0);
|
|
25657
|
-
reviewEditor.
|
|
25653
|
+
reviewEditor.handleEditSave();
|
|
25658
25654
|
reviewEditor.setSaveError(null);
|
|
25659
25655
|
setPendingEditorFocus(null);
|
|
25660
25656
|
};
|
|
@@ -25668,26 +25664,27 @@ function GenerateReviewStepView({
|
|
|
25668
25664
|
}
|
|
25669
25665
|
}
|
|
25670
25666
|
};
|
|
25671
|
-
const breakEdges =
|
|
25672
|
-
const cycle =
|
|
25673
|
-
|
|
25674
|
-
|
|
25675
|
-
}, [slotCycles, cyclesCursor, components]);
|
|
25667
|
+
const breakEdges = useMemo3(() => {
|
|
25668
|
+
const cycle = cycleRows[cyclesCursor];
|
|
25669
|
+
return cycle ? enumerateCycleBreaks(cycle, components) : [];
|
|
25670
|
+
}, [cycleRows, cyclesCursor, components]);
|
|
25676
25671
|
const handleBreakEdge = (edge) => {
|
|
25677
|
-
const
|
|
25678
|
-
|
|
25679
|
-
|
|
25680
|
-
const slot = target.entry.$slots?.[edge.slotName];
|
|
25681
|
-
if (!slot || !Array.isArray(slot.$allowedComponents)) return;
|
|
25682
|
-
const nextAllowed = slot.$allowedComponents.filter((v) => v !== edge.toComponent);
|
|
25672
|
+
const target = components.find((component) => component.key === edge.fromComponent);
|
|
25673
|
+
const slot = target?.entry.$slots?.[edge.slotName];
|
|
25674
|
+
if (!target || !slot || !Array.isArray(slot.$allowedComponents)) return;
|
|
25683
25675
|
const nextEntry = {
|
|
25684
25676
|
...target.entry,
|
|
25685
25677
|
$slots: {
|
|
25686
25678
|
...target.entry.$slots,
|
|
25687
|
-
[edge.slotName]: {
|
|
25679
|
+
[edge.slotName]: {
|
|
25680
|
+
...slot,
|
|
25681
|
+
$allowedComponents: slot.$allowedComponents.filter((value) => value !== edge.toComponent)
|
|
25682
|
+
}
|
|
25688
25683
|
}
|
|
25689
25684
|
};
|
|
25690
|
-
const next = components.map(
|
|
25685
|
+
const next = components.map(
|
|
25686
|
+
(component) => component.key === target.key ? { ...component, entry: nextEntry } : component
|
|
25687
|
+
);
|
|
25691
25688
|
setComponents(next);
|
|
25692
25689
|
const db = openPipelineDb();
|
|
25693
25690
|
try {
|
|
@@ -25717,6 +25714,14 @@ function GenerateReviewStepView({
|
|
|
25717
25714
|
};
|
|
25718
25715
|
const dialogOpen = showFinalize || showQuit;
|
|
25719
25716
|
useImmediateInput((input, key) => {
|
|
25717
|
+
if (showHelp) {
|
|
25718
|
+
if (input === "h") {
|
|
25719
|
+
setShowHelp((open) => !open);
|
|
25720
|
+
} else if (key.escape) {
|
|
25721
|
+
setShowHelp(false);
|
|
25722
|
+
}
|
|
25723
|
+
return;
|
|
25724
|
+
}
|
|
25720
25725
|
if (handleReviewOverlayInput(input, key, {
|
|
25721
25726
|
loading,
|
|
25722
25727
|
loadError,
|
|
@@ -25732,25 +25737,6 @@ function GenerateReviewStepView({
|
|
|
25732
25737
|
handleRedo
|
|
25733
25738
|
}))
|
|
25734
25739
|
return;
|
|
25735
|
-
if (showUnsavedWarning) {
|
|
25736
|
-
if (key.return) {
|
|
25737
|
-
reviewEditor.handleEditSave();
|
|
25738
|
-
setShowUnsavedWarning(false);
|
|
25739
|
-
if (pendingFocusAway === "tab-to-sidebar") setSidebarFocused(true);
|
|
25740
|
-
setPendingFocusAway(null);
|
|
25741
|
-
return;
|
|
25742
|
-
}
|
|
25743
|
-
if (key.escape) {
|
|
25744
|
-
setDiscardTrigger((n) => n + 1);
|
|
25745
|
-
setShowUnsavedWarning(false);
|
|
25746
|
-
if (pendingFocusAway === "tab-to-sidebar") setSidebarFocused(true);
|
|
25747
|
-
setPendingFocusAway(null);
|
|
25748
|
-
return;
|
|
25749
|
-
}
|
|
25750
|
-
setShowUnsavedWarning(false);
|
|
25751
|
-
setPendingFocusAway(null);
|
|
25752
|
-
return;
|
|
25753
|
-
}
|
|
25754
25740
|
if (searchOpen) {
|
|
25755
25741
|
if (key.escape) {
|
|
25756
25742
|
setSearchOpen(false);
|
|
@@ -25821,21 +25807,6 @@ function GenerateReviewStepView({
|
|
|
25821
25807
|
}
|
|
25822
25808
|
return;
|
|
25823
25809
|
}
|
|
25824
|
-
if (lineagePanel.isOpen) {
|
|
25825
|
-
if (lineagePanel.handleInput(input, key)) return;
|
|
25826
|
-
if (handleLineageNavigation({
|
|
25827
|
-
input,
|
|
25828
|
-
key,
|
|
25829
|
-
cursor: lineageCursor,
|
|
25830
|
-
jumpables: lineageJumpables,
|
|
25831
|
-
onCursorChange: setLineageCursor,
|
|
25832
|
-
onJump: jumpCursorToName,
|
|
25833
|
-
onClose: lineagePanel.close,
|
|
25834
|
-
allowTab: true
|
|
25835
|
-
}))
|
|
25836
|
-
return;
|
|
25837
|
-
return;
|
|
25838
|
-
}
|
|
25839
25810
|
if (breakPanel.isOpen) {
|
|
25840
25811
|
if (breakConfirm) {
|
|
25841
25812
|
if (input === "y") {
|
|
@@ -25843,6 +25814,7 @@ function GenerateReviewStepView({
|
|
|
25843
25814
|
if (edge) handleBreakEdge(edge);
|
|
25844
25815
|
setBreakConfirm(false);
|
|
25845
25816
|
breakPanel.close();
|
|
25817
|
+
cyclePanel.close();
|
|
25846
25818
|
return;
|
|
25847
25819
|
}
|
|
25848
25820
|
if (input === "n" || key.escape) {
|
|
@@ -25852,12 +25824,12 @@ function GenerateReviewStepView({
|
|
|
25852
25824
|
return;
|
|
25853
25825
|
}
|
|
25854
25826
|
if (breakPanel.handleInput(input, key)) return;
|
|
25855
|
-
if (key.upArrow
|
|
25856
|
-
setBreakCursor((
|
|
25827
|
+
if (key.upArrow) {
|
|
25828
|
+
setBreakCursor((cursor) => Math.max(0, cursor - 1));
|
|
25857
25829
|
return;
|
|
25858
25830
|
}
|
|
25859
|
-
if (key.downArrow
|
|
25860
|
-
setBreakCursor((
|
|
25831
|
+
if (key.downArrow) {
|
|
25832
|
+
setBreakCursor((cursor) => Math.min(Math.max(0, breakEdges.length - 1), cursor + 1));
|
|
25861
25833
|
return;
|
|
25862
25834
|
}
|
|
25863
25835
|
if (key.return) {
|
|
@@ -25881,48 +25853,41 @@ function GenerateReviewStepView({
|
|
|
25881
25853
|
if (key.upArrow || input === "k") {
|
|
25882
25854
|
setCyclesCursor((c2) => {
|
|
25883
25855
|
const next = Math.max(0, c2 - 1);
|
|
25884
|
-
setCyclePanelScroll((scroll) => followCycleScroll(scroll, next,
|
|
25856
|
+
setCyclePanelScroll((scroll) => followCycleScroll(scroll, next, cycleRows, cycleViewportHeight));
|
|
25885
25857
|
return next;
|
|
25886
25858
|
});
|
|
25887
25859
|
return;
|
|
25888
25860
|
}
|
|
25889
25861
|
if (key.downArrow || input === "j") {
|
|
25890
25862
|
setCyclesCursor((c2) => {
|
|
25891
|
-
const next = Math.min(Math.max(0,
|
|
25892
|
-
setCyclePanelScroll((scroll) => followCycleScroll(scroll, next,
|
|
25863
|
+
const next = Math.min(Math.max(0, cycleRows.length - 1), c2 + 1);
|
|
25864
|
+
setCyclePanelScroll((scroll) => followCycleScroll(scroll, next, cycleRows, cycleViewportHeight));
|
|
25893
25865
|
return next;
|
|
25894
25866
|
});
|
|
25895
25867
|
return;
|
|
25896
25868
|
}
|
|
25897
25869
|
if (key.return) {
|
|
25898
|
-
|
|
25899
|
-
|
|
25900
|
-
|
|
25870
|
+
if (breakEdges.length > 0) {
|
|
25871
|
+
breakPanel.open();
|
|
25872
|
+
setBreakCursor(0);
|
|
25873
|
+
setBreakConfirm(false);
|
|
25874
|
+
}
|
|
25901
25875
|
return;
|
|
25902
25876
|
}
|
|
25903
25877
|
return;
|
|
25904
25878
|
}
|
|
25905
|
-
if (input === "c" &&
|
|
25879
|
+
if (input === "c" && cycleRows.length > 0) {
|
|
25906
25880
|
cyclePanel.open();
|
|
25907
25881
|
setCyclePanelScroll(0);
|
|
25908
25882
|
setCyclesCursor(0);
|
|
25909
25883
|
return;
|
|
25910
25884
|
}
|
|
25911
|
-
if (input === "l" && sidebarFocused && focusedComponentKey) {
|
|
25912
|
-
lineagePanel.open();
|
|
25913
|
-
setLineageCursor(0);
|
|
25914
|
-
return;
|
|
25915
|
-
}
|
|
25916
25885
|
if (input === "b" && sidebarFocused && breakingChanges.length > 0) {
|
|
25917
25886
|
breakingPanel.open();
|
|
25918
25887
|
setBreakingCursor(0);
|
|
25919
25888
|
return;
|
|
25920
25889
|
}
|
|
25921
|
-
if (input === "
|
|
25922
|
-
setRemovedBannerCollapsed((prev) => !prev);
|
|
25923
|
-
return;
|
|
25924
|
-
}
|
|
25925
|
-
if (sidebarFocused && (input === "o" || input === "w")) {
|
|
25890
|
+
if (input === "o" || input === "w") {
|
|
25926
25891
|
const category = input === "o" ? "cycles" : "broken";
|
|
25927
25892
|
setActiveFilters((prev) => {
|
|
25928
25893
|
const next = new Set(prev);
|
|
@@ -25939,9 +25904,9 @@ function GenerateReviewStepView({
|
|
|
25939
25904
|
}
|
|
25940
25905
|
if (handleReviewPanelShortcuts(input, key, { ...reviewEditor, propKey: "p", componentKey: "P" })) return;
|
|
25941
25906
|
if (key.tab) {
|
|
25942
|
-
if (!sidebarFocused
|
|
25943
|
-
|
|
25944
|
-
|
|
25907
|
+
if (!sidebarFocused) {
|
|
25908
|
+
reviewEditor.handleEditSave();
|
|
25909
|
+
setSidebarFocused(true);
|
|
25945
25910
|
return;
|
|
25946
25911
|
}
|
|
25947
25912
|
setSidebarFocused((prev) => !prev);
|
|
@@ -25965,9 +25930,25 @@ function GenerateReviewStepView({
|
|
|
25965
25930
|
sidebarFocused,
|
|
25966
25931
|
showJson: reviewEditor.showJson,
|
|
25967
25932
|
jsonValue: getReviewJsonPanelValue(components[selectedIdx] ?? null, reviewEditor.showHiddenProps),
|
|
25968
|
-
height:
|
|
25933
|
+
height: panelContentHeight
|
|
25969
25934
|
}))
|
|
25970
25935
|
return;
|
|
25936
|
+
if (sidebarFocused && (input === "j" || input === "k")) {
|
|
25937
|
+
setNav(
|
|
25938
|
+
({ cursorRowIdx: previousRow, sidebarScrollOffset: previousScroll }) => moveSelectableCursor({
|
|
25939
|
+
direction: input === "j" ? "down" : "up",
|
|
25940
|
+
previousRow,
|
|
25941
|
+
previousScroll,
|
|
25942
|
+
positions: selectableRowPositions,
|
|
25943
|
+
visibleCount
|
|
25944
|
+
})
|
|
25945
|
+
);
|
|
25946
|
+
reviewEditor.setJsonScrollOffset(0);
|
|
25947
|
+
reviewEditor.handleEditSave();
|
|
25948
|
+
reviewEditor.setSaveError(null);
|
|
25949
|
+
setPendingEditorFocus(null);
|
|
25950
|
+
return;
|
|
25951
|
+
}
|
|
25971
25952
|
if (!sidebarFocused) return;
|
|
25972
25953
|
if (input === "/") {
|
|
25973
25954
|
setSearchOpen(true);
|
|
@@ -25982,7 +25963,7 @@ function GenerateReviewStepView({
|
|
|
25982
25963
|
setAutocompleteCandidates([]);
|
|
25983
25964
|
return;
|
|
25984
25965
|
}
|
|
25985
|
-
if (input === "
|
|
25966
|
+
if (input === "h") {
|
|
25986
25967
|
setShowHelp(true);
|
|
25987
25968
|
return;
|
|
25988
25969
|
}
|
|
@@ -26079,7 +26060,7 @@ function GenerateReviewStepView({
|
|
|
26079
26060
|
}
|
|
26080
26061
|
return;
|
|
26081
26062
|
}
|
|
26082
|
-
if (key.upArrow
|
|
26063
|
+
if (key.upArrow) {
|
|
26083
26064
|
setNav(
|
|
26084
26065
|
({ cursorRowIdx: previousRow, sidebarScrollOffset: previousScroll }) => moveSelectableCursor({
|
|
26085
26066
|
direction: "up",
|
|
@@ -26090,10 +26071,10 @@ function GenerateReviewStepView({
|
|
|
26090
26071
|
})
|
|
26091
26072
|
);
|
|
26092
26073
|
reviewEditor.setJsonScrollOffset(0);
|
|
26093
|
-
reviewEditor.
|
|
26074
|
+
reviewEditor.handleEditSave();
|
|
26094
26075
|
reviewEditor.setSaveError(null);
|
|
26095
26076
|
setPendingEditorFocus(null);
|
|
26096
|
-
} else if (key.downArrow
|
|
26077
|
+
} else if (key.downArrow) {
|
|
26097
26078
|
setNav(
|
|
26098
26079
|
({ cursorRowIdx: previousRow, sidebarScrollOffset: previousScroll }) => moveSelectableCursor({
|
|
26099
26080
|
direction: "down",
|
|
@@ -26104,44 +26085,19 @@ function GenerateReviewStepView({
|
|
|
26104
26085
|
})
|
|
26105
26086
|
);
|
|
26106
26087
|
reviewEditor.setJsonScrollOffset(0);
|
|
26107
|
-
reviewEditor.
|
|
26088
|
+
reviewEditor.handleEditSave();
|
|
26108
26089
|
reviewEditor.setSaveError(null);
|
|
26109
26090
|
setPendingEditorFocus(null);
|
|
26110
26091
|
}
|
|
26111
26092
|
});
|
|
26112
26093
|
if (loading) {
|
|
26113
|
-
return /* @__PURE__ */
|
|
26094
|
+
return /* @__PURE__ */ jsx49(ReviewLoadingState, {});
|
|
26114
26095
|
}
|
|
26115
26096
|
if (loadError) {
|
|
26116
|
-
return /* @__PURE__ */
|
|
26097
|
+
return /* @__PURE__ */ jsx49(ReviewLoadError, { message: loadError });
|
|
26117
26098
|
}
|
|
26118
26099
|
if (showHelp) {
|
|
26119
|
-
return /* @__PURE__ */
|
|
26120
|
-
}
|
|
26121
|
-
const renderBreakOverlay = (width) => {
|
|
26122
|
-
const highlightedCycle = slotCycles[cyclesCursor];
|
|
26123
|
-
return /* @__PURE__ */ jsxs44(Box42, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, width, children: [
|
|
26124
|
-
/* @__PURE__ */ jsx51(Text47, { bold: true, color: PALETTE.warning, children: `BREAK CYCLE ${cyclesCursor + 1} \u2014 remove a slot edge or reject a member` }),
|
|
26125
|
-
highlightedCycle && /* @__PURE__ */ jsx51(CyclePathLine, { segments: formatCyclePathSegments(highlightedCycle), prefix: " ", highlightComponents: true }),
|
|
26126
|
-
/* @__PURE__ */ jsx51(Text47, { dimColor: true, children: highlightedCycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
|
|
26127
|
-
/* @__PURE__ */ jsx51(Text47, { children: " " }),
|
|
26128
|
-
breakEdges.length > 0 && /* @__PURE__ */ jsx51(Text47, { dimColor: true, children: "remove slot edge:" }),
|
|
26129
|
-
breakEdges.map((edge, idx) => {
|
|
26130
|
-
const isCursor = idx === breakCursor;
|
|
26131
|
-
return /* @__PURE__ */ jsx51(Text47, { inverse: isCursor, children: `${isCursor ? figures7.pointer : " "} remove '${edge.toComponent}' from ${edge.fromComponent}.$slots.${edge.slotName}.$allowedComponents` }, `break-${idx}`);
|
|
26132
|
-
}),
|
|
26133
|
-
breakConfirm ? /* @__PURE__ */ jsxs44(Fragment18, { children: [
|
|
26134
|
-
/* @__PURE__ */ jsx51(Text47, { children: " " }),
|
|
26135
|
-
/* @__PURE__ */ jsx51(Text47, { bold: true, color: PALETTE.warning, children: "Delete this slot edge? [y] confirm [n] cancel" })
|
|
26136
|
-
] }) : /* @__PURE__ */ jsx51(Text47, { dimColor: true, children: "[\u2191\u2193/j/k] move [Enter] delete [x/Esc] close" })
|
|
26137
|
-
] });
|
|
26138
|
-
};
|
|
26139
|
-
const breakOverlayFullScreen = breakPanel.isOpen && shouldBreakOverlayGoFullScreen({
|
|
26140
|
-
rows: stdout?.rows ?? FALLBACK_ROWS,
|
|
26141
|
-
edgeCount: breakEdges.length
|
|
26142
|
-
});
|
|
26143
|
-
if (breakOverlayFullScreen) {
|
|
26144
|
-
return renderBreakOverlay();
|
|
26100
|
+
return /* @__PURE__ */ jsx49(HelpOverlay, { sections: HELP_SECTIONS2, handleInput: false, onClose: () => setShowHelp(false) });
|
|
26145
26101
|
}
|
|
26146
26102
|
const { selected, selectedJson, visibleJsonPanelValue } = getReviewSelectionState(
|
|
26147
26103
|
components,
|
|
@@ -26163,9 +26119,13 @@ function GenerateReviewStepView({
|
|
|
26163
26119
|
const groupOverhead = 12;
|
|
26164
26120
|
return Math.max(m, c2.key.length + Math.max(suffixLen, groupOverhead));
|
|
26165
26121
|
}, 0);
|
|
26166
|
-
const
|
|
26122
|
+
const minimumPanelWidth = Math.min(24, Math.max(10, terminalWidth - 16));
|
|
26123
|
+
const sidebarWidthCap = Math.min(
|
|
26124
|
+
computeSidebarWidth(terminalWidth),
|
|
26125
|
+
Math.max(10, terminalWidth - minimumPanelWidth - 4)
|
|
26126
|
+
);
|
|
26167
26127
|
const sidebarWidth = Math.min(Math.max(longestName + 9, 18), sidebarWidthCap);
|
|
26168
|
-
const panelWidth = Math.max(
|
|
26128
|
+
const panelWidth = Math.max(minimumPanelWidth, terminalWidth - sidebarWidth - 4);
|
|
26169
26129
|
const projectSlotGraph = components.map((c2) => ({
|
|
26170
26130
|
name: c2.key,
|
|
26171
26131
|
slots: Object.entries(c2.entry.$slots ?? {}).map(([slotName, slotDef]) => ({
|
|
@@ -26177,8 +26137,8 @@ function GenerateReviewStepView({
|
|
|
26177
26137
|
for (const c2 of closures.values()) if (c2.nodes.length > 1) return true;
|
|
26178
26138
|
return false;
|
|
26179
26139
|
})();
|
|
26180
|
-
return /* @__PURE__ */
|
|
26181
|
-
/* @__PURE__ */
|
|
26140
|
+
return /* @__PURE__ */ jsxs42(Box41, { flexDirection: "column", children: [
|
|
26141
|
+
/* @__PURE__ */ jsx49(
|
|
26182
26142
|
ReviewStepDialogs,
|
|
26183
26143
|
{
|
|
26184
26144
|
surfaceState: reviewSurface,
|
|
@@ -26188,24 +26148,16 @@ function GenerateReviewStepView({
|
|
|
26188
26148
|
onQuit
|
|
26189
26149
|
}
|
|
26190
26150
|
),
|
|
26191
|
-
|
|
26192
|
-
|
|
26193
|
-
/* @__PURE__ */
|
|
26194
|
-
/* @__PURE__ */
|
|
26195
|
-
|
|
26196
|
-
|
|
26197
|
-
/* @__PURE__ */ jsx51(Text47, { children: " [Tab] Stay in the panel" })
|
|
26198
|
-
] }),
|
|
26199
|
-
/* @__PURE__ */ jsx51(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
26200
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs44(Box42, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
26201
|
-
/* @__PURE__ */ jsx51(Text47, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
|
|
26202
|
-
!removedBannerCollapsed && /* @__PURE__ */ jsxs44(Fragment18, { children: [
|
|
26203
|
-
/* @__PURE__ */ jsx51(Text47, { children: " " }),
|
|
26204
|
-
removedComponents.map((rc) => /* @__PURE__ */ jsx51(Text47, { children: removedComponentLine(rc) }, rc.id))
|
|
26151
|
+
/* @__PURE__ */ jsx49(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
26152
|
+
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs42(Box41, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
26153
|
+
/* @__PURE__ */ jsx49(Text45, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
|
|
26154
|
+
!removedBannerCollapsed && /* @__PURE__ */ jsxs42(Fragment18, { children: [
|
|
26155
|
+
/* @__PURE__ */ jsx49(Text45, { children: " " }),
|
|
26156
|
+
removedComponents.map((rc) => /* @__PURE__ */ jsx49(Text45, { children: removedComponentLine(rc) }, rc.id))
|
|
26205
26157
|
] })
|
|
26206
26158
|
] }),
|
|
26207
|
-
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */
|
|
26208
|
-
|
|
26159
|
+
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx49(Box41, { paddingX: 1, children: /* @__PURE__ */ jsx49(
|
|
26160
|
+
Text45,
|
|
26209
26161
|
{
|
|
26210
26162
|
color: PALETTE.warning,
|
|
26211
26163
|
children: `[b] ${breakingChanges.length} breaking change${breakingChanges.length === 1 ? "" : "s"}`
|
|
@@ -26215,58 +26167,14 @@ function GenerateReviewStepView({
|
|
|
26215
26167
|
const row = breakingRows[breakingCursor];
|
|
26216
26168
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
26217
26169
|
if (!comp) return null;
|
|
26218
|
-
return /* @__PURE__ */
|
|
26219
|
-
/* @__PURE__ */
|
|
26220
|
-
comp.impact && /* @__PURE__ */
|
|
26221
|
-
comp.changes.length === 0 ? /* @__PURE__ */
|
|
26222
|
-
/* @__PURE__ */
|
|
26170
|
+
return /* @__PURE__ */ jsxs42(Box41, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
26171
|
+
/* @__PURE__ */ jsx49(Text45, { bold: true, color: PALETTE.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
|
|
26172
|
+
comp.impact && /* @__PURE__ */ jsx49(Text45, { dimColor: true, children: ` affects ${comp.impact.affectedExperiences} experience${comp.impact.affectedExperiences === 1 ? "" : "s"}, ${comp.impact.affectedFragments} fragment${comp.impact.affectedFragments === 1 ? "" : "s"}` }),
|
|
26173
|
+
comp.changes.length === 0 ? /* @__PURE__ */ jsx49(Text45, { dimColor: true, children: " (no enumerated changes)" }) : comp.changes.map((change, ci) => /* @__PURE__ */ jsx49(Text45, { children: ` \u2022 ${formatBreakingChange(change, comp.current)}` }, `bd-detail-${ci}`)),
|
|
26174
|
+
/* @__PURE__ */ jsx49(Text45, { dimColor: true, children: "[D/Esc] close detail" })
|
|
26223
26175
|
] });
|
|
26224
26176
|
})(),
|
|
26225
|
-
|
|
26226
|
-
const PANEL_H = 20;
|
|
26227
|
-
const lines = [];
|
|
26228
|
-
lines.push(
|
|
26229
|
-
/* @__PURE__ */ jsx51(Text47, { bold: true, color: PALETTE.warning, children: `SLOT DEPENDENCY CYCLES (${slotCycles.length})` }, "cyc-title")
|
|
26230
|
-
);
|
|
26231
|
-
lines.push(
|
|
26232
|
-
/* @__PURE__ */ jsx51(Text47, { dimColor: true, children: "push will fail until these are resolved" }, "cyc-sub")
|
|
26233
|
-
);
|
|
26234
|
-
lines.push(
|
|
26235
|
-
/* @__PURE__ */ jsx51(Text47, { dimColor: true, children: "To fix: reject a cycle member, or break the cycle by removing a slot edge." }, "cyc-guide")
|
|
26236
|
-
);
|
|
26237
|
-
lines.push(/* @__PURE__ */ jsx51(Text47, { children: " " }, "cyc-space"));
|
|
26238
|
-
slotCycles.forEach((cycle, idx) => {
|
|
26239
|
-
const nodeCount = new Set(cycle.path).size;
|
|
26240
|
-
const isCursor = idx === cyclesCursor;
|
|
26241
|
-
lines.push(
|
|
26242
|
-
/* @__PURE__ */ jsx51(
|
|
26243
|
-
Text47,
|
|
26244
|
-
{
|
|
26245
|
-
bold: true,
|
|
26246
|
-
inverse: isCursor,
|
|
26247
|
-
children: `${isCursor ? figures7.pointer : " "} Cycle ${idx + 1} (${nodeCount} component${nodeCount === 1 ? "" : "s"}):`
|
|
26248
|
-
},
|
|
26249
|
-
`cyc-h-${idx}`
|
|
26250
|
-
)
|
|
26251
|
-
);
|
|
26252
|
-
lines.push(
|
|
26253
|
-
/* @__PURE__ */ jsx51(CyclePathLine, { segments: formatCyclePathSegments(cycle, 16), prefix: " " }, `cyc-p-${idx}`)
|
|
26254
|
-
);
|
|
26255
|
-
if (cycle.suggestedBreak) {
|
|
26256
|
-
const b = cycle.suggestedBreak;
|
|
26257
|
-
lines.push(
|
|
26258
|
-
/* @__PURE__ */ jsx51(Text47, { dimColor: true, children: ` Suggested fix: remove '${b.toComponent}' from ${b.fromComponent}.$slots.${b.slotName}.$allowedComponents` }, `cyc-f-${idx}`)
|
|
26259
|
-
);
|
|
26260
|
-
}
|
|
26261
|
-
lines.push(/* @__PURE__ */ jsx51(Text47, { children: " " }, `cyc-s-${idx}`));
|
|
26262
|
-
});
|
|
26263
|
-
const visible = lines.slice(cyclePanelScroll, cyclePanelScroll + PANEL_H);
|
|
26264
|
-
return /* @__PURE__ */ jsxs44(Box42, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
26265
|
-
visible,
|
|
26266
|
-
/* @__PURE__ */ jsx51(Text47, { dimColor: true, children: "[\u2191\u2193/j/k] move [Enter] jump [x] break cycle [c/q/Esc] close" })
|
|
26267
|
-
] });
|
|
26268
|
-
})(),
|
|
26269
|
-
!dialogOpen && /* @__PURE__ */ jsx51(
|
|
26177
|
+
!dialogOpen && /* @__PURE__ */ jsx49(
|
|
26270
26178
|
LivePreviewSummary,
|
|
26271
26179
|
{
|
|
26272
26180
|
enabled: livePreview,
|
|
@@ -26285,20 +26193,41 @@ function GenerateReviewStepView({
|
|
|
26285
26193
|
const participantSet = cycleView.structural;
|
|
26286
26194
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
26287
26195
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
26288
|
-
return /* @__PURE__ */
|
|
26289
|
-
/* @__PURE__ */
|
|
26290
|
-
members.length > 0 && /* @__PURE__ */
|
|
26291
|
-
ancestors.length > 0 && /* @__PURE__ */
|
|
26292
|
-
/* @__PURE__ */
|
|
26196
|
+
return /* @__PURE__ */ jsxs42(Box41, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
26197
|
+
/* @__PURE__ */ jsx49(Text45, { color: PALETTE.error, bold: true, children: `Cyclic component graph \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
|
|
26198
|
+
members.length > 0 && /* @__PURE__ */ jsx49(Text45, { color: PALETTE.error, children: ` Cycle members: ${members.join(", ")}` }),
|
|
26199
|
+
ancestors.length > 0 && /* @__PURE__ */ jsx49(Text45, { color: PALETTE.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
|
|
26200
|
+
/* @__PURE__ */ jsx49(Text45, { dimColor: true, children: undoSnapshot ? " [Ctrl+Z] undo \xB7 [r]/[a] manually toggle \xB7 [F] continue" : " [r]/[a] manually toggle \xB7 [F] continue" })
|
|
26293
26201
|
] });
|
|
26294
26202
|
})(),
|
|
26295
|
-
/* @__PURE__ */
|
|
26296
|
-
/* @__PURE__ */
|
|
26297
|
-
!dialogOpen && /* @__PURE__ */
|
|
26298
|
-
|
|
26203
|
+
/* @__PURE__ */ jsx49(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
|
|
26204
|
+
/* @__PURE__ */ jsx49(ReviewFinalizeError, { message: finalizeError, hidden: dialogOpen }),
|
|
26205
|
+
!dialogOpen && breakPanel.isOpen && /* @__PURE__ */ jsx49(
|
|
26206
|
+
BreakCyclePanel,
|
|
26207
|
+
{
|
|
26208
|
+
cycle: cycleRows[cyclesCursor],
|
|
26209
|
+
edges: breakEdges,
|
|
26210
|
+
cursor: breakCursor,
|
|
26211
|
+
confirming: breakConfirm,
|
|
26212
|
+
width: Math.max(20, terminalWidth - 2),
|
|
26213
|
+
height: panelHeight
|
|
26214
|
+
}
|
|
26215
|
+
),
|
|
26216
|
+
!dialogOpen && cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsx49(
|
|
26217
|
+
CycleDetailPanel,
|
|
26218
|
+
{
|
|
26219
|
+
cycles: cycleRows,
|
|
26220
|
+
cursor: cyclesCursor,
|
|
26221
|
+
scrollOffset: cyclePanelScroll,
|
|
26222
|
+
width: Math.max(20, terminalWidth - 2),
|
|
26223
|
+
height: panelHeight
|
|
26224
|
+
}
|
|
26225
|
+
),
|
|
26226
|
+
!dialogOpen && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs42(Box41, { children: [
|
|
26227
|
+
breakingPanel.isOpen ? /* @__PURE__ */ jsx49(
|
|
26299
26228
|
GotoBanner,
|
|
26300
26229
|
{
|
|
26301
|
-
title:
|
|
26230
|
+
title: `Breaking changes \u2014 ${breakingRows[breakingCursor]?.componentName ?? "unknown component"}`,
|
|
26302
26231
|
rows: breakingRows.map((r) => ({
|
|
26303
26232
|
label: r.label,
|
|
26304
26233
|
jumpTarget: r.componentName
|
|
@@ -26308,17 +26237,7 @@ function GenerateReviewStepView({
|
|
|
26308
26237
|
width: sidebarWidth,
|
|
26309
26238
|
footerHint: "[\u2191/\u2193] move \xB7 [Enter] jump \xB7 [D] detail \xB7 [Esc] close"
|
|
26310
26239
|
}
|
|
26311
|
-
) :
|
|
26312
|
-
LineagePanel,
|
|
26313
|
-
{
|
|
26314
|
-
focusedComponentKey,
|
|
26315
|
-
entries: lineageEntries,
|
|
26316
|
-
cursor: lineageCursor,
|
|
26317
|
-
jumpables: lineageJumpables,
|
|
26318
|
-
maxRows: panelMaxRows,
|
|
26319
|
-
width: sidebarWidth
|
|
26320
|
-
}
|
|
26321
|
-
) : /* @__PURE__ */ jsx51(
|
|
26240
|
+
) : /* @__PURE__ */ jsx49(
|
|
26322
26241
|
GroupedSidebar,
|
|
26323
26242
|
{
|
|
26324
26243
|
items: groupedItems,
|
|
@@ -26344,6 +26263,8 @@ function GenerateReviewStepView({
|
|
|
26344
26263
|
});
|
|
26345
26264
|
},
|
|
26346
26265
|
width: sidebarWidth,
|
|
26266
|
+
height: leftPanelHeight,
|
|
26267
|
+
wrapLabels: true,
|
|
26347
26268
|
focused: sidebarFocused,
|
|
26348
26269
|
renderStatusByKey,
|
|
26349
26270
|
previewAnnotationByKey,
|
|
@@ -26356,7 +26277,7 @@ function GenerateReviewStepView({
|
|
|
26356
26277
|
graph: sidebarGraph
|
|
26357
26278
|
}
|
|
26358
26279
|
),
|
|
26359
|
-
selected ? /* @__PURE__ */
|
|
26280
|
+
selected ? /* @__PURE__ */ jsx49(
|
|
26360
26281
|
ReviewComponentPanel,
|
|
26361
26282
|
{
|
|
26362
26283
|
selectedKey: selected.key,
|
|
@@ -26365,31 +26286,36 @@ function GenerateReviewStepView({
|
|
|
26365
26286
|
reviewMetadata,
|
|
26366
26287
|
reviewEditor,
|
|
26367
26288
|
width: panelWidth,
|
|
26368
|
-
height:
|
|
26289
|
+
height: panelHeight,
|
|
26369
26290
|
jsonValue: visibleJsonPanelValue,
|
|
26370
26291
|
sidebarFocused,
|
|
26371
|
-
fieldEditor: buildReviewFieldEditor(
|
|
26372
|
-
|
|
26373
|
-
|
|
26374
|
-
|
|
26375
|
-
|
|
26376
|
-
|
|
26377
|
-
|
|
26378
|
-
|
|
26379
|
-
|
|
26380
|
-
|
|
26292
|
+
fieldEditor: buildReviewFieldEditor(
|
|
26293
|
+
reviewEditor,
|
|
26294
|
+
selectedJson,
|
|
26295
|
+
() => {
|
|
26296
|
+
reviewEditor.handleEditSave();
|
|
26297
|
+
setSidebarFocused(true);
|
|
26298
|
+
},
|
|
26299
|
+
{
|
|
26300
|
+
key: pendingEditorFocus && pendingEditorFocus.componentName === selected.key ? `${selected.key}::${pendingEditorFocus.target.kind}:${pendingEditorFocus.target.name}` : selected.key,
|
|
26301
|
+
propRationaleKey: "p",
|
|
26302
|
+
componentRationaleKey: "P",
|
|
26303
|
+
projectSlotGraph,
|
|
26304
|
+
currentComponentName: selected.key,
|
|
26305
|
+
initialFocusTarget: pendingEditorFocus && pendingEditorFocus.componentName === selected.key ? pendingEditorFocus.target : { kind: "description" }
|
|
26306
|
+
}
|
|
26307
|
+
),
|
|
26381
26308
|
saveError: reviewEditor.saveError,
|
|
26382
26309
|
sidebarFooter: hasGroupRoots ? " [Space] expand/collapse group [E/C] expand/collapse all" : "",
|
|
26383
26310
|
livePreview: livePreviewHook,
|
|
26384
26311
|
livePreviewSpinner
|
|
26385
26312
|
}
|
|
26386
|
-
) : /* @__PURE__ */
|
|
26313
|
+
) : /* @__PURE__ */ jsx49(ReviewNoSelection, {})
|
|
26387
26314
|
] }),
|
|
26388
|
-
|
|
26389
|
-
|
|
26390
|
-
|
|
26391
|
-
|
|
26392
|
-
return /* @__PURE__ */ jsx51(
|
|
26315
|
+
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs42(Box41, { flexDirection: "column", children: [
|
|
26316
|
+
/* @__PURE__ */ jsx49(Text45, { color: PALETTE.warning, children: `\u26A0 ${cycleRows.length} slot dependency cycle${cycleRows.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
26317
|
+
cycleRows.slice(0, 3).map((cycle, idx) => {
|
|
26318
|
+
return /* @__PURE__ */ jsx49(
|
|
26393
26319
|
CyclePathLine,
|
|
26394
26320
|
{
|
|
26395
26321
|
segments: formatCyclePathSegments(cycle),
|
|
@@ -26400,10 +26326,10 @@ function GenerateReviewStepView({
|
|
|
26400
26326
|
`cyc-banner-${idx}`
|
|
26401
26327
|
);
|
|
26402
26328
|
}),
|
|
26403
|
-
|
|
26404
|
-
/* @__PURE__ */
|
|
26329
|
+
cycleRows.length > 3 && /* @__PURE__ */ jsx49(Text45, { color: PALETTE.warning, children: ` \u2026${cycleRows.length - 3} more` }),
|
|
26330
|
+
/* @__PURE__ */ jsx49(Text45, { dimColor: true, children: " press [c] for detail" })
|
|
26405
26331
|
] }),
|
|
26406
|
-
/* @__PURE__ */
|
|
26332
|
+
/* @__PURE__ */ jsx49(
|
|
26407
26333
|
SearchMatchSummary,
|
|
26408
26334
|
{
|
|
26409
26335
|
open: searchOpen,
|
|
@@ -26414,55 +26340,18 @@ function GenerateReviewStepView({
|
|
|
26414
26340
|
hidden: dialogOpen
|
|
26415
26341
|
}
|
|
26416
26342
|
),
|
|
26417
|
-
!dialogOpen && sidebarFocused && /* @__PURE__ */
|
|
26418
|
-
|
|
26419
|
-
legendEntry("[Enter]", "edit allowed"),
|
|
26420
|
-
legendEntry("[Esc]", "close")
|
|
26421
|
-
] }) : /* @__PURE__ */ jsxs44(Fragment18, { children: [
|
|
26422
|
-
legendEntry("[j/k]", "move"),
|
|
26423
|
-
legendEntry("[a]", "accept"),
|
|
26424
|
-
legendEntry("[r]", "reject"),
|
|
26425
|
-
legendEntry("[A]", "accept all"),
|
|
26426
|
-
legendEntry("[F]", "finalize"),
|
|
26427
|
-
legendEntry("[L]", "flat", columnOneView === "flat"),
|
|
26428
|
-
legendEntry("[l]", "lineage", lineagePanel.isOpen),
|
|
26429
|
-
legendEntry("[i]", "focus lineage", jumpFilterTarget !== null),
|
|
26430
|
-
legendEntry("[w]", "only breaking", activeFilters.has("broken")),
|
|
26431
|
-
slotCycles.length > 0 && legendEntry("[o]", "only cycles", activeFilters.has("cycles")),
|
|
26432
|
-
slotCycles.length > 0 && legendEntry("[c]", "cycle list", cyclePanel.isOpen),
|
|
26433
|
-
legendEntry("[p]", "prop rationale", reviewEditor.panelOpen === "prop-rationale"),
|
|
26434
|
-
legendEntry("[P]", "component rationale", reviewEditor.panelOpen === "component-rationale"),
|
|
26435
|
-
legendEntry("[s]", "source", reviewEditor.panelOpen === "source"),
|
|
26436
|
-
reviewEditor.currentTokenSuggestions().length > 0 && legendEntry("[t]", "token review"),
|
|
26437
|
-
legendEntry("[J]", reviewEditor.showJson ? "hide JSON" : "show JSON", reviewEditor.showJson),
|
|
26438
|
-
legendEntry(
|
|
26439
|
-
"[H]",
|
|
26440
|
-
reviewEditor.showHiddenProps ? "hide state/unattached" : "show state/unattached",
|
|
26441
|
-
reviewEditor.showHiddenProps
|
|
26442
|
-
),
|
|
26443
|
-
breakingChanges.length > 0 && legendEntry("[b]", "see breaking changes", breakingPanel.isOpen),
|
|
26444
|
-
removedComponents.length > 0 && legendEntry("[d]", removedBannerCollapsed ? "show removed" : "hide removed", !removedBannerCollapsed),
|
|
26445
|
-
legendEntry("[/]", "search", searchOpen || searchQuery.length > 0),
|
|
26446
|
-
legendEntry("[Tab]", "focus panel"),
|
|
26447
|
-
legendEntry("[Ctrl+Z]", "undo"),
|
|
26448
|
-
legendEntry("[Ctrl+Y]", "redo"),
|
|
26449
|
-
legendEntry("[Ctrl+R]", "reload"),
|
|
26450
|
-
legendEntry("[?]", "help"),
|
|
26451
|
-
legendEntry("[q]", "quit")
|
|
26452
|
-
] }) }),
|
|
26453
|
-
!dialogOpen && /* @__PURE__ */ jsx51(
|
|
26454
|
-
ReviewStatusBar,
|
|
26343
|
+
!dialogOpen && sidebarFocused && /* @__PURE__ */ jsx49(
|
|
26344
|
+
CompactControlBar,
|
|
26455
26345
|
{
|
|
26456
|
-
|
|
26457
|
-
|
|
26458
|
-
|
|
26459
|
-
|
|
26460
|
-
onFinalize: () => setShowFinalize(true)
|
|
26346
|
+
hasGroupRoots,
|
|
26347
|
+
searchActive: searchOpen || searchQuery.length > 0,
|
|
26348
|
+
showJson: reviewEditor.showJson,
|
|
26349
|
+
tokenReviewAvailable: reviewEditor.currentTokenSuggestions().length > 0
|
|
26461
26350
|
}
|
|
26462
26351
|
)
|
|
26463
26352
|
] });
|
|
26464
26353
|
}
|
|
26465
|
-
var
|
|
26354
|
+
var HELP_SECTIONS2;
|
|
26466
26355
|
var init_GenerateReviewStep = __esm({
|
|
26467
26356
|
"packages/experience-design-system-cli/src/import/tui/steps/GenerateReviewStep.tsx"() {
|
|
26468
26357
|
"use strict";
|
|
@@ -26481,15 +26370,14 @@ var init_GenerateReviewStep = __esm({
|
|
|
26481
26370
|
init_fuzzy_search();
|
|
26482
26371
|
init_search_neighborhood();
|
|
26483
26372
|
init_sidebar_width();
|
|
26373
|
+
init_use_terminal_size();
|
|
26484
26374
|
init_selection_cascade();
|
|
26485
|
-
init_useLineage();
|
|
26486
26375
|
init_cycle_auto_reject();
|
|
26487
26376
|
init_useOverlayPanel();
|
|
26488
|
-
init_LineagePanel();
|
|
26489
26377
|
init_GotoBanner();
|
|
26490
26378
|
init_lineage_layout();
|
|
26491
26379
|
init_HelpOverlay();
|
|
26492
|
-
|
|
26380
|
+
init_CompactControlBar();
|
|
26493
26381
|
init_auto_reject_decision();
|
|
26494
26382
|
init_breaking_change_format();
|
|
26495
26383
|
init_enumerate_cycle_breaks();
|
|
@@ -26498,9 +26386,9 @@ var init_GenerateReviewStep = __esm({
|
|
|
26498
26386
|
init_sidebar_help();
|
|
26499
26387
|
init_sidebar_input();
|
|
26500
26388
|
init_sidebar_navigation();
|
|
26501
|
-
init_lineage_input();
|
|
26502
26389
|
init_sidebar_search_state();
|
|
26503
26390
|
init_SearchMatchSummary();
|
|
26391
|
+
init_windowed_panel();
|
|
26504
26392
|
init_ReviewComponentPanel();
|
|
26505
26393
|
init_ReviewStatus();
|
|
26506
26394
|
init_useReviewSession();
|
|
@@ -26511,7 +26399,6 @@ var init_GenerateReviewStep = __esm({
|
|
|
26511
26399
|
init_useReviewPreview();
|
|
26512
26400
|
init_LivePreviewSummary();
|
|
26513
26401
|
init_cycle_auto_reject();
|
|
26514
|
-
PANEL_HEIGHT = 22;
|
|
26515
26402
|
HELP_SECTIONS2 = [
|
|
26516
26403
|
{
|
|
26517
26404
|
title: "Navigation",
|
|
@@ -26535,19 +26422,14 @@ var init_GenerateReviewStep = __esm({
|
|
|
26535
26422
|
title: "Panels",
|
|
26536
26423
|
entries: [
|
|
26537
26424
|
{ keys: "c", label: "Cycle list" },
|
|
26425
|
+
{ keys: "b", label: "Breaking changes" },
|
|
26426
|
+
{ keys: "w", label: "Only breaking" },
|
|
26427
|
+
{ keys: "o", label: "Only cycles" },
|
|
26538
26428
|
{ keys: "p", label: "Prop rationale" },
|
|
26539
26429
|
{ keys: "P", label: "Component rationale" },
|
|
26540
26430
|
{ keys: "s", label: "Source" },
|
|
26541
|
-
{ keys: "J", label: "Toggle JSON" }
|
|
26542
|
-
|
|
26543
|
-
},
|
|
26544
|
-
{
|
|
26545
|
-
title: "Resolving cycles",
|
|
26546
|
-
entries: [
|
|
26547
|
-
{ keys: "r", label: "Reject a cycle member (drops it from the push), or" },
|
|
26548
|
-
{ keys: "", label: "break the cycle by removing a slot's" },
|
|
26549
|
-
{ keys: "", label: "$allowedComponents edge (see [c] suggested fix)." },
|
|
26550
|
-
{ keys: "x", label: "Break cycle (from [c]): delete a slot edge." }
|
|
26431
|
+
{ keys: "J", label: "Toggle JSON" },
|
|
26432
|
+
{ keys: "t", label: "Token review" }
|
|
26551
26433
|
]
|
|
26552
26434
|
},
|
|
26553
26435
|
{
|
|
@@ -26562,10 +26444,17 @@ var init_GenerateReviewStep = __esm({
|
|
|
26562
26444
|
{ keys: "Ctrl+R", label: "Reload from save" }
|
|
26563
26445
|
]
|
|
26564
26446
|
},
|
|
26447
|
+
{
|
|
26448
|
+
title: "Review",
|
|
26449
|
+
entries: [
|
|
26450
|
+
{ keys: "Tab", label: "Focus panel" },
|
|
26451
|
+
{ keys: "Enter", label: "Edit selected field" }
|
|
26452
|
+
]
|
|
26453
|
+
},
|
|
26565
26454
|
{
|
|
26566
26455
|
title: "General",
|
|
26567
26456
|
entries: [
|
|
26568
|
-
{ keys: "
|
|
26457
|
+
{ keys: "h", label: "Close help" },
|
|
26569
26458
|
{ keys: "q", label: "Quit" }
|
|
26570
26459
|
]
|
|
26571
26460
|
}
|
|
@@ -26826,8 +26715,8 @@ __export(WizardApp_exports, {
|
|
|
26826
26715
|
parsePrintTokensCount: () => parsePrintTokensCount,
|
|
26827
26716
|
shouldRunMapTokens: () => shouldRunMapTokens
|
|
26828
26717
|
});
|
|
26829
|
-
import { useEffect as
|
|
26830
|
-
import { Box as
|
|
26718
|
+
import { useEffect as useEffect15, useRef as useRef10, useState as useState23 } from "react";
|
|
26719
|
+
import { Box as Box42, Text as Text46 } from "ink";
|
|
26831
26720
|
import { join as join20, resolve as resolve17 } from "node:path";
|
|
26832
26721
|
import { appendFileSync as appendFileSync2, writeFileSync } from "node:fs";
|
|
26833
26722
|
import { access as access7, stat as stat5, writeFile as writeFile6 } from "node:fs/promises";
|
|
@@ -26835,7 +26724,7 @@ import { tmpdir } from "node:os";
|
|
|
26835
26724
|
import { execFile as execFile2, spawn as spawn3 } from "node:child_process";
|
|
26836
26725
|
import { mkdir as mkdir5 } from "node:fs/promises";
|
|
26837
26726
|
import { buildCDF as buildCDF3, validateCDF as validateCDF3, validateSlotReferences as validateSlotReferences2 } from "@contentful/experience-design-system-types";
|
|
26838
|
-
import { jsx as
|
|
26727
|
+
import { jsx as jsx50, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
26839
26728
|
function buildGenerateComponentsArgs(opts) {
|
|
26840
26729
|
const args = ["__generate", "components", "--agent", opts.agent, "--session", opts.sessionId];
|
|
26841
26730
|
if (opts.tokensPath) args.push("--tokens", opts.tokensPath);
|
|
@@ -27034,7 +26923,7 @@ function WizardApp({
|
|
|
27034
26923
|
finalizeErrorBanner: null,
|
|
27035
26924
|
finalReviewPassed: false
|
|
27036
26925
|
});
|
|
27037
|
-
|
|
26926
|
+
useEffect15(() => {
|
|
27038
26927
|
sessionRef.current = {
|
|
27039
26928
|
extractSessionId: state.extractSessionId,
|
|
27040
26929
|
tokensPath: state.tokensPath
|
|
@@ -27686,7 +27575,7 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
|
|
|
27686
27575
|
update({ credentialsValidating: false, credentialsBackgroundValidating: false, credentialsError: "" });
|
|
27687
27576
|
}
|
|
27688
27577
|
};
|
|
27689
|
-
|
|
27578
|
+
useEffect15(() => {
|
|
27690
27579
|
if (state.step !== "credentials" || state.credentialsSkipped) return;
|
|
27691
27580
|
if (!state.spaceId.trim() || !state.environmentId.trim() || !state.cmaToken.trim()) return;
|
|
27692
27581
|
const validationId = ++credentialsValidationIdRef.current;
|
|
@@ -28190,7 +28079,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28190
28079
|
}
|
|
28191
28080
|
};
|
|
28192
28081
|
const tokenReuseChecked = useRef10(false);
|
|
28193
|
-
|
|
28082
|
+
useEffect15(() => {
|
|
28194
28083
|
if (state.rawTokensPath) {
|
|
28195
28084
|
if (tokenReuseChecked.current) return;
|
|
28196
28085
|
tokenReuseChecked.current = true;
|
|
@@ -28241,7 +28130,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28241
28130
|
const stepContent = (() => {
|
|
28242
28131
|
switch (state.step) {
|
|
28243
28132
|
case "welcome":
|
|
28244
|
-
return /* @__PURE__ */
|
|
28133
|
+
return /* @__PURE__ */ jsx50(
|
|
28245
28134
|
WelcomeStep,
|
|
28246
28135
|
{
|
|
28247
28136
|
onContinue: (path) => {
|
|
@@ -28253,7 +28142,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28253
28142
|
}
|
|
28254
28143
|
);
|
|
28255
28144
|
case "token-input":
|
|
28256
|
-
return /* @__PURE__ */
|
|
28145
|
+
return /* @__PURE__ */ jsx50(
|
|
28257
28146
|
TokenInputStep,
|
|
28258
28147
|
{
|
|
28259
28148
|
onConfirm: (rawTokensPath) => {
|
|
@@ -28264,7 +28153,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28264
28153
|
}
|
|
28265
28154
|
);
|
|
28266
28155
|
case "token-reuse-gate":
|
|
28267
|
-
return /* @__PURE__ */
|
|
28156
|
+
return /* @__PURE__ */ jsx50(
|
|
28268
28157
|
GateStep,
|
|
28269
28158
|
{
|
|
28270
28159
|
successMessage: "Existing tokens.json found",
|
|
@@ -28292,7 +28181,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28292
28181
|
}
|
|
28293
28182
|
);
|
|
28294
28183
|
case "checking-claude-auth":
|
|
28295
|
-
return /* @__PURE__ */
|
|
28184
|
+
return /* @__PURE__ */ jsx50(
|
|
28296
28185
|
RunningStep,
|
|
28297
28186
|
{
|
|
28298
28187
|
stepNumber: state.authCheckStepNumber,
|
|
@@ -28302,7 +28191,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28302
28191
|
}
|
|
28303
28192
|
);
|
|
28304
28193
|
case "path-validation":
|
|
28305
|
-
return /* @__PURE__ */
|
|
28194
|
+
return /* @__PURE__ */ jsx50(
|
|
28306
28195
|
PathValidationStep,
|
|
28307
28196
|
{
|
|
28308
28197
|
projectPath: state.projectPath,
|
|
@@ -28335,7 +28224,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28335
28224
|
}
|
|
28336
28225
|
const selectionDetail = state.selectionAgentStatus === "complete" ? "Selection agent complete" : `Filtering component selection via ${state.agent}...`;
|
|
28337
28226
|
const compositionDetail = state.compositionPhase === "cache-hit" ? "Composition mapping (cached)" : compositionComplete ? "Composition mapping complete" : state.compositionPhase?.startsWith("agent:") ? `Mapping composition via ${state.compositionPhase.slice("agent:".length)}...` : `Mapping composition via ${state.agent}...`;
|
|
28338
|
-
return /* @__PURE__ */
|
|
28227
|
+
return /* @__PURE__ */ jsx50(
|
|
28339
28228
|
RunningStep,
|
|
28340
28229
|
{
|
|
28341
28230
|
stepNumber: hasTokenStage ? 2 : 1,
|
|
@@ -28357,7 +28246,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28357
28246
|
}
|
|
28358
28247
|
case "scope-gate": {
|
|
28359
28248
|
if (!state.extractSessionId) {
|
|
28360
|
-
return /* @__PURE__ */
|
|
28249
|
+
return /* @__PURE__ */ jsx50(Box42, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx50(Text46, { color: PALETTE.error, children: "Error: extract session ID missing \u2014 please re-run." }) });
|
|
28361
28250
|
}
|
|
28362
28251
|
const sessionId2 = state.extractSessionId;
|
|
28363
28252
|
const db = openPipelineDb();
|
|
@@ -28367,7 +28256,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28367
28256
|
} finally {
|
|
28368
28257
|
db.close();
|
|
28369
28258
|
}
|
|
28370
|
-
return /* @__PURE__ */
|
|
28259
|
+
return /* @__PURE__ */ jsx50(
|
|
28371
28260
|
ScopeGateStep,
|
|
28372
28261
|
{
|
|
28373
28262
|
components,
|
|
@@ -28408,7 +28297,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28408
28297
|
const displayAgent = state.agent.charAt(0).toUpperCase() + state.agent.slice(1);
|
|
28409
28298
|
const progressDetail = p ? `[${p.done}/${p.total}] ${p.current}` : `Starting up ${displayAgent}...`;
|
|
28410
28299
|
const mapTokensDetail = state.mapTokensStatus === "running" ? skipMapTokens ? "Resolving token defaults..." : `Mapping token restrictions via ${displayAgent}...` : state.mapTokensStatus === "complete" ? skipMapTokens ? "Token defaults ready" : "Token restrictions ready" : void 0;
|
|
28411
|
-
return /* @__PURE__ */
|
|
28300
|
+
return /* @__PURE__ */ jsx50(
|
|
28412
28301
|
RunningStep,
|
|
28413
28302
|
{
|
|
28414
28303
|
stepNumber: stepNum,
|
|
@@ -28423,7 +28312,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28423
28312
|
}
|
|
28424
28313
|
case "mapping-tokens": {
|
|
28425
28314
|
const stepNum = hasTokenStage ? 5 : 4;
|
|
28426
|
-
return /* @__PURE__ */
|
|
28315
|
+
return /* @__PURE__ */ jsx50(
|
|
28427
28316
|
RunningStep,
|
|
28428
28317
|
{
|
|
28429
28318
|
stepNumber: stepNum,
|
|
@@ -28435,7 +28324,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28435
28324
|
);
|
|
28436
28325
|
}
|
|
28437
28326
|
case "final-review": {
|
|
28438
|
-
return /* @__PURE__ */
|
|
28327
|
+
return /* @__PURE__ */ jsx50(
|
|
28439
28328
|
GenerateReviewStep,
|
|
28440
28329
|
{
|
|
28441
28330
|
extractSessionId: state.extractSessionId,
|
|
@@ -28491,7 +28380,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28491
28380
|
);
|
|
28492
28381
|
}
|
|
28493
28382
|
case "credentials":
|
|
28494
|
-
return /* @__PURE__ */
|
|
28383
|
+
return /* @__PURE__ */ jsx50(
|
|
28495
28384
|
CredentialsStep,
|
|
28496
28385
|
{
|
|
28497
28386
|
initialSpaceId: state.spaceId,
|
|
@@ -28526,7 +28415,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28526
28415
|
}
|
|
28527
28416
|
);
|
|
28528
28417
|
case "previewing":
|
|
28529
|
-
return /* @__PURE__ */
|
|
28418
|
+
return /* @__PURE__ */ jsx50(
|
|
28530
28419
|
RunningStep,
|
|
28531
28420
|
{
|
|
28532
28421
|
stepNumber: totalSteps,
|
|
@@ -28537,7 +28426,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28537
28426
|
);
|
|
28538
28427
|
case "preview-gate": {
|
|
28539
28428
|
const editableComponentCount = extractComponents(state.cdf).length;
|
|
28540
|
-
return /* @__PURE__ */
|
|
28429
|
+
return /* @__PURE__ */ jsx50(
|
|
28541
28430
|
WizardPreviewStep,
|
|
28542
28431
|
{
|
|
28543
28432
|
preview: state.serverPreview,
|
|
@@ -28562,9 +28451,9 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28562
28451
|
);
|
|
28563
28452
|
}
|
|
28564
28453
|
case "pushing":
|
|
28565
|
-
return /* @__PURE__ */
|
|
28454
|
+
return /* @__PURE__ */ jsx50(PushingStep, { stepNumber: totalSteps, totalSteps, progress: state.pushProgress });
|
|
28566
28455
|
case "path-prompt":
|
|
28567
|
-
return /* @__PURE__ */
|
|
28456
|
+
return /* @__PURE__ */ jsx50(
|
|
28568
28457
|
PathPrompt,
|
|
28569
28458
|
{
|
|
28570
28459
|
defaultPath: state.outDir,
|
|
@@ -28585,7 +28474,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28585
28474
|
}
|
|
28586
28475
|
);
|
|
28587
28476
|
case "printing":
|
|
28588
|
-
return /* @__PURE__ */
|
|
28477
|
+
return /* @__PURE__ */ jsx50(
|
|
28589
28478
|
RunningStep,
|
|
28590
28479
|
{
|
|
28591
28480
|
stepNumber: totalSteps,
|
|
@@ -28596,7 +28485,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28596
28485
|
);
|
|
28597
28486
|
case "print-gate": {
|
|
28598
28487
|
const teaser = buildRunTeaserLine(state.lastRunId);
|
|
28599
|
-
return /* @__PURE__ */
|
|
28488
|
+
return /* @__PURE__ */ jsx50(
|
|
28600
28489
|
GateStep,
|
|
28601
28490
|
{
|
|
28602
28491
|
successMessage: "Files saved",
|
|
@@ -28614,7 +28503,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28614
28503
|
case "done": {
|
|
28615
28504
|
const totalFailed = state.pushResult.componentTypes.failed + state.pushResult.designTokens.failed;
|
|
28616
28505
|
const teaser = buildRunTeaserLine(state.lastRunId);
|
|
28617
|
-
return /* @__PURE__ */
|
|
28506
|
+
return /* @__PURE__ */ jsx50(
|
|
28618
28507
|
DoneStep,
|
|
28619
28508
|
{
|
|
28620
28509
|
componentTypes: state.pushResult.componentTypes,
|
|
@@ -28630,7 +28519,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28630
28519
|
);
|
|
28631
28520
|
}
|
|
28632
28521
|
case "preview-validation-error": {
|
|
28633
|
-
return /* @__PURE__ */
|
|
28522
|
+
return /* @__PURE__ */ jsx50(
|
|
28634
28523
|
PreviewValidationErrorStep,
|
|
28635
28524
|
{
|
|
28636
28525
|
errors: state.previewValidationErrors,
|
|
@@ -28646,7 +28535,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28646
28535
|
);
|
|
28647
28536
|
}
|
|
28648
28537
|
case "error":
|
|
28649
|
-
return /* @__PURE__ */
|
|
28538
|
+
return /* @__PURE__ */ jsx50(
|
|
28650
28539
|
ErrorStep,
|
|
28651
28540
|
{
|
|
28652
28541
|
stepName: state.errorStep,
|
|
@@ -28668,9 +28557,9 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28668
28557
|
return null;
|
|
28669
28558
|
}
|
|
28670
28559
|
})();
|
|
28671
|
-
return /* @__PURE__ */
|
|
28672
|
-
/* @__PURE__ */
|
|
28673
|
-
/* @__PURE__ */
|
|
28560
|
+
return /* @__PURE__ */ jsxs43(Box42, { flexDirection: "column", width: terminalWidth, children: [
|
|
28561
|
+
/* @__PURE__ */ jsx50(TopBar, { subcommand: "import", hints }),
|
|
28562
|
+
/* @__PURE__ */ jsx50(CustomPromptBanner, { generatePromptPath }),
|
|
28674
28563
|
stepContent
|
|
28675
28564
|
] });
|
|
28676
28565
|
}
|
|
@@ -29184,8 +29073,8 @@ var init_command7 = __esm({
|
|
|
29184
29073
|
|
|
29185
29074
|
// packages/experience-design-system-cli/src/setup/SetupStepper.tsx
|
|
29186
29075
|
import React17 from "react";
|
|
29187
|
-
import { Box as
|
|
29188
|
-
import { jsx as
|
|
29076
|
+
import { Box as Box43, Text as Text47 } from "ink";
|
|
29077
|
+
import { jsx as jsx51, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
29189
29078
|
function stepLabel(step, title, state, wide) {
|
|
29190
29079
|
if (state === "complete") return wide ? `\u2713 ${title}` : "\u2713";
|
|
29191
29080
|
if (state === "active") return wide ? `[${step} ${title}]` : `[${step}]`;
|
|
@@ -29198,12 +29087,12 @@ function stepColor(state) {
|
|
|
29198
29087
|
}
|
|
29199
29088
|
function SetupStepper({ activeStep, columns }) {
|
|
29200
29089
|
const wide = columns !== void 0 && columns >= WIDE_MIN_COLUMNS;
|
|
29201
|
-
return /* @__PURE__ */
|
|
29090
|
+
return /* @__PURE__ */ jsx51(Box43, { columnGap: wide ? 0 : COMPACT_GAP, children: SETUP_SCREENS.map((title, index) => {
|
|
29202
29091
|
const step = index + 1;
|
|
29203
29092
|
const state = step < activeStep ? "complete" : step === activeStep ? "active" : "pending";
|
|
29204
|
-
return /* @__PURE__ */
|
|
29205
|
-
wide && index > 0 && /* @__PURE__ */
|
|
29206
|
-
/* @__PURE__ */
|
|
29093
|
+
return /* @__PURE__ */ jsxs44(React17.Fragment, { children: [
|
|
29094
|
+
wide && index > 0 && /* @__PURE__ */ jsx51(Text47, { dimColor: true, children: WIDE_SEPARATOR }),
|
|
29095
|
+
/* @__PURE__ */ jsx51(Text47, { bold: state === "active", dimColor: state === "pending", color: stepColor(state), children: stepLabel(step, title, state, wide) })
|
|
29207
29096
|
] }, step);
|
|
29208
29097
|
}) });
|
|
29209
29098
|
}
|
|
@@ -29222,33 +29111,33 @@ var init_SetupStepper = __esm({
|
|
|
29222
29111
|
});
|
|
29223
29112
|
|
|
29224
29113
|
// packages/experience-design-system-cli/src/setup/steps/StepLayout.tsx
|
|
29225
|
-
import { Box as
|
|
29226
|
-
import { jsx as
|
|
29114
|
+
import { Box as Box44, Text as Text48 } from "ink";
|
|
29115
|
+
import { jsx as jsx52, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
29227
29116
|
function StepLayout({ helpText, children, prompt }) {
|
|
29228
|
-
return /* @__PURE__ */
|
|
29117
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", children: [
|
|
29229
29118
|
children,
|
|
29230
|
-
prompt && /* @__PURE__ */
|
|
29231
|
-
helpText && /* @__PURE__ */
|
|
29119
|
+
prompt && /* @__PURE__ */ jsx52(Box44, { marginTop: 1, children: prompt }),
|
|
29120
|
+
helpText && /* @__PURE__ */ jsx52(Box44, { marginTop: 1, children: /* @__PURE__ */ jsx52(Text48, { dimColor: true, children: helpText }) })
|
|
29232
29121
|
] });
|
|
29233
29122
|
}
|
|
29234
29123
|
function StepSuccess({ children }) {
|
|
29235
|
-
return /* @__PURE__ */
|
|
29124
|
+
return /* @__PURE__ */ jsxs45(Text48, { color: PALETTE.success, children: [
|
|
29236
29125
|
"\u2713 ",
|
|
29237
29126
|
children
|
|
29238
29127
|
] });
|
|
29239
29128
|
}
|
|
29240
29129
|
function StepWarning({ children }) {
|
|
29241
|
-
return /* @__PURE__ */
|
|
29130
|
+
return /* @__PURE__ */ jsxs45(Text48, { color: PALETTE.warning, children: [
|
|
29242
29131
|
"\u26A0 ",
|
|
29243
29132
|
children
|
|
29244
29133
|
] });
|
|
29245
29134
|
}
|
|
29246
29135
|
function StepValue({ label, value }) {
|
|
29247
29136
|
const color = value ? void 0 : PALETTE.warning;
|
|
29248
|
-
return /* @__PURE__ */
|
|
29249
|
-
/* @__PURE__ */
|
|
29250
|
-
/* @__PURE__ */
|
|
29251
|
-
/* @__PURE__ */
|
|
29137
|
+
return /* @__PURE__ */ jsxs45(Box44, { children: [
|
|
29138
|
+
/* @__PURE__ */ jsx52(Box44, { width: 2, children: /* @__PURE__ */ jsx52(Text48, { color, children: value ? "" : "\u26A0" }) }),
|
|
29139
|
+
/* @__PURE__ */ jsx52(Box44, { width: 20, flexShrink: 0, children: /* @__PURE__ */ jsx52(Text48, { color, children: label }) }),
|
|
29140
|
+
/* @__PURE__ */ jsx52(Text48, { color, children: value || "(not set)" })
|
|
29252
29141
|
] });
|
|
29253
29142
|
}
|
|
29254
29143
|
var init_StepLayout = __esm({
|
|
@@ -29259,10 +29148,10 @@ var init_StepLayout = __esm({
|
|
|
29259
29148
|
});
|
|
29260
29149
|
|
|
29261
29150
|
// packages/experience-design-system-cli/src/setup/steps/CodingAgentScreen.tsx
|
|
29262
|
-
import { useEffect as
|
|
29263
|
-
import { Box as
|
|
29151
|
+
import { useEffect as useEffect16, useRef as useRef11, useState as useState24 } from "react";
|
|
29152
|
+
import { Box as Box45, Text as Text49 } from "ink";
|
|
29264
29153
|
import { Select, TextInput } from "@inkjs/ui";
|
|
29265
|
-
import { jsx as
|
|
29154
|
+
import { jsx as jsx53, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
29266
29155
|
async function detectAgents(exists = binaryExists) {
|
|
29267
29156
|
const found = await Promise.all(AGENT_DEFS.map(async (agent) => await exists(agent.binary) ? agent : void 0));
|
|
29268
29157
|
return found.filter((agent) => agent !== void 0);
|
|
@@ -29288,14 +29177,14 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
29288
29177
|
}
|
|
29289
29178
|
void save(agent.binary, void 0);
|
|
29290
29179
|
};
|
|
29291
|
-
|
|
29180
|
+
useEffect16(() => {
|
|
29292
29181
|
if (startedRef.current) return;
|
|
29293
29182
|
startedRef.current = true;
|
|
29294
29183
|
void (async () => {
|
|
29295
29184
|
const found = await detectAgents(exists);
|
|
29296
29185
|
if (found.length === 1) {
|
|
29297
29186
|
const only = found[0];
|
|
29298
|
-
setNotes([/* @__PURE__ */
|
|
29187
|
+
setNotes([/* @__PURE__ */ jsx53(StepSuccess, { children: `${only.name} (${only.binary}) found` }, "found")]);
|
|
29299
29188
|
afterSelection(only);
|
|
29300
29189
|
return;
|
|
29301
29190
|
}
|
|
@@ -29303,7 +29192,7 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
29303
29192
|
setPhase({ kind: "choose", found });
|
|
29304
29193
|
return;
|
|
29305
29194
|
}
|
|
29306
|
-
setNotes([/* @__PURE__ */
|
|
29195
|
+
setNotes([/* @__PURE__ */ jsx53(StepWarning, { children: "No coding agent found on PATH" }, "none")]);
|
|
29307
29196
|
setPhase({ kind: "install-choice" });
|
|
29308
29197
|
})();
|
|
29309
29198
|
}, []);
|
|
@@ -29315,12 +29204,12 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
29315
29204
|
onDone("failed");
|
|
29316
29205
|
return;
|
|
29317
29206
|
}
|
|
29318
|
-
setNotes((current) => [...current, /* @__PURE__ */
|
|
29207
|
+
setNotes((current) => [...current, /* @__PURE__ */ jsx53(StepSuccess, { children: `${agent.name} installed` }, "installed")]);
|
|
29319
29208
|
afterSelection(agent);
|
|
29320
29209
|
};
|
|
29321
|
-
const chooser = (question, options, describe, onPick) => /* @__PURE__ */
|
|
29322
|
-
/* @__PURE__ */
|
|
29323
|
-
/* @__PURE__ */
|
|
29210
|
+
const chooser = (question, options, describe, onPick) => /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", children: [
|
|
29211
|
+
/* @__PURE__ */ jsx53(Text49, { children: question }),
|
|
29212
|
+
/* @__PURE__ */ jsx53(Box45, { marginTop: 1, children: /* @__PURE__ */ jsx53(
|
|
29324
29213
|
Select,
|
|
29325
29214
|
{
|
|
29326
29215
|
options: [
|
|
@@ -29332,7 +29221,7 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
29332
29221
|
) })
|
|
29333
29222
|
] });
|
|
29334
29223
|
if (phase.kind === "choose") {
|
|
29335
|
-
return /* @__PURE__ */
|
|
29224
|
+
return /* @__PURE__ */ jsx53(
|
|
29336
29225
|
StepLayout,
|
|
29337
29226
|
{
|
|
29338
29227
|
helpText: AGENT_HELP,
|
|
@@ -29347,7 +29236,7 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
29347
29236
|
);
|
|
29348
29237
|
}
|
|
29349
29238
|
if (phase.kind === "install-choice") {
|
|
29350
|
-
return /* @__PURE__ */
|
|
29239
|
+
return /* @__PURE__ */ jsx53(
|
|
29351
29240
|
StepLayout,
|
|
29352
29241
|
{
|
|
29353
29242
|
helpText: AGENT_HELP,
|
|
@@ -29362,13 +29251,13 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
29362
29251
|
);
|
|
29363
29252
|
}
|
|
29364
29253
|
if (phase.kind === "model") {
|
|
29365
|
-
return /* @__PURE__ */
|
|
29254
|
+
return /* @__PURE__ */ jsx53(
|
|
29366
29255
|
StepLayout,
|
|
29367
29256
|
{
|
|
29368
29257
|
helpText: AGENT_HELP,
|
|
29369
|
-
prompt: /* @__PURE__ */
|
|
29370
|
-
/* @__PURE__ */
|
|
29371
|
-
/* @__PURE__ */
|
|
29258
|
+
prompt: /* @__PURE__ */ jsxs46(Box45, { children: [
|
|
29259
|
+
/* @__PURE__ */ jsx53(Text49, { children: "Model name (optional - press Enter for Codex default): " }),
|
|
29260
|
+
/* @__PURE__ */ jsx53(
|
|
29372
29261
|
TextInput,
|
|
29373
29262
|
{
|
|
29374
29263
|
onSubmit: (value) => void save(phase.agent.binary, value.trim() || void 0)
|
|
@@ -29378,19 +29267,19 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
29378
29267
|
] }),
|
|
29379
29268
|
children: [
|
|
29380
29269
|
...notes,
|
|
29381
|
-
/* @__PURE__ */
|
|
29382
|
-
/* @__PURE__ */
|
|
29270
|
+
/* @__PURE__ */ jsx53(StepWarning, { children: "No OPENAI_API_KEY \u2014 using ChatGPT account authentication." }, "no-key"),
|
|
29271
|
+
/* @__PURE__ */ jsx53(Text49, { dimColor: true, children: "Tip: run codex then type /model to browse all available models." }, "tip")
|
|
29383
29272
|
]
|
|
29384
29273
|
}
|
|
29385
29274
|
);
|
|
29386
29275
|
}
|
|
29387
29276
|
if (phase.kind === "installing") {
|
|
29388
|
-
return /* @__PURE__ */
|
|
29277
|
+
return /* @__PURE__ */ jsx53(StepLayout, { helpText: AGENT_HELP, children: [...notes, /* @__PURE__ */ jsx53(Text49, { children: `Installing ${phase.agent.name}\u2026` }, "installing")] });
|
|
29389
29278
|
}
|
|
29390
29279
|
if (phase.kind === "failed") {
|
|
29391
|
-
return /* @__PURE__ */
|
|
29280
|
+
return /* @__PURE__ */ jsx53(StepLayout, { helpText: AGENT_HELP, children: [...notes, /* @__PURE__ */ jsx53(Text49, { children: `\u2717 ${phase.message}` }, "failed")] });
|
|
29392
29281
|
}
|
|
29393
|
-
return /* @__PURE__ */
|
|
29282
|
+
return /* @__PURE__ */ jsx53(Text49, { dimColor: true, children: "Looking for a coding agent\u2026" });
|
|
29394
29283
|
}
|
|
29395
29284
|
var AGENT_HELP, SKIP_VALUE;
|
|
29396
29285
|
var init_CodingAgentScreen = __esm({
|
|
@@ -29406,10 +29295,10 @@ var init_CodingAgentScreen = __esm({
|
|
|
29406
29295
|
});
|
|
29407
29296
|
|
|
29408
29297
|
// packages/experience-design-system-cli/src/setup/steps/ContentfulCredentialsScreen.tsx
|
|
29409
|
-
import { useEffect as
|
|
29410
|
-
import { Box as
|
|
29298
|
+
import { useEffect as useEffect17, useRef as useRef12, useState as useState25 } from "react";
|
|
29299
|
+
import { Box as Box46, Text as Text50 } from "ink";
|
|
29411
29300
|
import { PasswordInput, Select as Select2, TextInput as TextInput2 } from "@inkjs/ui";
|
|
29412
|
-
import { Fragment as Fragment19, jsx as
|
|
29301
|
+
import { Fragment as Fragment19, jsx as jsx54, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
29413
29302
|
function envShadowingWarning(env) {
|
|
29414
29303
|
const set = ENV_KEYS.filter((key) => env[key]);
|
|
29415
29304
|
if (set.length === 0) return null;
|
|
@@ -29423,24 +29312,24 @@ function ContentfulCredentialsScreen({ onDone }) {
|
|
|
29423
29312
|
const [field, setField] = useState25("confirm");
|
|
29424
29313
|
const enteredRef = useRef12({});
|
|
29425
29314
|
const [error, setError] = useState25(null);
|
|
29426
|
-
|
|
29315
|
+
useEffect17(() => {
|
|
29427
29316
|
void readExperiencesCredentials().then(setStored);
|
|
29428
29317
|
}, []);
|
|
29429
|
-
if (!stored) return /* @__PURE__ */
|
|
29318
|
+
if (!stored) return /* @__PURE__ */ jsx54(Text50, { dimColor: true, children: "Reading saved credentials\u2026" });
|
|
29430
29319
|
const currentHost = stored.host ?? DEFAULT_CONFIGURED_HOST;
|
|
29431
29320
|
const hasAny = Boolean(stored.spaceId || stored.environmentId || stored.cmaToken);
|
|
29432
29321
|
const allSet = Boolean(stored.spaceId && stored.environmentId && stored.cmaToken);
|
|
29433
29322
|
const shadowing = envShadowingWarning(process.env);
|
|
29434
|
-
const summary = /* @__PURE__ */
|
|
29435
|
-
shadowing && /* @__PURE__ */
|
|
29436
|
-
hasAny && /* @__PURE__ */
|
|
29437
|
-
/* @__PURE__ */
|
|
29438
|
-
/* @__PURE__ */
|
|
29439
|
-
/* @__PURE__ */
|
|
29440
|
-
/* @__PURE__ */
|
|
29441
|
-
/* @__PURE__ */
|
|
29323
|
+
const summary = /* @__PURE__ */ jsxs47(Fragment19, { children: [
|
|
29324
|
+
shadowing && /* @__PURE__ */ jsx54(StepWarning, { children: shadowing }),
|
|
29325
|
+
hasAny && /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", marginTop: shadowing ? 1 : 0, children: [
|
|
29326
|
+
/* @__PURE__ */ jsx54(Text50, { children: "Current values:" }),
|
|
29327
|
+
/* @__PURE__ */ jsx54(StepValue, { label: "Space ID", value: stored.spaceId }),
|
|
29328
|
+
/* @__PURE__ */ jsx54(StepValue, { label: "Environment ID", value: stored.environmentId }),
|
|
29329
|
+
/* @__PURE__ */ jsx54(StepValue, { label: "CMA Token", value: stored.cmaToken ? maskToken(stored.cmaToken) : void 0 }),
|
|
29330
|
+
/* @__PURE__ */ jsx54(StepValue, { label: "API Host", value: currentHost })
|
|
29442
29331
|
] }),
|
|
29443
|
-
error && /* @__PURE__ */
|
|
29332
|
+
error && /* @__PURE__ */ jsx54(StepWarning, { children: error })
|
|
29444
29333
|
] });
|
|
29445
29334
|
const helpText = `Saved to ${experiencesCredentialsPath()} \u2014 loaded automatically by experiences import.`;
|
|
29446
29335
|
if (field === "confirm") {
|
|
@@ -29448,13 +29337,13 @@ function ContentfulCredentialsScreen({ onDone }) {
|
|
|
29448
29337
|
{ label: hasAny ? "Update the saved credentials" : "Enter credentials now", value: ENTER },
|
|
29449
29338
|
{ label: allSet ? "Keep them as they are" : "Skip for now", value: KEEP }
|
|
29450
29339
|
];
|
|
29451
|
-
return /* @__PURE__ */
|
|
29340
|
+
return /* @__PURE__ */ jsx54(
|
|
29452
29341
|
StepLayout,
|
|
29453
29342
|
{
|
|
29454
29343
|
helpText,
|
|
29455
|
-
prompt: /* @__PURE__ */
|
|
29456
|
-
/* @__PURE__ */
|
|
29457
|
-
/* @__PURE__ */
|
|
29344
|
+
prompt: /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", children: [
|
|
29345
|
+
/* @__PURE__ */ jsx54(Text50, { children: "Contentful credentials" }),
|
|
29346
|
+
/* @__PURE__ */ jsx54(Box46, { marginTop: 1, children: /* @__PURE__ */ jsx54(
|
|
29458
29347
|
Select2,
|
|
29459
29348
|
{
|
|
29460
29349
|
options: allSet ? [...options].reverse() : options,
|
|
@@ -29495,24 +29384,24 @@ function ContentfulCredentialsScreen({ onDone }) {
|
|
|
29495
29384
|
onDone("completed");
|
|
29496
29385
|
};
|
|
29497
29386
|
const prompts = {
|
|
29498
|
-
spaceId: /* @__PURE__ */
|
|
29499
|
-
/* @__PURE__ */
|
|
29500
|
-
/* @__PURE__ */
|
|
29387
|
+
spaceId: /* @__PURE__ */ jsxs47(Box46, { children: [
|
|
29388
|
+
/* @__PURE__ */ jsx54(Text50, { children: `Space ID${stored.spaceId ? ` [${stored.spaceId}]` : ""}: ` }),
|
|
29389
|
+
/* @__PURE__ */ jsx54(TextInput2, { onSubmit: (v) => advance("spaceId", v) }, "spaceId")
|
|
29501
29390
|
] }),
|
|
29502
|
-
environmentId: /* @__PURE__ */
|
|
29503
|
-
/* @__PURE__ */
|
|
29504
|
-
/* @__PURE__ */
|
|
29391
|
+
environmentId: /* @__PURE__ */ jsxs47(Box46, { children: [
|
|
29392
|
+
/* @__PURE__ */ jsx54(Text50, { children: `Environment ID [${stored.environmentId || "master"}]: ` }),
|
|
29393
|
+
/* @__PURE__ */ jsx54(TextInput2, { onSubmit: (v) => advance("environmentId", v) }, "environmentId")
|
|
29505
29394
|
] }),
|
|
29506
|
-
cmaToken: /* @__PURE__ */
|
|
29507
|
-
/* @__PURE__ */
|
|
29508
|
-
/* @__PURE__ */
|
|
29395
|
+
cmaToken: /* @__PURE__ */ jsxs47(Box46, { children: [
|
|
29396
|
+
/* @__PURE__ */ jsx54(Text50, { children: `CMA token${stored.cmaToken ? " [press Enter to keep existing]" : " (paste here)"}: ` }),
|
|
29397
|
+
/* @__PURE__ */ jsx54(PasswordInput, { onSubmit: (v) => advance("cmaToken", v) }, "cmaToken")
|
|
29509
29398
|
] }),
|
|
29510
|
-
host: /* @__PURE__ */
|
|
29511
|
-
/* @__PURE__ */
|
|
29512
|
-
/* @__PURE__ */
|
|
29399
|
+
host: /* @__PURE__ */ jsxs47(Box46, { children: [
|
|
29400
|
+
/* @__PURE__ */ jsx54(Text50, { children: `API host [${currentHost}]: ` }),
|
|
29401
|
+
/* @__PURE__ */ jsx54(TextInput2, { onSubmit: (v) => advance("host", v) }, "host")
|
|
29513
29402
|
] })
|
|
29514
29403
|
};
|
|
29515
|
-
return /* @__PURE__ */
|
|
29404
|
+
return /* @__PURE__ */ jsx54(StepLayout, { helpText, prompt: prompts[field], children: summary });
|
|
29516
29405
|
}
|
|
29517
29406
|
var ENV_KEYS, ENTER, KEEP, FIELD_ORDER;
|
|
29518
29407
|
var init_ContentfulCredentialsScreen = __esm({
|
|
@@ -29529,10 +29418,10 @@ var init_ContentfulCredentialsScreen = __esm({
|
|
|
29529
29418
|
});
|
|
29530
29419
|
|
|
29531
29420
|
// packages/experience-design-system-cli/src/setup/steps/preferences/BooleanInput.tsx
|
|
29532
|
-
import { useEffect as
|
|
29533
|
-
import { Box as
|
|
29421
|
+
import { useEffect as useEffect18, useState as useState26 } from "react";
|
|
29422
|
+
import { Box as Box47, Text as Text51 } from "ink";
|
|
29534
29423
|
import { Select as Select3 } from "@inkjs/ui";
|
|
29535
|
-
import { jsx as
|
|
29424
|
+
import { jsx as jsx55, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
29536
29425
|
function tick(labels, forOn, current) {
|
|
29537
29426
|
const label = forOn ? labels.on : labels.off;
|
|
29538
29427
|
return forOn === current ? `${label} \u2713` : label;
|
|
@@ -29547,10 +29436,10 @@ function BooleanInput({
|
|
|
29547
29436
|
onDone
|
|
29548
29437
|
}) {
|
|
29549
29438
|
const [stored, setStored] = useState26(null);
|
|
29550
|
-
|
|
29439
|
+
useEffect18(() => {
|
|
29551
29440
|
void readExperiencesCredentials().then(setStored);
|
|
29552
29441
|
}, []);
|
|
29553
|
-
if (!stored) return /* @__PURE__ */
|
|
29442
|
+
if (!stored) return /* @__PURE__ */ jsx55(Text51, { dimColor: true, children: "Reading saved preferences\u2026" });
|
|
29554
29443
|
const current = read(stored) ?? fallback;
|
|
29555
29444
|
const submit = (value) => {
|
|
29556
29445
|
if (value === current) {
|
|
@@ -29559,13 +29448,13 @@ function BooleanInput({
|
|
|
29559
29448
|
}
|
|
29560
29449
|
void writeExperiencesCredentials(write2(stored, value)).then(() => onDone("completed"));
|
|
29561
29450
|
};
|
|
29562
|
-
return /* @__PURE__ */
|
|
29451
|
+
return /* @__PURE__ */ jsx55(
|
|
29563
29452
|
StepLayout,
|
|
29564
29453
|
{
|
|
29565
29454
|
helpText,
|
|
29566
|
-
prompt: /* @__PURE__ */
|
|
29567
|
-
/* @__PURE__ */
|
|
29568
|
-
/* @__PURE__ */
|
|
29455
|
+
prompt: /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", children: [
|
|
29456
|
+
/* @__PURE__ */ jsx55(Text51, { children: question }),
|
|
29457
|
+
/* @__PURE__ */ jsx55(Box47, { marginTop: 1, children: /* @__PURE__ */ jsx55(
|
|
29569
29458
|
Select3,
|
|
29570
29459
|
{
|
|
29571
29460
|
options: [
|
|
@@ -29590,9 +29479,9 @@ var init_BooleanInput = __esm({
|
|
|
29590
29479
|
});
|
|
29591
29480
|
|
|
29592
29481
|
// packages/experience-design-system-cli/src/setup/steps/preferences/AnalyticsScreen.tsx
|
|
29593
|
-
import { jsx as
|
|
29482
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
29594
29483
|
function AnalyticsScreen({ onDone }) {
|
|
29595
|
-
return /* @__PURE__ */
|
|
29484
|
+
return /* @__PURE__ */ jsx56(
|
|
29596
29485
|
BooleanInput,
|
|
29597
29486
|
{
|
|
29598
29487
|
helpText: "Shares anonymous usage data about which CLI commands are used and where imports succeed or fail. Never includes source code, file paths, credentials, or authored content",
|
|
@@ -29613,9 +29502,9 @@ var init_AnalyticsScreen = __esm({
|
|
|
29613
29502
|
});
|
|
29614
29503
|
|
|
29615
29504
|
// packages/experience-design-system-cli/src/setup/steps/preferences/ColorPreferenceScreen.tsx
|
|
29616
|
-
import { jsx as
|
|
29505
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
29617
29506
|
function ColorPreferenceScreen({ onDone }) {
|
|
29618
|
-
return /* @__PURE__ */
|
|
29507
|
+
return /* @__PURE__ */ jsx57(
|
|
29619
29508
|
BooleanInput,
|
|
29620
29509
|
{
|
|
29621
29510
|
helpText: `Prints plain text with no color, which suits CI logs and basic terminals.`,
|
|
@@ -29636,10 +29525,10 @@ var init_ColorPreferenceScreen = __esm({
|
|
|
29636
29525
|
});
|
|
29637
29526
|
|
|
29638
29527
|
// packages/experience-design-system-cli/src/setup/steps/preferences/CustomPromptScreen.tsx
|
|
29639
|
-
import { useEffect as
|
|
29640
|
-
import { Box as
|
|
29528
|
+
import { useEffect as useEffect19, useState as useState27 } from "react";
|
|
29529
|
+
import { Box as Box48, Text as Text52 } from "ink";
|
|
29641
29530
|
import { ConfirmInput, TextInput as TextInput3 } from "@inkjs/ui";
|
|
29642
|
-
import { jsx as
|
|
29531
|
+
import { jsx as jsx58, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
29643
29532
|
function parseCustomSkillPath(answer) {
|
|
29644
29533
|
const trimmed = answer.trim();
|
|
29645
29534
|
if (trimmed === "") return void 0;
|
|
@@ -29658,22 +29547,22 @@ function applyCustomSkillPath(credentials, parsed) {
|
|
|
29658
29547
|
function CustomPromptsScreen({ onDone }) {
|
|
29659
29548
|
const [stored, setStored] = useState27(null);
|
|
29660
29549
|
const [phase, setPhase] = useState27("confirm");
|
|
29661
|
-
|
|
29550
|
+
useEffect19(() => {
|
|
29662
29551
|
void readExperiencesCredentials().then(setStored);
|
|
29663
29552
|
}, []);
|
|
29664
|
-
if (!stored) return /* @__PURE__ */
|
|
29553
|
+
if (!stored) return /* @__PURE__ */ jsx58(Text52, { dimColor: true, children: "Reading saved prompt paths\u2026" });
|
|
29665
29554
|
const submit = (answer) => {
|
|
29666
29555
|
const next = applyCustomSkillPath(stored, parseCustomSkillPath(answer));
|
|
29667
29556
|
void writeExperiencesCredentials(next).then(() => onDone("completed"));
|
|
29668
29557
|
};
|
|
29669
29558
|
if (phase === "confirm") {
|
|
29670
|
-
return /* @__PURE__ */
|
|
29559
|
+
return /* @__PURE__ */ jsx58(
|
|
29671
29560
|
StepLayout,
|
|
29672
29561
|
{
|
|
29673
29562
|
helpText: CUSTOM_PROMPTS_HELP,
|
|
29674
|
-
prompt: /* @__PURE__ */
|
|
29675
|
-
/* @__PURE__ */
|
|
29676
|
-
/* @__PURE__ */
|
|
29563
|
+
prompt: /* @__PURE__ */ jsxs49(Box48, { children: [
|
|
29564
|
+
/* @__PURE__ */ jsx58(Text52, { children: "Use your own prompt file instead of the built-in one? " }),
|
|
29565
|
+
/* @__PURE__ */ jsx58(
|
|
29677
29566
|
ConfirmInput,
|
|
29678
29567
|
{
|
|
29679
29568
|
defaultChoice: "cancel",
|
|
@@ -29685,13 +29574,13 @@ function CustomPromptsScreen({ onDone }) {
|
|
|
29685
29574
|
}
|
|
29686
29575
|
);
|
|
29687
29576
|
}
|
|
29688
|
-
return /* @__PURE__ */
|
|
29577
|
+
return /* @__PURE__ */ jsx58(
|
|
29689
29578
|
StepLayout,
|
|
29690
29579
|
{
|
|
29691
29580
|
helpText: CUSTOM_PROMPTS_HELP,
|
|
29692
|
-
prompt: /* @__PURE__ */
|
|
29693
|
-
/* @__PURE__ */
|
|
29694
|
-
/* @__PURE__ */
|
|
29581
|
+
prompt: /* @__PURE__ */ jsxs49(Box48, { children: [
|
|
29582
|
+
/* @__PURE__ */ jsx58(Text52, { children: customSkillPathQuestion(stored.generatePromptPath) }),
|
|
29583
|
+
/* @__PURE__ */ jsx58(TextInput3, { onSubmit: submit })
|
|
29695
29584
|
] })
|
|
29696
29585
|
}
|
|
29697
29586
|
);
|
|
@@ -29707,9 +29596,9 @@ var init_CustomPromptScreen = __esm({
|
|
|
29707
29596
|
});
|
|
29708
29597
|
|
|
29709
29598
|
// packages/experience-design-system-cli/src/setup/steps/preferences/DebugLogsScreen.tsx
|
|
29710
|
-
import { jsx as
|
|
29599
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
29711
29600
|
function DebugLogsScreen({ onDone }) {
|
|
29712
|
-
return /* @__PURE__ */
|
|
29601
|
+
return /* @__PURE__ */ jsx59(
|
|
29713
29602
|
BooleanInput,
|
|
29714
29603
|
{
|
|
29715
29604
|
helpText: `Writes a verbose trace of every command decision, for troubleshooting.`,
|
|
@@ -29731,16 +29620,16 @@ var init_DebugLogsScreen = __esm({
|
|
|
29731
29620
|
|
|
29732
29621
|
// packages/experience-design-system-cli/src/setup/steps/preferences/PreferencesMenu.tsx
|
|
29733
29622
|
import { useState as useState28 } from "react";
|
|
29734
|
-
import { Box as
|
|
29623
|
+
import { Box as Box49, Text as Text53 } from "ink";
|
|
29735
29624
|
import { Select as Select4 } from "@inkjs/ui";
|
|
29736
|
-
import { jsx as
|
|
29625
|
+
import { jsx as jsx60, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
29737
29626
|
function PreferencesMenu({ onDone }) {
|
|
29738
29627
|
const [open, setOpen] = useState28(null);
|
|
29739
29628
|
const [changed, setChanged] = useState28(/* @__PURE__ */ new Set());
|
|
29740
29629
|
const entry = open === null ? void 0 : PREFERENCE_OPTIONS.find((option) => option.key === open);
|
|
29741
|
-
if (!entry) return /* @__PURE__ */
|
|
29630
|
+
if (!entry) return /* @__PURE__ */ jsx60(PreferenceList, { changed, onOpen: setOpen, onDone });
|
|
29742
29631
|
const { key, Screen } = entry;
|
|
29743
|
-
return /* @__PURE__ */
|
|
29632
|
+
return /* @__PURE__ */ jsx60(
|
|
29744
29633
|
Screen,
|
|
29745
29634
|
{
|
|
29746
29635
|
onDone: (status) => {
|
|
@@ -29757,13 +29646,13 @@ function PreferenceList({ changed, onOpen, onDone }) {
|
|
|
29757
29646
|
...PREFERENCE_OPTIONS.map((option) => ({ label: option.label, value: option.key })),
|
|
29758
29647
|
{ label: "Done", value: DONE_VALUE }
|
|
29759
29648
|
];
|
|
29760
|
-
return /* @__PURE__ */
|
|
29649
|
+
return /* @__PURE__ */ jsx60(
|
|
29761
29650
|
StepLayout,
|
|
29762
29651
|
{
|
|
29763
29652
|
helpText: PREFERENCES_MENU_HELP,
|
|
29764
|
-
prompt: /* @__PURE__ */
|
|
29765
|
-
/* @__PURE__ */
|
|
29766
|
-
/* @__PURE__ */
|
|
29653
|
+
prompt: /* @__PURE__ */ jsxs50(Box49, { flexDirection: "column", children: [
|
|
29654
|
+
/* @__PURE__ */ jsx60(Text53, { children: "Preferences" }),
|
|
29655
|
+
/* @__PURE__ */ jsx60(Box49, { marginTop: 1, children: /* @__PURE__ */ jsx60(
|
|
29767
29656
|
Select4,
|
|
29768
29657
|
{
|
|
29769
29658
|
options,
|
|
@@ -29796,22 +29685,22 @@ var init_PreferencesMenu = __esm({
|
|
|
29796
29685
|
{
|
|
29797
29686
|
key: "customPrompts",
|
|
29798
29687
|
label: "Custom prompts",
|
|
29799
|
-
Screen: ({ onDone }) => /* @__PURE__ */
|
|
29688
|
+
Screen: ({ onDone }) => /* @__PURE__ */ jsx60(CustomPromptsScreen, { onDone })
|
|
29800
29689
|
},
|
|
29801
29690
|
{
|
|
29802
29691
|
key: "debug",
|
|
29803
29692
|
label: "Debug logging",
|
|
29804
|
-
Screen: ({ onDone }) => /* @__PURE__ */
|
|
29693
|
+
Screen: ({ onDone }) => /* @__PURE__ */ jsx60(DebugLogsScreen, { onDone })
|
|
29805
29694
|
},
|
|
29806
29695
|
{
|
|
29807
29696
|
key: "analytics",
|
|
29808
29697
|
label: "Usage analytics",
|
|
29809
|
-
Screen: ({ onDone }) => /* @__PURE__ */
|
|
29698
|
+
Screen: ({ onDone }) => /* @__PURE__ */ jsx60(AnalyticsScreen, { onDone })
|
|
29810
29699
|
},
|
|
29811
29700
|
{
|
|
29812
29701
|
key: "noColor",
|
|
29813
29702
|
label: "Terminal colors",
|
|
29814
|
-
Screen: ({ onDone }) => /* @__PURE__ */
|
|
29703
|
+
Screen: ({ onDone }) => /* @__PURE__ */ jsx60(ColorPreferenceScreen, { onDone })
|
|
29815
29704
|
}
|
|
29816
29705
|
];
|
|
29817
29706
|
DONE_VALUE = "menu:done";
|
|
@@ -30026,24 +29915,24 @@ var init_prerequisites = __esm({
|
|
|
30026
29915
|
});
|
|
30027
29916
|
|
|
30028
29917
|
// packages/experience-design-system-cli/src/setup/steps/prerequisites/PrerequisitesScreen.tsx
|
|
30029
|
-
import { useEffect as
|
|
30030
|
-
import { Box as
|
|
29918
|
+
import { useEffect as useEffect20, useRef as useRef13, useState as useState29 } from "react";
|
|
29919
|
+
import { Box as Box50, Text as Text54 } from "ink";
|
|
30031
29920
|
import { ConfirmInput as ConfirmInput2 } from "@inkjs/ui";
|
|
30032
|
-
import { jsx as
|
|
29921
|
+
import { jsx as jsx61, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
30033
29922
|
function EventLine({ event }) {
|
|
30034
|
-
if (event.kind === "success") return /* @__PURE__ */
|
|
29923
|
+
if (event.kind === "success") return /* @__PURE__ */ jsxs51(Text54, { color: PALETTE.success, children: [
|
|
30035
29924
|
"\u2713 ",
|
|
30036
29925
|
event.message
|
|
30037
29926
|
] });
|
|
30038
|
-
if (event.kind === "failure") return /* @__PURE__ */
|
|
29927
|
+
if (event.kind === "failure") return /* @__PURE__ */ jsxs51(Text54, { color: PALETTE.error, children: [
|
|
30039
29928
|
"\u2717 ",
|
|
30040
29929
|
event.message
|
|
30041
29930
|
] });
|
|
30042
|
-
if (event.kind === "warning") return /* @__PURE__ */
|
|
29931
|
+
if (event.kind === "warning") return /* @__PURE__ */ jsxs51(Text54, { color: PALETTE.warning, children: [
|
|
30043
29932
|
"\u26A0 ",
|
|
30044
29933
|
event.message
|
|
30045
29934
|
] });
|
|
30046
|
-
return /* @__PURE__ */
|
|
29935
|
+
return /* @__PURE__ */ jsx61(Text54, { children: event.message });
|
|
30047
29936
|
}
|
|
30048
29937
|
function PrerequisitesScreen({
|
|
30049
29938
|
repoRoot,
|
|
@@ -30054,7 +29943,7 @@ function PrerequisitesScreen({
|
|
|
30054
29943
|
const [events, setEvents] = useState29([]);
|
|
30055
29944
|
const [confirm, setConfirm] = useState29(null);
|
|
30056
29945
|
const startedRef = useRef13(false);
|
|
30057
|
-
|
|
29946
|
+
useEffect20(() => {
|
|
30058
29947
|
if (startedRef.current) return;
|
|
30059
29948
|
startedRef.current = true;
|
|
30060
29949
|
const base = deps ?? {
|
|
@@ -30082,15 +29971,15 @@ function PrerequisitesScreen({
|
|
|
30082
29971
|
...skipBuild !== void 0 ? { skipBuild } : {}
|
|
30083
29972
|
}).then(onDone);
|
|
30084
29973
|
}, []);
|
|
30085
|
-
return /* @__PURE__ */
|
|
29974
|
+
return /* @__PURE__ */ jsx61(
|
|
30086
29975
|
StepLayout,
|
|
30087
29976
|
{
|
|
30088
|
-
prompt: confirm ? /* @__PURE__ */
|
|
30089
|
-
/* @__PURE__ */
|
|
29977
|
+
prompt: confirm ? /* @__PURE__ */ jsxs51(Box50, { children: [
|
|
29978
|
+
/* @__PURE__ */ jsxs51(Text54, { children: [
|
|
30090
29979
|
confirm.question,
|
|
30091
29980
|
" "
|
|
30092
29981
|
] }),
|
|
30093
|
-
/* @__PURE__ */
|
|
29982
|
+
/* @__PURE__ */ jsx61(
|
|
30094
29983
|
ConfirmInput2,
|
|
30095
29984
|
{
|
|
30096
29985
|
defaultChoice: confirm.defaultYes ? "confirm" : "cancel",
|
|
@@ -30099,8 +29988,8 @@ function PrerequisitesScreen({
|
|
|
30099
29988
|
},
|
|
30100
29989
|
confirm.question
|
|
30101
29990
|
)
|
|
30102
|
-
] }) : /* @__PURE__ */
|
|
30103
|
-
children: /* @__PURE__ */
|
|
29991
|
+
] }) : /* @__PURE__ */ jsx61(Text54, { color: PALETTE.info, children: "\u27F3 Checking prerequisites\u2026" }),
|
|
29992
|
+
children: /* @__PURE__ */ jsx61(Box50, { flexDirection: "column", children: events.map((event, index) => /* @__PURE__ */ jsx61(EventLine, { event }, `${index}-${event.message}`)) })
|
|
30104
29993
|
}
|
|
30105
29994
|
);
|
|
30106
29995
|
}
|
|
@@ -30120,9 +30009,9 @@ __export(SetupScreen_exports, {
|
|
|
30120
30009
|
SetupScreen: () => SetupScreen,
|
|
30121
30010
|
formatSetupCompletionMessage: () => formatSetupCompletionMessage
|
|
30122
30011
|
});
|
|
30123
|
-
import { useEffect as
|
|
30124
|
-
import { Box as
|
|
30125
|
-
import { jsx as
|
|
30012
|
+
import { useEffect as useEffect21, useRef as useRef14, useState as useState30 } from "react";
|
|
30013
|
+
import { Box as Box51, Text as Text55 } from "ink";
|
|
30014
|
+
import { jsx as jsx62, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
30126
30015
|
function countRequiredFailures(results) {
|
|
30127
30016
|
return results.filter((result) => result.required && result.status === "failed").length;
|
|
30128
30017
|
}
|
|
@@ -30145,7 +30034,7 @@ function SetupScreen({
|
|
|
30145
30034
|
const [notice, setNotice] = useState30(null);
|
|
30146
30035
|
const [screen, setScreen] = useState30(null);
|
|
30147
30036
|
const startedRef = useRef14(false);
|
|
30148
|
-
|
|
30037
|
+
useEffect21(() => {
|
|
30149
30038
|
if (startedRef.current) return;
|
|
30150
30039
|
startedRef.current = true;
|
|
30151
30040
|
const runScreen = (build) => new Promise((resolve21) => {
|
|
@@ -30153,7 +30042,7 @@ function SetupScreen({
|
|
|
30153
30042
|
});
|
|
30154
30043
|
void (async () => {
|
|
30155
30044
|
const results = [];
|
|
30156
|
-
const prerequisites = await runScreen((done) => /* @__PURE__ */
|
|
30045
|
+
const prerequisites = await runScreen((done) => /* @__PURE__ */ jsx62(
|
|
30157
30046
|
PrerequisitesScreen,
|
|
30158
30047
|
{
|
|
30159
30048
|
repoRoot,
|
|
@@ -30187,21 +30076,21 @@ function SetupScreen({
|
|
|
30187
30076
|
if (skip.skipAgent) {
|
|
30188
30077
|
results.push({ name: "Coding agent", status: "skipped", required: false });
|
|
30189
30078
|
} else {
|
|
30190
|
-
const status = await runScreen((done) => /* @__PURE__ */
|
|
30079
|
+
const status = await runScreen((done) => /* @__PURE__ */ jsx62(CodingAgentScreen, { onDone: done }));
|
|
30191
30080
|
results.push({ name: "Coding agent", status, required: true });
|
|
30192
30081
|
}
|
|
30193
30082
|
setActiveStep(3);
|
|
30194
30083
|
if (skip.skipCredentials) {
|
|
30195
30084
|
results.push({ name: "Contentful credentials", status: "skipped", required: false });
|
|
30196
30085
|
} else {
|
|
30197
|
-
const status = await runScreen((done) => /* @__PURE__ */
|
|
30086
|
+
const status = await runScreen((done) => /* @__PURE__ */ jsx62(ContentfulCredentialsScreen, { onDone: done }));
|
|
30198
30087
|
results.push({ name: "Contentful credentials", status, required: false });
|
|
30199
30088
|
}
|
|
30200
30089
|
setActiveStep(4);
|
|
30201
30090
|
if (skip.skipOptional) {
|
|
30202
30091
|
results.push({ name: "Preferences", status: "skipped", required: false });
|
|
30203
30092
|
} else {
|
|
30204
|
-
const status = await runScreen((done) => /* @__PURE__ */
|
|
30093
|
+
const status = await runScreen((done) => /* @__PURE__ */ jsx62(PreferencesMenu, { onDone: done }));
|
|
30205
30094
|
results.push({ name: "Preferences", status, required: false });
|
|
30206
30095
|
}
|
|
30207
30096
|
const exitCode = countRequiredFailures(results) === 0 ? 0 : 1;
|
|
@@ -30210,37 +30099,37 @@ function SetupScreen({
|
|
|
30210
30099
|
onComplete(finalOutcome);
|
|
30211
30100
|
})();
|
|
30212
30101
|
}, []);
|
|
30213
|
-
return /* @__PURE__ */
|
|
30214
|
-
/* @__PURE__ */
|
|
30215
|
-
/* @__PURE__ */
|
|
30216
|
-
/* @__PURE__ */
|
|
30102
|
+
return /* @__PURE__ */ jsxs52(Box51, { flexDirection: "column", paddingX: 1, children: [
|
|
30103
|
+
/* @__PURE__ */ jsxs52(Box51, { justifyContent: "space-between", columnGap: 1, ...columns !== void 0 ? { width: columns - 2 } : {}, children: [
|
|
30104
|
+
/* @__PURE__ */ jsx62(Box51, { flexShrink: 0, children: /* @__PURE__ */ jsx62(Text55, { bold: true, children: "experiences setup" }) }),
|
|
30105
|
+
/* @__PURE__ */ jsx62(Box51, { flexShrink: 0, children: /* @__PURE__ */ jsxs52(Text55, { dimColor: true, children: [
|
|
30217
30106
|
"v",
|
|
30218
30107
|
version
|
|
30219
30108
|
] }) })
|
|
30220
30109
|
] }),
|
|
30221
|
-
/* @__PURE__ */
|
|
30222
|
-
outcome ? /* @__PURE__ */
|
|
30110
|
+
/* @__PURE__ */ jsx62(Box51, { marginTop: 1, children: /* @__PURE__ */ jsx62(SetupStepper, { activeStep, columns }) }),
|
|
30111
|
+
outcome ? /* @__PURE__ */ jsx62(SetupSummary, { outcome, notice }) : screen && /* @__PURE__ */ jsx62(Box51, { marginTop: 1, children: screen })
|
|
30223
30112
|
] });
|
|
30224
30113
|
}
|
|
30225
30114
|
function SetupSummary({ outcome, notice }) {
|
|
30226
30115
|
const requiredFailed = countRequiredFailures(outcome.results);
|
|
30227
|
-
return /* @__PURE__ */
|
|
30228
|
-
/* @__PURE__ */
|
|
30116
|
+
return /* @__PURE__ */ jsxs52(Box51, { flexDirection: "column", marginTop: 1, children: [
|
|
30117
|
+
/* @__PURE__ */ jsx62(Text55, { bold: true, children: "Summary" }),
|
|
30229
30118
|
outcome.results.map((result) => {
|
|
30230
30119
|
if (result.status === "completed") {
|
|
30231
|
-
return /* @__PURE__ */
|
|
30120
|
+
return /* @__PURE__ */ jsxs52(Text55, { color: PALETTE.success, children: [
|
|
30232
30121
|
"\u2713 ",
|
|
30233
30122
|
result.name
|
|
30234
30123
|
] }, result.name);
|
|
30235
30124
|
}
|
|
30236
30125
|
if (result.status === "skipped") {
|
|
30237
|
-
return /* @__PURE__ */
|
|
30126
|
+
return /* @__PURE__ */ jsxs52(Text55, { dimColor: true, children: [
|
|
30238
30127
|
"\u2013 ",
|
|
30239
30128
|
result.name,
|
|
30240
30129
|
" \u2014 skipped"
|
|
30241
30130
|
] }, result.name);
|
|
30242
30131
|
}
|
|
30243
|
-
return /* @__PURE__ */
|
|
30132
|
+
return /* @__PURE__ */ jsxs52(Text55, { color: result.required ? PALETTE.error : PALETTE.warning, children: [
|
|
30244
30133
|
result.required ? "\u2717" : "\u26A0",
|
|
30245
30134
|
" ",
|
|
30246
30135
|
result.name,
|
|
@@ -30248,10 +30137,10 @@ function SetupSummary({ outcome, notice }) {
|
|
|
30248
30137
|
result.required ? "required" : "optional"
|
|
30249
30138
|
] }, result.name);
|
|
30250
30139
|
}),
|
|
30251
|
-
notice && /* @__PURE__ */
|
|
30252
|
-
/* @__PURE__ */
|
|
30253
|
-
requiredFailed > 0 && /* @__PURE__ */
|
|
30254
|
-
/* @__PURE__ */
|
|
30140
|
+
notice && /* @__PURE__ */ jsx62(Box51, { marginTop: 1, children: /* @__PURE__ */ jsx62(Text55, { color: PALETTE.warning, children: notice }) }),
|
|
30141
|
+
/* @__PURE__ */ jsx62(Box51, { marginTop: 1, children: /* @__PURE__ */ jsx62(Text55, { bold: true, color: requiredFailed === 0 ? PALETTE.success : PALETTE.warning, children: formatSetupCompletionMessage(outcome.results) }) }),
|
|
30142
|
+
requiredFailed > 0 && /* @__PURE__ */ jsx62(Text55, { dimColor: true, children: "Complete the steps above, then re-run experiences setup." }),
|
|
30143
|
+
/* @__PURE__ */ jsx62(Text55, { dimColor: true, children: "Run experiences doctor any time to re-check." })
|
|
30255
30144
|
] });
|
|
30256
30145
|
}
|
|
30257
30146
|
var init_SetupScreen = __esm({
|