@contentful/experience-design-system-cli 2.37.1-dev-build-a6ef2d40.0 → 2.37.1-dev-build-25425992.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +282 -199
- package/dist/index.js +284 -200
- package/dist/package.json +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -19802,8 +19802,71 @@ var init_validate4 = __esm({
|
|
|
19802
19802
|
|
|
19803
19803
|
// packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx
|
|
19804
19804
|
import { useRef as useRef2, useState as useState9 } from "react";
|
|
19805
|
-
import { Text as Text14 } from "ink";
|
|
19805
|
+
import { Box as Box14, Text as Text14, useInput as useInput11 } from "ink";
|
|
19806
19806
|
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
19807
|
+
function CredentialsReview({
|
|
19808
|
+
values,
|
|
19809
|
+
subtitle,
|
|
19810
|
+
notice,
|
|
19811
|
+
validating,
|
|
19812
|
+
onChoose,
|
|
19813
|
+
children
|
|
19814
|
+
}) {
|
|
19815
|
+
const [focus, setFocus] = useState9(0);
|
|
19816
|
+
useInput11((_input, key) => {
|
|
19817
|
+
if (validating) return;
|
|
19818
|
+
if (key.escape) onChoose("quit");
|
|
19819
|
+
else if (key.return) onChoose(MENU[focus].choice);
|
|
19820
|
+
else if (key.upArrow) setFocus((current) => (current - 1 + MENU.length) % MENU.length);
|
|
19821
|
+
else if (key.downArrow || key.tab) setFocus((current) => (current + 1) % MENU.length);
|
|
19822
|
+
});
|
|
19823
|
+
const labelWidth = formLabelWidth([...FIELDS2, ...MENU]);
|
|
19824
|
+
return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", children: [
|
|
19825
|
+
/* @__PURE__ */ jsx15(StepHeader, { step: "setup" }),
|
|
19826
|
+
/* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", paddingX: 2, paddingBottom: 1, children: [
|
|
19827
|
+
/* @__PURE__ */ jsx15(Text14, { bold: true, children: "Contentful Credentials" }),
|
|
19828
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
19829
|
+
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: subtitle }),
|
|
19830
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
19831
|
+
MENU.map((item, index) => {
|
|
19832
|
+
const focused = index === focus;
|
|
19833
|
+
return /* @__PURE__ */ jsxs14(Box14, { gap: 1, children: [
|
|
19834
|
+
/* @__PURE__ */ jsx15(Text14, { color: focused ? PALETTE.accent : void 0, children: focused ? "\u276F" : " " }),
|
|
19835
|
+
/* @__PURE__ */ jsx15(Box14, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx15(Text14, { bold: focused, color: focused ? PALETTE.accent : PALETTE.muted, children: item.label }) }),
|
|
19836
|
+
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: item.description })
|
|
19837
|
+
] }, item.choice);
|
|
19838
|
+
}),
|
|
19839
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
19840
|
+
FIELDS2.map((field) => {
|
|
19841
|
+
const value = values[field.key];
|
|
19842
|
+
return /* @__PURE__ */ jsx15(FormReadOnlyRow, { label: field.label, labelWidth, children: /* @__PURE__ */ jsx15(Text14, { bold: value !== "", children: field.masked ? "\u2022".repeat(value.length) : value || "(empty)" }) }, field.key);
|
|
19843
|
+
}),
|
|
19844
|
+
notice && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
19845
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
19846
|
+
/* @__PURE__ */ jsxs14(Text14, { color: PALETTE.error, children: [
|
|
19847
|
+
"\u2717 ",
|
|
19848
|
+
notice.text
|
|
19849
|
+
] })
|
|
19850
|
+
] }),
|
|
19851
|
+
validating && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
19852
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
19853
|
+
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.accent, children: "Validating credentials..." })
|
|
19854
|
+
] }),
|
|
19855
|
+
children,
|
|
19856
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
19857
|
+
/* @__PURE__ */ jsx15(
|
|
19858
|
+
ControlHints,
|
|
19859
|
+
{
|
|
19860
|
+
hints: [
|
|
19861
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
19862
|
+
{ keys: "\u23CE", label: MENU[focus].label.toLowerCase() },
|
|
19863
|
+
{ keys: "Esc", label: "back" }
|
|
19864
|
+
]
|
|
19865
|
+
}
|
|
19866
|
+
)
|
|
19867
|
+
] })
|
|
19868
|
+
] });
|
|
19869
|
+
}
|
|
19807
19870
|
function CredentialsScreen({
|
|
19808
19871
|
onDone,
|
|
19809
19872
|
onBack,
|
|
@@ -19823,6 +19886,7 @@ function CredentialsScreen({
|
|
|
19823
19886
|
const [notice, setNotice] = useState9(null);
|
|
19824
19887
|
const [validating, setValidating] = useState9(false);
|
|
19825
19888
|
const prefilled = initialValues.spaceId !== "" && initialValues.cmaToken !== "";
|
|
19889
|
+
const [editing, setEditing] = useState9(!prefilled);
|
|
19826
19890
|
const submit = async () => {
|
|
19827
19891
|
const credentials = normalize(values);
|
|
19828
19892
|
if (missingField(credentials)) {
|
|
@@ -19835,12 +19899,27 @@ function CredentialsScreen({
|
|
|
19835
19899
|
if (result.ok) onDone({ skipped: false, credentials });
|
|
19836
19900
|
else setNotice({ kind: "error", text: result.error });
|
|
19837
19901
|
};
|
|
19902
|
+
const subtitle = prefilled ? "Credentials pre-filled from the configuration settings." : "Enter the Contentful space you want to import into.";
|
|
19903
|
+
const choose = (choice) => {
|
|
19904
|
+
if (choice === "continue") void submit();
|
|
19905
|
+
else if (choice === "edit") {
|
|
19906
|
+
setNotice(null);
|
|
19907
|
+
setEditing(true);
|
|
19908
|
+
} else if (choice === "skip") onDone({ skipped: true });
|
|
19909
|
+
else onBack();
|
|
19910
|
+
};
|
|
19911
|
+
if (!editing) {
|
|
19912
|
+
return /* @__PURE__ */ jsx15(CredentialsReview, { values, subtitle, notice, validating, onChoose: choose, children: !isUnchanged(normalize(values), initialValues) && /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
19913
|
+
/* @__PURE__ */ jsx15(Text14, { children: " " }),
|
|
19914
|
+
/* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: "Changed values are saved after they validate." })
|
|
19915
|
+
] }) });
|
|
19916
|
+
}
|
|
19838
19917
|
return /* @__PURE__ */ jsxs14(
|
|
19839
19918
|
FieldForm,
|
|
19840
19919
|
{
|
|
19841
19920
|
header: /* @__PURE__ */ jsx15(StepHeader, { step: "setup" }),
|
|
19842
19921
|
title: "Contentful Credentials",
|
|
19843
|
-
subtitle
|
|
19922
|
+
subtitle,
|
|
19844
19923
|
fields: FIELDS2,
|
|
19845
19924
|
values,
|
|
19846
19925
|
onChange: (key, value) => {
|
|
@@ -19850,10 +19929,8 @@ function CredentialsScreen({
|
|
|
19850
19929
|
enterAdvances: true,
|
|
19851
19930
|
onSave: () => void submit(),
|
|
19852
19931
|
saveLabel: "continue",
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
onQuit: onBack,
|
|
19856
|
-
quitLabel: "back",
|
|
19932
|
+
onQuit: prefilled ? () => setEditing(false) : onBack,
|
|
19933
|
+
quitLabel: prefilled ? "stop editing" : "back",
|
|
19857
19934
|
notice,
|
|
19858
19935
|
busy: validating,
|
|
19859
19936
|
children: [
|
|
@@ -19874,12 +19951,13 @@ function CredentialsScreen({
|
|
|
19874
19951
|
}
|
|
19875
19952
|
);
|
|
19876
19953
|
}
|
|
19877
|
-
var FIELDS2;
|
|
19954
|
+
var FIELDS2, MENU;
|
|
19878
19955
|
var init_screen5 = __esm({
|
|
19879
19956
|
"packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx"() {
|
|
19880
19957
|
"use strict";
|
|
19881
19958
|
init_theme();
|
|
19882
19959
|
init_FieldForm();
|
|
19960
|
+
init_ControlHints();
|
|
19883
19961
|
init_StepHeader();
|
|
19884
19962
|
init_logic8();
|
|
19885
19963
|
init_validate4();
|
|
@@ -19889,6 +19967,12 @@ var init_screen5 = __esm({
|
|
|
19889
19967
|
{ key: "cmaToken", label: "CMA Token", masked: true },
|
|
19890
19968
|
{ key: "host", label: "API Host", hint: "(default: api.contentful.com \xB7 EU spaces: api.eu.contentful.com)" }
|
|
19891
19969
|
];
|
|
19970
|
+
MENU = [
|
|
19971
|
+
{ choice: "continue", label: "Continue", description: "Check the credentials and go on" },
|
|
19972
|
+
{ choice: "edit", label: "Edit", description: "Change the credentials" },
|
|
19973
|
+
{ choice: "skip", label: "Skip", description: "Save files only, nothing is pushed" },
|
|
19974
|
+
{ choice: "quit", label: "Quit", description: "Go back" }
|
|
19975
|
+
];
|
|
19892
19976
|
}
|
|
19893
19977
|
});
|
|
19894
19978
|
|
|
@@ -20498,7 +20582,7 @@ var init_columns = __esm({
|
|
|
20498
20582
|
});
|
|
20499
20583
|
|
|
20500
20584
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/windowed-panel.tsx
|
|
20501
|
-
import { Box as
|
|
20585
|
+
import { Box as Box15, Text as Text15 } from "ink";
|
|
20502
20586
|
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
20503
20587
|
function terminalPanelHeight(rows, reservedRows = 4) {
|
|
20504
20588
|
return Math.max(MIN_TERMINAL_PANEL_HEIGHT, rows - reservedRows);
|
|
@@ -20515,7 +20599,7 @@ function FixedPanel({
|
|
|
20515
20599
|
children
|
|
20516
20600
|
}) {
|
|
20517
20601
|
return /* @__PURE__ */ jsx17(
|
|
20518
|
-
|
|
20602
|
+
Box15,
|
|
20519
20603
|
{
|
|
20520
20604
|
flexDirection: "column",
|
|
20521
20605
|
width,
|
|
@@ -20551,7 +20635,7 @@ function WindowedPanelHeader({
|
|
|
20551
20635
|
width,
|
|
20552
20636
|
focused
|
|
20553
20637
|
}) {
|
|
20554
|
-
return /* @__PURE__ */ jsxs15(
|
|
20638
|
+
return /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", children: [
|
|
20555
20639
|
/* @__PURE__ */ jsx17(Text15, { bold: true, color: PALETTE.accent, inverse: focused, children: title }),
|
|
20556
20640
|
/* @__PURE__ */ jsx17(Text15, { color: PALETTE.muted, children: "\u2500".repeat(Math.max(0, width - 2)) })
|
|
20557
20641
|
] });
|
|
@@ -20578,7 +20662,7 @@ var init_windowed_panel = __esm({
|
|
|
20578
20662
|
|
|
20579
20663
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/added-column.tsx
|
|
20580
20664
|
import React10 from "react";
|
|
20581
|
-
import { Box as
|
|
20665
|
+
import { Box as Box16, Text as Text16 } from "ink";
|
|
20582
20666
|
import figures2 from "figures";
|
|
20583
20667
|
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
20584
20668
|
function AddedColumn(props) {
|
|
@@ -20597,7 +20681,7 @@ function AddedColumn(props) {
|
|
|
20597
20681
|
const style = sideColumnLabelStyle({ isCycle: entry.isCycle, isSelected, focused });
|
|
20598
20682
|
return /* @__PURE__ */ jsxs16(React10.Fragment, { children: [
|
|
20599
20683
|
showSeparator && /* @__PURE__ */ jsx18(Text16, { color: PALETTE.muted, children: "\u2500".repeat(Math.max(0, width - 2)) }),
|
|
20600
|
-
/* @__PURE__ */ jsxs16(
|
|
20684
|
+
/* @__PURE__ */ jsxs16(Box16, { children: [
|
|
20601
20685
|
isCursor ? /* @__PURE__ */ jsx18(Text16, { color: PALETTE.accent, bold: true, children: figures2.pointer }) : /* @__PURE__ */ jsx18(Text16, { children: " " }),
|
|
20602
20686
|
reserveAiBadge && (aiFlagged ? /* @__PURE__ */ jsx18(Text16, { color: PALETTE.warning, bold: true, children: " [\xD7]" }) : /* @__PURE__ */ jsx18(Text16, { children: " " })),
|
|
20603
20687
|
entry.isCycle && /* @__PURE__ */ jsx18(Text16, { color: isCursor ? PALETTE.accent : PALETTE.warning, bold: true, underline: style.nameUnderline, children: " \u26A0" }),
|
|
@@ -20628,7 +20712,7 @@ var init_added_column = __esm({
|
|
|
20628
20712
|
});
|
|
20629
20713
|
|
|
20630
20714
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/cycles-panel.tsx
|
|
20631
|
-
import { Box as
|
|
20715
|
+
import { Box as Box17, Text as Text17 } from "ink";
|
|
20632
20716
|
import figures3 from "figures";
|
|
20633
20717
|
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
20634
20718
|
function cycleLabel(cycle, index) {
|
|
@@ -20641,7 +20725,7 @@ function cycleLabel(cycle, index) {
|
|
|
20641
20725
|
return `Cycle ${index + 1}: ${parts.join(" \u2192 ")}`;
|
|
20642
20726
|
}
|
|
20643
20727
|
function CyclesPanel({ cycles, cursor }) {
|
|
20644
|
-
return /* @__PURE__ */ jsxs17(
|
|
20728
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.warning, paddingX: 1, marginTop: 1, children: [
|
|
20645
20729
|
/* @__PURE__ */ jsx19(Text17, { bold: true, color: PALETTE.warning, children: `Cycles detected (${cycles.length}):` }),
|
|
20646
20730
|
/* @__PURE__ */ jsx19(Text17, { children: " " }),
|
|
20647
20731
|
cycles.map((cycle, i) => {
|
|
@@ -20662,10 +20746,10 @@ var init_cycles_panel = __esm({
|
|
|
20662
20746
|
});
|
|
20663
20747
|
|
|
20664
20748
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/reject-prompt.tsx
|
|
20665
|
-
import { Box as
|
|
20749
|
+
import { Box as Box18, Text as Text18 } from "ink";
|
|
20666
20750
|
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
20667
20751
|
function RejectPrompt({ pending }) {
|
|
20668
|
-
return /* @__PURE__ */ jsxs18(
|
|
20752
|
+
return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.warning, paddingX: 1, marginTop: 1, children: [
|
|
20669
20753
|
/* @__PURE__ */ jsx20(Text18, { bold: true, color: PALETTE.warning, children: `Rejecting ${pending.target} will:` }),
|
|
20670
20754
|
pending.ancestors.length > 0 && /* @__PURE__ */ jsx20(Text18, { children: `- Reject ancestors: ${pending.ancestors.join(", ")}` }),
|
|
20671
20755
|
pending.descendants.length > 0 && /* @__PURE__ */ jsx20(Text18, { children: `- Deselect descendants: ${pending.descendants.join(", ")}` }),
|
|
@@ -20705,7 +20789,7 @@ var init_CompactControlBar = __esm({
|
|
|
20705
20789
|
});
|
|
20706
20790
|
|
|
20707
20791
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/CounterStrip.tsx
|
|
20708
|
-
import { Box as
|
|
20792
|
+
import { Box as Box19, Text as Text19 } from "ink";
|
|
20709
20793
|
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
20710
20794
|
function CounterStrip(props) {
|
|
20711
20795
|
const { counters, totalWidth } = props;
|
|
@@ -20714,7 +20798,7 @@ function CounterStrip(props) {
|
|
|
20714
20798
|
const labelRej = condensed ? "Rej" : "Rejected";
|
|
20715
20799
|
const labelUnd = condensed ? "Und" : "Undecided";
|
|
20716
20800
|
const sep = condensed ? " | " : " ";
|
|
20717
|
-
return /* @__PURE__ */ jsx22(
|
|
20801
|
+
return /* @__PURE__ */ jsx22(Box19, { children: /* @__PURE__ */ jsxs19(Text19, { children: [
|
|
20718
20802
|
/* @__PURE__ */ jsxs19(Text19, { color: PALETTE.muted, children: [
|
|
20719
20803
|
labelGrp,
|
|
20720
20804
|
" "
|
|
@@ -20744,7 +20828,7 @@ var init_CounterStrip = __esm({
|
|
|
20744
20828
|
|
|
20745
20829
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/GotoBanner.tsx
|
|
20746
20830
|
import figures4 from "figures";
|
|
20747
|
-
import { Box as
|
|
20831
|
+
import { Box as Box20, Text as Text20 } from "ink";
|
|
20748
20832
|
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
20749
20833
|
function windowStart(rowCount, highlightIndex, maxRows) {
|
|
20750
20834
|
if (rowCount <= maxRows) return 0;
|
|
@@ -20777,7 +20861,7 @@ function GotoBanner({
|
|
|
20777
20861
|
const moreAbove = start;
|
|
20778
20862
|
const moreBelow = rows.length - end;
|
|
20779
20863
|
return /* @__PURE__ */ jsxs20(
|
|
20780
|
-
|
|
20864
|
+
Box20,
|
|
20781
20865
|
{
|
|
20782
20866
|
flexDirection: "column",
|
|
20783
20867
|
borderStyle: "single",
|
|
@@ -21188,7 +21272,7 @@ var init_badge = __esm({
|
|
|
21188
21272
|
|
|
21189
21273
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.tsx
|
|
21190
21274
|
import figures5 from "figures";
|
|
21191
|
-
import { Box as
|
|
21275
|
+
import { Box as Box21, Text as Text22 } from "ink";
|
|
21192
21276
|
import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
21193
21277
|
function hasDirectChild(node) {
|
|
21194
21278
|
return node.slots.some((slot) => (slot.allowedComponents ?? []).some((target) => target !== node.name));
|
|
@@ -21639,7 +21723,7 @@ function GroupedSidebar(props) {
|
|
|
21639
21723
|
isOwn: rs?.isOwn ?? false,
|
|
21640
21724
|
isCursor
|
|
21641
21725
|
});
|
|
21642
|
-
return /* @__PURE__ */ jsxs21(
|
|
21726
|
+
return /* @__PURE__ */ jsxs21(Box21, { children: [
|
|
21643
21727
|
isCursor ? /* @__PURE__ */ jsx25(Text22, { color: PALETTE.accent, bold: true, children: figures5.pointer }) : /* @__PURE__ */ jsx25(Text22, { children: " " }),
|
|
21644
21728
|
/* @__PURE__ */ jsx25(PreviewBadge, { badge, highlighted: isSelected }),
|
|
21645
21729
|
selectionStateByKey !== void 0 && (selGlyph && !isSynthetic ? /* @__PURE__ */ jsx25(Text22, { color: !isSelected && selDim ? PALETTE.muted : selColor, bold: selBold, children: " " + selGlyph }) : /* @__PURE__ */ jsx25(Text22, { children: " " })),
|
|
@@ -21790,7 +21874,7 @@ var init_use_terminal_size = __esm({
|
|
|
21790
21874
|
|
|
21791
21875
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/HelpOverlay.tsx
|
|
21792
21876
|
import React11 from "react";
|
|
21793
|
-
import { Box as
|
|
21877
|
+
import { Box as Box22, Text as Text23 } from "ink";
|
|
21794
21878
|
import { Fragment as Fragment3, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
21795
21879
|
function HelpOverlay(props) {
|
|
21796
21880
|
const { onClose } = props;
|
|
@@ -21803,7 +21887,7 @@ function HelpOverlay(props) {
|
|
|
21803
21887
|
}, props.handleInput !== false);
|
|
21804
21888
|
if (props.sections) {
|
|
21805
21889
|
return /* @__PURE__ */ jsxs22(
|
|
21806
|
-
|
|
21890
|
+
Box22,
|
|
21807
21891
|
{
|
|
21808
21892
|
flexDirection: "column",
|
|
21809
21893
|
borderStyle: "round",
|
|
@@ -21824,7 +21908,7 @@ function HelpOverlay(props) {
|
|
|
21824
21908
|
}
|
|
21825
21909
|
const mode = props.mode;
|
|
21826
21910
|
return /* @__PURE__ */ jsxs22(
|
|
21827
|
-
|
|
21911
|
+
Box22,
|
|
21828
21912
|
{
|
|
21829
21913
|
flexDirection: "column",
|
|
21830
21914
|
borderStyle: "round",
|
|
@@ -21937,7 +22021,7 @@ var init_sidebar_input = __esm({
|
|
|
21937
22021
|
});
|
|
21938
22022
|
|
|
21939
22023
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/SearchMatchSummary.tsx
|
|
21940
|
-
import { Box as
|
|
22024
|
+
import { Box as Box23, Text as Text24 } from "ink";
|
|
21941
22025
|
import { Fragment as Fragment4, jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
21942
22026
|
function SearchMatchSummary({
|
|
21943
22027
|
open,
|
|
@@ -21950,7 +22034,7 @@ function SearchMatchSummary({
|
|
|
21950
22034
|
}) {
|
|
21951
22035
|
if (hidden) return null;
|
|
21952
22036
|
return /* @__PURE__ */ jsxs23(Fragment4, { children: [
|
|
21953
|
-
open && /* @__PURE__ */ jsxs23(
|
|
22037
|
+
open && /* @__PURE__ */ jsxs23(Box23, { marginTop, flexDirection: "column", children: [
|
|
21954
22038
|
/* @__PURE__ */ jsxs23(Text24, { children: [
|
|
21955
22039
|
`/${query}`,
|
|
21956
22040
|
/* @__PURE__ */ jsx27(Text24, { color: PALETTE.accent, children: "\u258E" }),
|
|
@@ -21959,7 +22043,7 @@ function SearchMatchSummary({
|
|
|
21959
22043
|
] }),
|
|
21960
22044
|
autocompleteCandidates.length > 1 && /* @__PURE__ */ jsx27(Text24, { color: PALETTE.muted, children: ` possibilities: ${autocompleteCandidates.join(" \xB7 ").slice(0, 120)}` })
|
|
21961
22045
|
] }),
|
|
21962
|
-
!open && query && /* @__PURE__ */ jsx27(
|
|
22046
|
+
!open && query && /* @__PURE__ */ jsx27(Box23, { marginTop, children: /* @__PURE__ */ jsx27(Text24, { children: `/${query}${formatSearchMatchSummary(matches, total)} \xB7 [Esc] clear` }) })
|
|
21963
22047
|
] });
|
|
21964
22048
|
}
|
|
21965
22049
|
var init_SearchMatchSummary = __esm({
|
|
@@ -23219,11 +23303,11 @@ var init_use_scope_gate = __esm({
|
|
|
23219
23303
|
});
|
|
23220
23304
|
|
|
23221
23305
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/screen.tsx
|
|
23222
|
-
import { Box as
|
|
23306
|
+
import { Box as Box24, Text as Text25 } from "ink";
|
|
23223
23307
|
import { Fragment as Fragment5, jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
23224
23308
|
function ScopeGateScreen(props) {
|
|
23225
23309
|
if (props.components.length === 0) {
|
|
23226
|
-
return /* @__PURE__ */ jsx28(
|
|
23310
|
+
return /* @__PURE__ */ jsx28(Box24, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx28(Text25, { color: PALETTE.error, children: "Error: no components found for this session \u2014 please re-run analyze extract." }) });
|
|
23227
23311
|
}
|
|
23228
23312
|
return /* @__PURE__ */ jsx28(ScopeGateView, { ...props });
|
|
23229
23313
|
}
|
|
@@ -23233,18 +23317,18 @@ function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
|
23233
23317
|
if (gate.showHelp) {
|
|
23234
23318
|
return /* @__PURE__ */ jsx28(HelpOverlay, { sections: HELP_SECTIONS, handleInput: false, onClose: gate.closeHelp });
|
|
23235
23319
|
}
|
|
23236
|
-
return /* @__PURE__ */ jsxs24(
|
|
23320
|
+
return /* @__PURE__ */ jsxs24(Box24, { flexDirection: "column", children: [
|
|
23237
23321
|
/* @__PURE__ */ jsx28(StepHeader, { step: "scope-gate" }),
|
|
23238
|
-
/* @__PURE__ */ jsxs24(
|
|
23239
|
-
/* @__PURE__ */ jsxs24(
|
|
23322
|
+
/* @__PURE__ */ jsxs24(Box24, { flexDirection: "column", paddingX: 2, children: [
|
|
23323
|
+
/* @__PURE__ */ jsxs24(Box24, { flexDirection: "row", flexWrap: "wrap", children: [
|
|
23240
23324
|
/* @__PURE__ */ jsx28(CounterStrip, { counters, totalWidth: gate.totalWidth }),
|
|
23241
23325
|
gate.aiExcludedCount > 0 && /* @__PURE__ */ jsxs24(Text25, { color: PALETTE.muted, children: [
|
|
23242
23326
|
`${gate.aiExcludedCount} component${gate.aiExcludedCount === 1 ? "" : "s"} flagged by AI`,
|
|
23243
23327
|
gate.aiRows.length > 0 && /* @__PURE__ */ jsx28(Text25, { color: PALETTE.accent, children: " \u2014 press [x] to see why" })
|
|
23244
23328
|
] })
|
|
23245
23329
|
] }),
|
|
23246
|
-
graph.cycles.length > 0 && /* @__PURE__ */ jsx28(
|
|
23247
|
-
/* @__PURE__ */ jsxs24(
|
|
23330
|
+
graph.cycles.length > 0 && /* @__PURE__ */ jsx28(Box24, { marginTop: 1, children: /* @__PURE__ */ jsx28(Text25, { color: PALETTE.muted, children: "If you must have components with cycles, select them together into the generate step and then use the editor to fix them." }) }),
|
|
23331
|
+
/* @__PURE__ */ jsxs24(Box24, { flexDirection: "row", alignItems: "stretch", children: [
|
|
23248
23332
|
gate.aiRationalePanelOpen ? /* @__PURE__ */ jsx28(
|
|
23249
23333
|
GotoBanner,
|
|
23250
23334
|
{
|
|
@@ -23284,7 +23368,7 @@ function ScopeGateView({ components, onConfirm, onQuit }) {
|
|
|
23284
23368
|
}
|
|
23285
23369
|
),
|
|
23286
23370
|
columnPlan.layout === "two-column" && /* @__PURE__ */ jsxs24(Fragment5, { children: [
|
|
23287
|
-
/* @__PURE__ */ jsx28(
|
|
23371
|
+
/* @__PURE__ */ jsx28(Box24, { width: 2, flexShrink: 0 }),
|
|
23288
23372
|
/* @__PURE__ */ jsx28(
|
|
23289
23373
|
AddedColumn,
|
|
23290
23374
|
{
|
|
@@ -23474,7 +23558,7 @@ function formatAcceptanceSummary(counts) {
|
|
|
23474
23558
|
function describeGeneration(input) {
|
|
23475
23559
|
const agent = capitalize(input.agent);
|
|
23476
23560
|
return `${formatAcceptanceSummary({ accepted: input.acceptedCount, autoRejected: 0 })}
|
|
23477
|
-
${agent} is
|
|
23561
|
+
${agent} is reading each selected component and writing a Contentful component definition for it${input.hasTokens ? " Using your design tokens for prop resolution." : ""}`;
|
|
23478
23562
|
}
|
|
23479
23563
|
function progressRows2(progress, agent) {
|
|
23480
23564
|
const name = capitalize(agent);
|
|
@@ -24574,7 +24658,7 @@ var init_scroll_offset = __esm({
|
|
|
24574
24658
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx
|
|
24575
24659
|
import React12, { useEffect as useEffect11, useLayoutEffect as useLayoutEffect2, useState as useState18 } from "react";
|
|
24576
24660
|
import figures6 from "figures";
|
|
24577
|
-
import { Box as
|
|
24661
|
+
import { Box as Box25, measureElement, Text as Text26 } from "ink";
|
|
24578
24662
|
import { Fragment as Fragment6, jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
24579
24663
|
function createCommonRowProps(selected, focusLevel, editingField, textCursor, valueCursor, cursorVisible, editingValue, valueText, width) {
|
|
24580
24664
|
return {
|
|
@@ -24713,14 +24797,14 @@ function serializeState(state2, originalJson) {
|
|
|
24713
24797
|
return JSON.stringify(entry, null, 2);
|
|
24714
24798
|
}
|
|
24715
24799
|
function Picker({ value, active }) {
|
|
24716
|
-
return /* @__PURE__ */ jsxs25(
|
|
24800
|
+
return /* @__PURE__ */ jsxs25(Box25, { children: [
|
|
24717
24801
|
active && /* @__PURE__ */ jsx31(Text26, { color: PALETTE.warning, children: "\u2039" }),
|
|
24718
24802
|
/* @__PURE__ */ jsx31(Text26, { color: active ? PALETTE.warning : void 0, bold: active, children: value }),
|
|
24719
24803
|
active && /* @__PURE__ */ jsx31(Text26, { color: PALETTE.warning, children: "\u203A" })
|
|
24720
24804
|
] });
|
|
24721
24805
|
}
|
|
24722
24806
|
function Toggle({ value, active }) {
|
|
24723
|
-
return /* @__PURE__ */ jsx31(
|
|
24807
|
+
return /* @__PURE__ */ jsx31(Box25, { children: /* @__PURE__ */ jsx31(Text26, { color: active ? PALETTE.warning : value ? PALETTE.success : PALETTE.border, children: value ? "[\u2713]" : "[ ]" }) });
|
|
24724
24808
|
}
|
|
24725
24809
|
function InlinePropField({
|
|
24726
24810
|
label,
|
|
@@ -24729,7 +24813,7 @@ function InlinePropField({
|
|
|
24729
24813
|
flexible = false,
|
|
24730
24814
|
width
|
|
24731
24815
|
}) {
|
|
24732
|
-
return /* @__PURE__ */ jsxs25(
|
|
24816
|
+
return /* @__PURE__ */ jsxs25(Box25, { width, gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, flexWrap: "wrap", children: [
|
|
24733
24817
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, wrap: "truncate-end", children: [
|
|
24734
24818
|
focused ? "\u203A " : " ",
|
|
24735
24819
|
label
|
|
@@ -24750,7 +24834,7 @@ function DefaultValueRow({
|
|
|
24750
24834
|
active,
|
|
24751
24835
|
focused
|
|
24752
24836
|
}) {
|
|
24753
|
-
return /* @__PURE__ */ jsxs25(
|
|
24837
|
+
return /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexWrap: "wrap", flexShrink: 0, children: [
|
|
24754
24838
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
24755
24839
|
focused ? "\u203A " : " ",
|
|
24756
24840
|
"default:"
|
|
@@ -24783,7 +24867,7 @@ function ValueInputRow({
|
|
|
24783
24867
|
valueText,
|
|
24784
24868
|
cursorVisible
|
|
24785
24869
|
}) {
|
|
24786
|
-
return /* @__PURE__ */ jsxs25(
|
|
24870
|
+
return /* @__PURE__ */ jsxs25(Box25, { paddingLeft: 2, children: [
|
|
24787
24871
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.accent, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
24788
24872
|
/* @__PURE__ */ jsx31(Text26, { children: valueText }),
|
|
24789
24873
|
/* @__PURE__ */ jsx31(Text26, { inverse: cursorVisible, children: " " })
|
|
@@ -24801,7 +24885,7 @@ function EditableListItem({
|
|
|
24801
24885
|
if (isBeingEdited) {
|
|
24802
24886
|
return /* @__PURE__ */ jsx31(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
24803
24887
|
}
|
|
24804
|
-
return /* @__PURE__ */ jsx31(
|
|
24888
|
+
return /* @__PURE__ */ jsx31(Box25, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx31(Text26, { color: active ? PALETTE.accent : void 0, children: active ? `${figures6.pointer} ${value}` : ` ${value}` }) });
|
|
24805
24889
|
}
|
|
24806
24890
|
function EditableValueList({
|
|
24807
24891
|
values,
|
|
@@ -24815,7 +24899,7 @@ function EditableValueList({
|
|
|
24815
24899
|
showAddInput
|
|
24816
24900
|
}) {
|
|
24817
24901
|
return /* @__PURE__ */ jsxs25(Fragment6, { children: [
|
|
24818
|
-
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: emptyMessage }) : /* @__PURE__ */ jsx31(
|
|
24902
|
+
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: emptyMessage }) : /* @__PURE__ */ jsx31(Box25, { paddingLeft: emptyPaddingLeft, children: /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: emptyMessage }) })),
|
|
24819
24903
|
values.map((value, index) => /* @__PURE__ */ jsx31(
|
|
24820
24904
|
EditableListItem,
|
|
24821
24905
|
{
|
|
@@ -24840,7 +24924,7 @@ function DefaultSubRow({
|
|
|
24840
24924
|
}) {
|
|
24841
24925
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
24842
24926
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
24843
|
-
return /* @__PURE__ */ jsxs25(
|
|
24927
|
+
return /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexShrink: 0, children: [
|
|
24844
24928
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
24845
24929
|
focused ? "\u203A " : " ",
|
|
24846
24930
|
"default:"
|
|
@@ -24854,7 +24938,7 @@ function DefaultSubRow({
|
|
|
24854
24938
|
}
|
|
24855
24939
|
if (prop.type === "enum") {
|
|
24856
24940
|
if (prop.values.length === 0) {
|
|
24857
|
-
return /* @__PURE__ */ jsxs25(
|
|
24941
|
+
return /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexShrink: 0, children: [
|
|
24858
24942
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
24859
24943
|
focused ? "\u203A " : " ",
|
|
24860
24944
|
"default:"
|
|
@@ -24867,19 +24951,19 @@ function DefaultSubRow({
|
|
|
24867
24951
|
}
|
|
24868
24952
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
24869
24953
|
if (active) {
|
|
24870
|
-
return /* @__PURE__ */ jsxs25(
|
|
24954
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "row", flexShrink: 0, children: [
|
|
24871
24955
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
24872
24956
|
focused ? "\u203A " : " ",
|
|
24873
24957
|
"default:"
|
|
24874
24958
|
] }),
|
|
24875
|
-
/* @__PURE__ */ jsxs25(
|
|
24959
|
+
/* @__PURE__ */ jsxs25(Box25, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
24876
24960
|
/* @__PURE__ */ jsx31(Text26, { children: value.slice(0, textCursor) }),
|
|
24877
24961
|
/* @__PURE__ */ jsx31(Text26, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
24878
24962
|
/* @__PURE__ */ jsx31(Text26, { children: value.slice(textCursor + 1) })
|
|
24879
24963
|
] })
|
|
24880
24964
|
] });
|
|
24881
24965
|
}
|
|
24882
|
-
return /* @__PURE__ */ jsxs25(
|
|
24966
|
+
return /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexShrink: 0, children: [
|
|
24883
24967
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
24884
24968
|
focused ? "\u203A " : " ",
|
|
24885
24969
|
"default:"
|
|
@@ -24899,7 +24983,7 @@ function DescriptionField({
|
|
|
24899
24983
|
paddingLeft = 2
|
|
24900
24984
|
}) {
|
|
24901
24985
|
if (compact) {
|
|
24902
|
-
return /* @__PURE__ */ jsxs25(
|
|
24986
|
+
return /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
24903
24987
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
24904
24988
|
focused ? "\u203A " : " ",
|
|
24905
24989
|
label
|
|
@@ -24907,7 +24991,7 @@ function DescriptionField({
|
|
|
24907
24991
|
/* @__PURE__ */ jsx31(Text26, { wrap: "truncate-end", color: value ? void 0 : PALETTE.muted, children: value || "\u2014" })
|
|
24908
24992
|
] });
|
|
24909
24993
|
}
|
|
24910
|
-
return /* @__PURE__ */ jsxs25(
|
|
24994
|
+
return /* @__PURE__ */ jsxs25(Box25, { paddingLeft, flexDirection: "column", width, flexShrink: 0, children: [
|
|
24911
24995
|
/* @__PURE__ */ jsxs25(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
24912
24996
|
focused ? "\u203A " : " ",
|
|
24913
24997
|
label
|
|
@@ -24943,8 +25027,8 @@ function PropRow({
|
|
|
24943
25027
|
}) {
|
|
24944
25028
|
const descFocused = activeField === "description";
|
|
24945
25029
|
const descActive = editingField && descFocused;
|
|
24946
|
-
return /* @__PURE__ */ jsxs25(
|
|
24947
|
-
/* @__PURE__ */ jsx31(
|
|
25030
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
25031
|
+
/* @__PURE__ */ jsx31(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx31(RowLabel, { name: prop.name, selected }) }),
|
|
24948
25032
|
/* @__PURE__ */ jsx31(
|
|
24949
25033
|
DescriptionField,
|
|
24950
25034
|
{
|
|
@@ -24958,7 +25042,7 @@ function PropRow({
|
|
|
24958
25042
|
paddingLeft: 0
|
|
24959
25043
|
}
|
|
24960
25044
|
),
|
|
24961
|
-
/* @__PURE__ */ jsxs25(
|
|
25045
|
+
/* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
24962
25046
|
/* @__PURE__ */ jsx31(
|
|
24963
25047
|
RequiredField,
|
|
24964
25048
|
{
|
|
@@ -24971,7 +25055,7 @@ function PropRow({
|
|
|
24971
25055
|
/* @__PURE__ */ jsx31(InlinePropField, { label: "type:", focused: activeField === "type", children: editingField && activeField === "type" ? /* @__PURE__ */ jsx31(Picker, { value: prop.type, active: true }) : /* @__PURE__ */ jsx31(Text26, { children: prop.type }) })
|
|
24972
25056
|
] }),
|
|
24973
25057
|
prop.type === "token" && /* @__PURE__ */ jsx31(InlinePropField, { label: "kind:", focused: activeField === "tokenKind", width, children: editingField && activeField === "tokenKind" ? /* @__PURE__ */ jsx31(Picker, { value: prop.tokenKind || DESIGN_TOKEN_TYPES2[0], active: true }) : /* @__PURE__ */ jsx31(Text26, { wrap: "wrap", children: prop.tokenKind || "\u2014" }) }),
|
|
24974
|
-
prop.type === "enum" && /* @__PURE__ */ jsxs25(
|
|
25058
|
+
prop.type === "enum" && /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
24975
25059
|
/* @__PURE__ */ jsxs25(Text26, { color: activeField === "values" ? PALETTE.warning : PALETTE.muted, bold: activeField === "values", children: [
|
|
24976
25060
|
activeField === "values" ? "\u203A " : " ",
|
|
24977
25061
|
"values:"
|
|
@@ -24992,12 +25076,12 @@ function PropRow({
|
|
|
24992
25076
|
cursorVisible
|
|
24993
25077
|
}
|
|
24994
25078
|
),
|
|
24995
|
-
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs25(
|
|
25079
|
+
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
24996
25080
|
/* @__PURE__ */ jsxs25(Text26, { color: activeField === "allowed" ? PALETTE.warning : PALETTE.muted, bold: activeField === "allowed", children: [
|
|
24997
25081
|
activeField === "allowed" ? "\u203A " : " ",
|
|
24998
25082
|
"allowed:"
|
|
24999
25083
|
] }),
|
|
25000
|
-
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx31(
|
|
25084
|
+
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx31(Box25, { width: Math.max(1, width - 4), borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: /* @__PURE__ */ jsx31(Text26, { children: "press [t] to edit allowed tokens" }) }) : /* @__PURE__ */ jsx31(
|
|
25001
25085
|
Text26,
|
|
25002
25086
|
{
|
|
25003
25087
|
color: activeField !== "allowed" && prop.allowed.length === 0 ? PALETTE.muted : void 0,
|
|
@@ -25006,13 +25090,13 @@ function PropRow({
|
|
|
25006
25090
|
}
|
|
25007
25091
|
)
|
|
25008
25092
|
] }),
|
|
25009
|
-
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx31(
|
|
25093
|
+
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx31(Box25, { paddingLeft: 2, children: /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: (() => {
|
|
25010
25094
|
const max = Math.max(8, width - 8);
|
|
25011
25095
|
const text = `~ ${rationale}`;
|
|
25012
25096
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
25013
25097
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
25014
|
-
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs25(
|
|
25015
|
-
/* @__PURE__ */ jsxs25(
|
|
25098
|
+
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs25(Box25, { paddingLeft: 2, flexDirection: "column", children: [
|
|
25099
|
+
/* @__PURE__ */ jsxs25(Box25, { children: [
|
|
25016
25100
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "values:" }),
|
|
25017
25101
|
activeField === "values" && /* @__PURE__ */ jsx31(Text26, { children: " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
25018
25102
|
] }),
|
|
@@ -25046,8 +25130,8 @@ function SlotRow({
|
|
|
25046
25130
|
pickerCandidates,
|
|
25047
25131
|
pickerCursor
|
|
25048
25132
|
}) {
|
|
25049
|
-
return /* @__PURE__ */ jsxs25(
|
|
25050
|
-
/* @__PURE__ */ jsx31(
|
|
25133
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
25134
|
+
/* @__PURE__ */ jsx31(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx31(RowLabel, { name: slot.name, selected, trailing: false }) }),
|
|
25051
25135
|
/* @__PURE__ */ jsx31(
|
|
25052
25136
|
DescriptionField,
|
|
25053
25137
|
{
|
|
@@ -25061,7 +25145,7 @@ function SlotRow({
|
|
|
25061
25145
|
paddingLeft: 0
|
|
25062
25146
|
}
|
|
25063
25147
|
),
|
|
25064
|
-
/* @__PURE__ */ jsx31(
|
|
25148
|
+
/* @__PURE__ */ jsx31(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx31(
|
|
25065
25149
|
RequiredField,
|
|
25066
25150
|
{
|
|
25067
25151
|
value: slot.required,
|
|
@@ -25070,7 +25154,7 @@ function SlotRow({
|
|
|
25070
25154
|
activeField
|
|
25071
25155
|
}
|
|
25072
25156
|
) }),
|
|
25073
|
-
!(selected && editingField && activeField === "allowedComponents") && /* @__PURE__ */ jsxs25(
|
|
25157
|
+
!(selected && editingField && activeField === "allowedComponents") && /* @__PURE__ */ jsxs25(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
25074
25158
|
/* @__PURE__ */ jsxs25(
|
|
25075
25159
|
Text26,
|
|
25076
25160
|
{
|
|
@@ -25084,8 +25168,8 @@ function SlotRow({
|
|
|
25084
25168
|
),
|
|
25085
25169
|
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "(any)" }) : /* @__PURE__ */ jsx31(Text26, { wrap: "wrap", children: slot.allowedComponents.join(", ") })
|
|
25086
25170
|
] }),
|
|
25087
|
-
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs25(
|
|
25088
|
-
/* @__PURE__ */ jsxs25(
|
|
25171
|
+
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", children: [
|
|
25172
|
+
/* @__PURE__ */ jsxs25(Box25, { children: [
|
|
25089
25173
|
/* @__PURE__ */ jsxs25(
|
|
25090
25174
|
Text26,
|
|
25091
25175
|
{
|
|
@@ -25113,7 +25197,7 @@ function SlotRow({
|
|
|
25113
25197
|
showAddInput: editingField && activeField === "allowedComponents"
|
|
25114
25198
|
}
|
|
25115
25199
|
),
|
|
25116
|
-
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx31(
|
|
25200
|
+
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx31(Box25, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "(no valid components to add \u2014 all remaining candidates would create cycles)" }) : (() => {
|
|
25117
25201
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
25118
25202
|
if (filtered.length === 0) {
|
|
25119
25203
|
return /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
@@ -25122,7 +25206,7 @@ function SlotRow({
|
|
|
25122
25206
|
const MAX_VISIBLE = 5;
|
|
25123
25207
|
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor - 2));
|
|
25124
25208
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
25125
|
-
return /* @__PURE__ */ jsxs25(
|
|
25209
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", children: [
|
|
25126
25210
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
25127
25211
|
slice.map((name, i) => {
|
|
25128
25212
|
const absIdx = start + i;
|
|
@@ -25955,14 +26039,14 @@ function FieldEditor({
|
|
|
25955
26039
|
});
|
|
25956
26040
|
const innerWidth = Math.max(1, width - 2);
|
|
25957
26041
|
if (parseErr) {
|
|
25958
|
-
return /* @__PURE__ */ jsxs25(
|
|
26042
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.error, children: [
|
|
25959
26043
|
/* @__PURE__ */ jsx31(Text26, { bold: true, color: PALETTE.error, children: "FIELD EDITOR \u2014 parse error" }),
|
|
25960
26044
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.error, children: parseErr }),
|
|
25961
26045
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "Cannot display structured editor. Fix the JSON first." })
|
|
25962
26046
|
] });
|
|
25963
26047
|
}
|
|
25964
26048
|
if (props.length === 0 && slots.length === 0) {
|
|
25965
|
-
return /* @__PURE__ */ jsxs25(
|
|
26049
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.warning, children: [
|
|
25966
26050
|
/* @__PURE__ */ jsx31(Text26, { bold: true, color: PALETTE.warning, children: "FIELD EDITOR \u2014 no fields" }),
|
|
25967
26051
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
|
|
25968
26052
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "You can add fields manually below or reject this component." }),
|
|
@@ -26095,7 +26179,7 @@ function FieldEditor({
|
|
|
26095
26179
|
const renderRow = (row, index) => {
|
|
26096
26180
|
const key = rowKey(row, index);
|
|
26097
26181
|
if (row.kind === "header") {
|
|
26098
|
-
return /* @__PURE__ */ jsx31(
|
|
26182
|
+
return /* @__PURE__ */ jsx31(Box25, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx31(Text26, { bold: true, color: PALETTE.success, children: row.label }) }, key);
|
|
26099
26183
|
}
|
|
26100
26184
|
if (row.kind === "component-description") {
|
|
26101
26185
|
const isSelected2 = inComponentDesc && active;
|
|
@@ -26181,7 +26265,7 @@ function FieldEditor({
|
|
|
26181
26265
|
children: [
|
|
26182
26266
|
hasEmptyProperties && /* @__PURE__ */ jsx31(Text26, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify. Reject this component or add fields manually." }),
|
|
26183
26267
|
header,
|
|
26184
|
-
/* @__PURE__ */ jsx31(
|
|
26268
|
+
/* @__PURE__ */ jsx31(Box25, { flexDirection: "column", width: innerWidth, flexShrink: 0, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx31(
|
|
26185
26269
|
PropRow,
|
|
26186
26270
|
{
|
|
26187
26271
|
prop: currentProp,
|
|
@@ -26217,7 +26301,7 @@ function FieldEditor({
|
|
|
26217
26301
|
const absoluteIndex = scrollStart + index;
|
|
26218
26302
|
const key = rowKey(row, absoluteIndex);
|
|
26219
26303
|
return /* @__PURE__ */ jsx31(
|
|
26220
|
-
|
|
26304
|
+
Box25,
|
|
26221
26305
|
{
|
|
26222
26306
|
ref: (node) => {
|
|
26223
26307
|
if (node) rowMeasureRefs.current.set(key, node);
|
|
@@ -26239,20 +26323,20 @@ function FieldEditor({
|
|
|
26239
26323
|
const src = metadata?.componentSource ?? null;
|
|
26240
26324
|
const headerPath = path5 ?? "<unknown source path>";
|
|
26241
26325
|
if (!start || !end2 || !src) {
|
|
26242
|
-
return /* @__PURE__ */ jsxs25(
|
|
26326
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
26243
26327
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, bold: true, children: `source: ${headerPath}` }),
|
|
26244
26328
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "(no source location captured for this prop)" }),
|
|
26245
26329
|
/* @__PURE__ */ jsx31(Text26, { children: "[s] close" })
|
|
26246
26330
|
] });
|
|
26247
26331
|
}
|
|
26248
26332
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end2);
|
|
26249
|
-
return /* @__PURE__ */ jsxs25(
|
|
26333
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
26250
26334
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, bold: true, children: `${headerPath}: lines ${start}\u2013${end2}` }),
|
|
26251
26335
|
lines.map((ln, i) => /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: ln }, `source-line-${i}`)),
|
|
26252
26336
|
/* @__PURE__ */ jsx31(Text26, { children: "[s] close \xB7 [Esc] close" })
|
|
26253
26337
|
] });
|
|
26254
26338
|
})(),
|
|
26255
|
-
showHelp && /* @__PURE__ */ jsxs25(
|
|
26339
|
+
showHelp && /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.accent, paddingX: 1, children: [
|
|
26256
26340
|
/* @__PURE__ */ jsx31(Text26, { bold: true, color: PALETTE.accent, children: "Keybindings" }),
|
|
26257
26341
|
/* @__PURE__ */ jsx31(Text26, { children: " " }),
|
|
26258
26342
|
/* @__PURE__ */ jsx31(Text26, { bold: true, children: "Row navigation" }),
|
|
@@ -26281,7 +26365,7 @@ function FieldEditor({
|
|
|
26281
26365
|
/* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: "press ? or Esc to close" })
|
|
26282
26366
|
] }),
|
|
26283
26367
|
validationError && /* @__PURE__ */ jsx31(Text26, { color: PALETTE.error, children: "\u2717 " + validationError }),
|
|
26284
|
-
/* @__PURE__ */ jsx31(
|
|
26368
|
+
/* @__PURE__ */ jsx31(Box25, { paddingTop: 1, children: /* @__PURE__ */ jsx31(Text26, { color: PALETTE.muted, children: modeLabel }) })
|
|
26285
26369
|
]
|
|
26286
26370
|
}
|
|
26287
26371
|
);
|
|
@@ -26338,23 +26422,23 @@ var init_wrap_text = __esm({
|
|
|
26338
26422
|
});
|
|
26339
26423
|
|
|
26340
26424
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationaleLine.tsx
|
|
26341
|
-
import { Box as
|
|
26425
|
+
import { Box as Box26, Text as Text27 } from "ink";
|
|
26342
26426
|
import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
26343
26427
|
function RationaleLine({ line, active }) {
|
|
26344
26428
|
if (line.kind === "blank") {
|
|
26345
|
-
return /* @__PURE__ */ jsx32(
|
|
26429
|
+
return /* @__PURE__ */ jsx32(Box26, { children: /* @__PURE__ */ jsx32(Text27, { children: " " }) });
|
|
26346
26430
|
}
|
|
26347
26431
|
if (line.kind === "heading") {
|
|
26348
|
-
return /* @__PURE__ */ jsx32(
|
|
26432
|
+
return /* @__PURE__ */ jsx32(Box26, { children: /* @__PURE__ */ jsx32(Text27, { bold: true, color: active ? PALETTE.accent : PALETTE.muted, children: line.text }) });
|
|
26349
26433
|
}
|
|
26350
26434
|
if (line.kind === "label") {
|
|
26351
|
-
return /* @__PURE__ */ jsxs26(
|
|
26435
|
+
return /* @__PURE__ */ jsxs26(Box26, { children: [
|
|
26352
26436
|
line.prefix && /* @__PURE__ */ jsx32(Text27, { children: line.prefix }),
|
|
26353
26437
|
/* @__PURE__ */ jsx32(Text27, { bold: true, color: active ? line.color : PALETTE.muted, children: line.text }),
|
|
26354
26438
|
line.suffix && /* @__PURE__ */ jsx32(Text27, { color: PALETTE.muted, children: line.suffix })
|
|
26355
26439
|
] });
|
|
26356
26440
|
}
|
|
26357
|
-
return /* @__PURE__ */ jsx32(
|
|
26441
|
+
return /* @__PURE__ */ jsx32(Box26, { children: /* @__PURE__ */ jsx32(Text27, { color: !active || line.dim ? PALETTE.muted : void 0, children: line.text }) });
|
|
26358
26442
|
}
|
|
26359
26443
|
var init_RationaleLine = __esm({
|
|
26360
26444
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationaleLine.tsx"() {
|
|
@@ -26364,7 +26448,7 @@ var init_RationaleLine = __esm({
|
|
|
26364
26448
|
});
|
|
26365
26449
|
|
|
26366
26450
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ComponentRationalePanel.tsx
|
|
26367
|
-
import { Box as
|
|
26451
|
+
import { Box as Box27, Text as Text28 } from "ink";
|
|
26368
26452
|
import { jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
26369
26453
|
function renderComponentRationaleLines(data, innerWidth) {
|
|
26370
26454
|
const out = [];
|
|
@@ -26433,7 +26517,7 @@ function ComponentRationalePanel({
|
|
|
26433
26517
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
26434
26518
|
const visibleEnd = Math.min(totalLines, scrollOffset + contentHeight);
|
|
26435
26519
|
return /* @__PURE__ */ jsxs27(
|
|
26436
|
-
|
|
26520
|
+
Box27,
|
|
26437
26521
|
{
|
|
26438
26522
|
flexDirection: "column",
|
|
26439
26523
|
width,
|
|
@@ -26441,9 +26525,9 @@ function ComponentRationalePanel({
|
|
|
26441
26525
|
borderStyle: "single",
|
|
26442
26526
|
borderColor: active ? PALETTE.text : void 0,
|
|
26443
26527
|
children: [
|
|
26444
|
-
/* @__PURE__ */ jsx33(
|
|
26528
|
+
/* @__PURE__ */ jsx33(Box27, { children: /* @__PURE__ */ jsx33(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, children: `Component rationale: ${data.name}` }) }),
|
|
26445
26529
|
visible.map((line, i) => /* @__PURE__ */ jsx33(RationaleLine, { line, active }, i)),
|
|
26446
|
-
/* @__PURE__ */ jsx33(
|
|
26530
|
+
/* @__PURE__ */ jsx33(Box27, { children: overflowed ? /* @__PURE__ */ jsx33(Text28, { children: `${visibleStart}-${visibleEnd}/${totalLines} [\u2191\u2193] scroll [I/Esc] close` }) : /* @__PURE__ */ jsx33(Text28, { children: "[I/Esc] close" }) })
|
|
26447
26531
|
]
|
|
26448
26532
|
}
|
|
26449
26533
|
);
|
|
@@ -26473,7 +26557,7 @@ var init_HighlightedLine = __esm({
|
|
|
26473
26557
|
});
|
|
26474
26558
|
|
|
26475
26559
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ScrollablePanel.tsx
|
|
26476
|
-
import { Box as
|
|
26560
|
+
import { Box as Box28, Text as Text30 } from "ink";
|
|
26477
26561
|
import { Fragment as Fragment8, jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
26478
26562
|
function ScrollablePanel({
|
|
26479
26563
|
title,
|
|
@@ -26487,11 +26571,11 @@ function ScrollablePanel({
|
|
|
26487
26571
|
children
|
|
26488
26572
|
}) {
|
|
26489
26573
|
const overflowed = totalLines > height;
|
|
26490
|
-
return /* @__PURE__ */ jsxs28(
|
|
26491
|
-
/* @__PURE__ */ jsxs28(
|
|
26574
|
+
return /* @__PURE__ */ jsxs28(Box28, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
|
|
26575
|
+
/* @__PURE__ */ jsxs28(Box28, { children: [
|
|
26492
26576
|
/* @__PURE__ */ jsx35(Text30, { bold: true, color: active ? void 0 : PALETTE.muted, children: title }),
|
|
26493
26577
|
overflowed && /* @__PURE__ */ jsxs28(Fragment8, { children: [
|
|
26494
|
-
/* @__PURE__ */ jsx35(
|
|
26578
|
+
/* @__PURE__ */ jsx35(Box28, { flexGrow: 1 }),
|
|
26495
26579
|
/* @__PURE__ */ jsx35(Text30, { color: active ? void 0 : PALETTE.muted, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
|
|
26496
26580
|
] })
|
|
26497
26581
|
] }),
|
|
@@ -26506,7 +26590,7 @@ var init_ScrollablePanel = __esm({
|
|
|
26506
26590
|
});
|
|
26507
26591
|
|
|
26508
26592
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/JsonPanel.tsx
|
|
26509
|
-
import { Box as
|
|
26593
|
+
import { Box as Box29 } from "ink";
|
|
26510
26594
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
26511
26595
|
function highlightJson(line) {
|
|
26512
26596
|
const parts = [];
|
|
@@ -26571,7 +26655,7 @@ function JsonPanel({ label, value, scrollOffset, width, height, active }) {
|
|
|
26571
26655
|
borderColor: active ? "white" : void 0,
|
|
26572
26656
|
children: visibleLines.map((line, i) => {
|
|
26573
26657
|
const truncated = truncateLine(line, innerWidth);
|
|
26574
|
-
return /* @__PURE__ */ jsx36(
|
|
26658
|
+
return /* @__PURE__ */ jsx36(Box29, { children: highlightJson(truncated) }, i);
|
|
26575
26659
|
})
|
|
26576
26660
|
}
|
|
26577
26661
|
);
|
|
@@ -26645,7 +26729,7 @@ var init_RationalePanel = __esm({
|
|
|
26645
26729
|
|
|
26646
26730
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/TokenReviewPanel.tsx
|
|
26647
26731
|
import figures7 from "figures";
|
|
26648
|
-
import { Box as
|
|
26732
|
+
import { Box as Box30, Text as Text31 } from "ink";
|
|
26649
26733
|
import { jsx as jsx38, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
26650
26734
|
function TokenReviewPanel({
|
|
26651
26735
|
componentName,
|
|
@@ -26666,7 +26750,7 @@ function TokenReviewPanel({
|
|
|
26666
26750
|
const visiblePaths = current.paths.slice(scrollStart, scrollStart + visibleCount);
|
|
26667
26751
|
const rangeLabel = current.paths.length === 0 ? "no compatible tokens" : `${scrollStart + 1}-${scrollStart + visiblePaths.length} of ${current.paths.length}`;
|
|
26668
26752
|
return /* @__PURE__ */ jsxs29(
|
|
26669
|
-
|
|
26753
|
+
Box30,
|
|
26670
26754
|
{
|
|
26671
26755
|
flexDirection: "column",
|
|
26672
26756
|
width,
|
|
@@ -26682,7 +26766,7 @@ function TokenReviewPanel({
|
|
|
26682
26766
|
const pathIndex = scrollStart + i;
|
|
26683
26767
|
const checked = editSelection.has(path5);
|
|
26684
26768
|
const focused = pathIndex === editCursor;
|
|
26685
|
-
return /* @__PURE__ */ jsx38(
|
|
26769
|
+
return /* @__PURE__ */ jsx38(Box30, { children: /* @__PURE__ */ jsx38(
|
|
26686
26770
|
Text31,
|
|
26687
26771
|
{
|
|
26688
26772
|
color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted,
|
|
@@ -26700,7 +26784,7 @@ function TokenReviewPanel({
|
|
|
26700
26784
|
);
|
|
26701
26785
|
}
|
|
26702
26786
|
return /* @__PURE__ */ jsxs29(
|
|
26703
|
-
|
|
26787
|
+
Box30,
|
|
26704
26788
|
{
|
|
26705
26789
|
flexDirection: "column",
|
|
26706
26790
|
width,
|
|
@@ -26712,8 +26796,8 @@ function TokenReviewPanel({
|
|
|
26712
26796
|
suggestions.length === 0 && /* @__PURE__ */ jsx38(Text31, { color: PALETTE.muted, children: "(no token suggestions for this component)" }),
|
|
26713
26797
|
suggestions.map((s, i) => {
|
|
26714
26798
|
const focused = i === selectedRow;
|
|
26715
|
-
return /* @__PURE__ */ jsxs29(
|
|
26716
|
-
/* @__PURE__ */ jsx38(
|
|
26799
|
+
return /* @__PURE__ */ jsxs29(Box30, { flexDirection: "column", children: [
|
|
26800
|
+
/* @__PURE__ */ jsx38(Box30, { children: /* @__PURE__ */ jsx38(Text31, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures7.pointer : " "} ${s.propName}` }) }),
|
|
26717
26801
|
/* @__PURE__ */ jsx38(Text31, { color: PALETTE.muted, children: ` suggested: ${s.suggested.join(", ")}` }),
|
|
26718
26802
|
/* @__PURE__ */ jsx38(Text31, { color: PALETTE.muted, children: ` allowed: ${s.allowed.join(", ")}` })
|
|
26719
26803
|
] }, s.propName);
|
|
@@ -26937,7 +27021,7 @@ var init_ReviewDetailsEditor = __esm({
|
|
|
26937
27021
|
});
|
|
26938
27022
|
|
|
26939
27023
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewComponentPanel.tsx
|
|
26940
|
-
import { Box as
|
|
27024
|
+
import { Box as Box31, Text as Text33 } from "ink";
|
|
26941
27025
|
import { Fragment as Fragment10, jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
26942
27026
|
function buildReviewFieldEditor(reviewEditor, selectedJson, onExit, overrides = {}) {
|
|
26943
27027
|
return {
|
|
@@ -26981,7 +27065,7 @@ function ReviewEmptyComponentsWarning({
|
|
|
26981
27065
|
return /* @__PURE__ */ jsx41(Text33, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
|
|
26982
27066
|
}
|
|
26983
27067
|
function ReviewNoSelection() {
|
|
26984
|
-
return /* @__PURE__ */ jsx41(
|
|
27068
|
+
return /* @__PURE__ */ jsx41(Box31, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx41(Text33, { color: PALETTE.muted, children: "No component selected" }) });
|
|
26985
27069
|
}
|
|
26986
27070
|
function ReviewFinalizeError({
|
|
26987
27071
|
message,
|
|
@@ -27009,9 +27093,9 @@ function ReviewComponentTitle({
|
|
|
27009
27093
|
slotCount,
|
|
27010
27094
|
sidebarFocused
|
|
27011
27095
|
}) {
|
|
27012
|
-
return /* @__PURE__ */ jsxs31(
|
|
27096
|
+
return /* @__PURE__ */ jsxs31(Box31, { paddingLeft: 2, paddingBottom: 1, children: [
|
|
27013
27097
|
/* @__PURE__ */ jsx41(Text33, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
27014
|
-
/* @__PURE__ */ jsx41(
|
|
27098
|
+
/* @__PURE__ */ jsx41(Box31, { flexGrow: 1 }),
|
|
27015
27099
|
/* @__PURE__ */ jsxs31(Text33, { color: PALETTE.muted, wrap: "truncate-end", children: [
|
|
27016
27100
|
propCount,
|
|
27017
27101
|
" prop",
|
|
@@ -27043,8 +27127,8 @@ function ReviewComponentPanel({
|
|
|
27043
27127
|
const slotCount = selectedEntry.$slots ? Object.keys(selectedEntry.$slots).length : 0;
|
|
27044
27128
|
const contentHeight = Math.max(1, height - 2);
|
|
27045
27129
|
const contentWidth = Math.max(1, width - 1);
|
|
27046
|
-
return /* @__PURE__ */ jsx41(FixedPanel, { width, height, borderStyle: void 0, paddingLeft: 1, children: /* @__PURE__ */ jsxs31(
|
|
27047
|
-
/* @__PURE__ */ jsx41(
|
|
27130
|
+
return /* @__PURE__ */ jsx41(FixedPanel, { width, height, borderStyle: void 0, paddingLeft: 1, children: /* @__PURE__ */ jsxs31(Box31, { flexDirection: "column", width: contentWidth, height, flexShrink: 0, overflowY: "hidden", children: [
|
|
27131
|
+
/* @__PURE__ */ jsx41(Box31, { width: contentWidth, height: contentHeight, flexShrink: 0, overflowY: "hidden", children: /* @__PURE__ */ jsx41(
|
|
27048
27132
|
ReviewDetailsEditor,
|
|
27049
27133
|
{
|
|
27050
27134
|
selectedKey,
|
|
@@ -27068,8 +27152,8 @@ function ReviewComponentPanel({
|
|
|
27068
27152
|
)
|
|
27069
27153
|
}
|
|
27070
27154
|
) }),
|
|
27071
|
-
/* @__PURE__ */ jsx41(
|
|
27072
|
-
/* @__PURE__ */ jsx41(
|
|
27155
|
+
/* @__PURE__ */ jsx41(Box31, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx41(Text33, { color: saveError ? PALETTE.error : void 0, wrap: "truncate-end", children: saveError ? "\u2717 " + saveError : " " }) }),
|
|
27156
|
+
/* @__PURE__ */ jsx41(Box31, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx41(Text33, { color: PALETTE.muted, wrap: "truncate-end", children: /* @__PURE__ */ jsx41(
|
|
27073
27157
|
ReviewPanelFooter,
|
|
27074
27158
|
{
|
|
27075
27159
|
reviewEditor,
|
|
@@ -27092,7 +27176,7 @@ var init_ReviewComponentPanel = __esm({
|
|
|
27092
27176
|
});
|
|
27093
27177
|
|
|
27094
27178
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewStatus.tsx
|
|
27095
|
-
import { Box as
|
|
27179
|
+
import { Box as Box32, Text as Text34 } from "ink";
|
|
27096
27180
|
import { jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
27097
27181
|
function countReviewStatuses(entries) {
|
|
27098
27182
|
return entries.reduce(
|
|
@@ -27106,10 +27190,10 @@ function countReviewStatuses(entries) {
|
|
|
27106
27190
|
);
|
|
27107
27191
|
}
|
|
27108
27192
|
function ReviewLoadingState() {
|
|
27109
|
-
return /* @__PURE__ */ jsx42(
|
|
27193
|
+
return /* @__PURE__ */ jsx42(Box32, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx42(Text34, { color: PALETTE.muted, children: "Loading generated definitions..." }) });
|
|
27110
27194
|
}
|
|
27111
27195
|
function ReviewLoadError({ message }) {
|
|
27112
|
-
return /* @__PURE__ */ jsxs32(
|
|
27196
|
+
return /* @__PURE__ */ jsxs32(Box32, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
27113
27197
|
/* @__PURE__ */ jsx42(Text34, { color: PALETTE.error, children: message }),
|
|
27114
27198
|
/* @__PURE__ */ jsx42(Text34, { children: " " }),
|
|
27115
27199
|
/* @__PURE__ */ jsx42(ControlHints, { hints: [{ keys: "q / Enter / Esc", label: "Quit" }] })
|
|
@@ -27336,7 +27420,7 @@ var init_run_live_preview = __esm({
|
|
|
27336
27420
|
});
|
|
27337
27421
|
|
|
27338
27422
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FinalizeDialog.tsx
|
|
27339
|
-
import { Box as
|
|
27423
|
+
import { Box as Box33, Text as Text35 } from "ink";
|
|
27340
27424
|
import { Fragment as Fragment11, jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
27341
27425
|
function FinalizeDialog({
|
|
27342
27426
|
accepted,
|
|
@@ -27365,7 +27449,7 @@ function FinalizeDialog({
|
|
|
27365
27449
|
const windowed = removed.slice(offset, offset + FINALIZE_REMOVED_WINDOW);
|
|
27366
27450
|
const hasMoreBelow = offset + FINALIZE_REMOVED_WINDOW < removed.length;
|
|
27367
27451
|
const hasMoreAbove = offset > 0;
|
|
27368
|
-
return /* @__PURE__ */ jsx43(
|
|
27452
|
+
return /* @__PURE__ */ jsx43(Box33, { width: "100%", paddingX: 2, children: /* @__PURE__ */ jsxs33(Box33, { flexDirection: "column", alignItems: "flex-start", children: [
|
|
27369
27453
|
/* @__PURE__ */ jsx43(Text35, { bold: true, children: "Finalize" }),
|
|
27370
27454
|
/* @__PURE__ */ jsx43(Text35, { children: " " }),
|
|
27371
27455
|
/* @__PURE__ */ jsxs33(Text35, { children: [
|
|
@@ -27395,7 +27479,7 @@ function FinalizeDialog({
|
|
|
27395
27479
|
/* @__PURE__ */ jsx43(Text35, { color: PALETTE.warning, children: "Only explicitly accepted components ship." }),
|
|
27396
27480
|
/* @__PURE__ */ jsx43(Text35, { children: " " })
|
|
27397
27481
|
] }),
|
|
27398
|
-
/* @__PURE__ */ jsxs33(
|
|
27482
|
+
/* @__PURE__ */ jsxs33(Box33, { flexDirection: "column", height: 2, children: [
|
|
27399
27483
|
previewStatus === "running" ? /* @__PURE__ */ jsx43(Text35, { color: PALETTE.muted, children: "Previewing deletions against the target space\u2026" }) : previewStatus === "error" ? /* @__PURE__ */ jsx43(Text35, { color: PALETTE.warning, children: "\u26A0 Could not preview deletions (the push will still proceed)." }) : /* @__PURE__ */ jsx43(Text35, { children: " " }),
|
|
27400
27484
|
/* @__PURE__ */ jsx43(Text35, { children: " " })
|
|
27401
27485
|
] }),
|
|
@@ -27866,7 +27950,7 @@ var init_use_review_surface_state = __esm({
|
|
|
27866
27950
|
});
|
|
27867
27951
|
|
|
27868
27952
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/QuitDialog.tsx
|
|
27869
|
-
import { Box as
|
|
27953
|
+
import { Box as Box34, Text as Text36 } from "ink";
|
|
27870
27954
|
import { Fragment as Fragment12, jsx as jsx44, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
27871
27955
|
function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
27872
27956
|
useImmediateInput((input, key) => {
|
|
@@ -27876,7 +27960,7 @@ function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
|
27876
27960
|
onCancel();
|
|
27877
27961
|
}
|
|
27878
27962
|
});
|
|
27879
|
-
return /* @__PURE__ */ jsxs34(
|
|
27963
|
+
return /* @__PURE__ */ jsxs34(Box34, { flexDirection: "column", borderStyle: "round", padding: 1, width: 50, children: [
|
|
27880
27964
|
/* @__PURE__ */ jsx44(Text36, { bold: true, children: "\u2500".repeat(19) + " Quit " + "\u2500".repeat(19) }),
|
|
27881
27965
|
/* @__PURE__ */ jsx44(Text36, { children: " " }),
|
|
27882
27966
|
hasUnsavedDrafts ? /* @__PURE__ */ jsxs34(Fragment12, { children: [
|
|
@@ -27905,7 +27989,7 @@ var init_QuitDialog = __esm({
|
|
|
27905
27989
|
});
|
|
27906
27990
|
|
|
27907
27991
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewDialogs.tsx
|
|
27908
|
-
import { Box as
|
|
27992
|
+
import { Box as Box35, Text as Text37 } from "ink";
|
|
27909
27993
|
import { Fragment as Fragment13, jsx as jsx45, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
27910
27994
|
function ReviewFinalizeDialogs({
|
|
27911
27995
|
showFinalize,
|
|
@@ -27962,7 +28046,7 @@ function ReviewStepDialogs({
|
|
|
27962
28046
|
}
|
|
27963
28047
|
function ReviewReloadDialog({ open }) {
|
|
27964
28048
|
if (!open) return null;
|
|
27965
|
-
return /* @__PURE__ */ jsxs35(
|
|
28049
|
+
return /* @__PURE__ */ jsxs35(Box35, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
27966
28050
|
/* @__PURE__ */ jsx45(Text37, { bold: true, color: PALETTE.warning, children: "Reload from saved state?" }),
|
|
27967
28051
|
/* @__PURE__ */ jsx45(Text37, { children: "Unsaved in-memory changes will be lost." }),
|
|
27968
28052
|
/* @__PURE__ */ jsx45(Text37, { children: " " }),
|
|
@@ -28369,7 +28453,7 @@ var init_use_review_preview = __esm({
|
|
|
28369
28453
|
});
|
|
28370
28454
|
|
|
28371
28455
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/LivePreviewSummary.tsx
|
|
28372
|
-
import { Box as
|
|
28456
|
+
import { Box as Box36, Text as Text38 } from "ink";
|
|
28373
28457
|
import { jsx as jsx46, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
28374
28458
|
function LivePreviewSummary({
|
|
28375
28459
|
enabled,
|
|
@@ -28387,7 +28471,7 @@ function LivePreviewSummary({
|
|
|
28387
28471
|
if (disabled) return /* @__PURE__ */ jsx46(Text38, { color: PALETTE.muted, children: "Preview: disabled (creds rejected)" });
|
|
28388
28472
|
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx46(Text38, { color: PALETTE.muted, children: `Preview: ${spinner} running...` });
|
|
28389
28473
|
if (!hasCounts) return null;
|
|
28390
|
-
return /* @__PURE__ */ jsxs36(
|
|
28474
|
+
return /* @__PURE__ */ jsxs36(Box36, { children: [
|
|
28391
28475
|
/* @__PURE__ */ jsx46(Text38, { children: "Preview: " }),
|
|
28392
28476
|
/* @__PURE__ */ jsx46(Text38, { color: PALETTE.success, children: `${counts.new} new` }),
|
|
28393
28477
|
/* @__PURE__ */ jsx46(Text38, { children: " \xB7 " }),
|
|
@@ -28409,7 +28493,7 @@ var init_LivePreviewSummary = __esm({
|
|
|
28409
28493
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx
|
|
28410
28494
|
import { useCallback as useCallback5, useEffect as useEffect17, useMemo as useMemo4, useRef as useRef13, useState as useState25 } from "react";
|
|
28411
28495
|
import figures8 from "figures";
|
|
28412
|
-
import { Box as
|
|
28496
|
+
import { Box as Box37, Text as Text39 } from "ink";
|
|
28413
28497
|
import { Fragment as Fragment14, jsx as jsx47, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
28414
28498
|
function sortComponentsForSidebar(components, cycleParticipants) {
|
|
28415
28499
|
const isEmpty2 = (entry) => Object.keys(entry.$properties ?? {}).length === 0 && Object.keys(entry.$slots ?? {}).length === 0;
|
|
@@ -28554,7 +28638,7 @@ function deriveBreakingChanges(response) {
|
|
|
28554
28638
|
}
|
|
28555
28639
|
function GenerateReviewStep(props) {
|
|
28556
28640
|
if (!props.extractSessionId) {
|
|
28557
|
-
return /* @__PURE__ */ jsx47(
|
|
28641
|
+
return /* @__PURE__ */ jsx47(Box37, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx47(Text39, { color: PALETTE.error, children: "Error: no session ID \u2014 cannot load generated definitions." }) });
|
|
28558
28642
|
}
|
|
28559
28643
|
return /* @__PURE__ */ jsx47(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
|
|
28560
28644
|
}
|
|
@@ -29459,7 +29543,7 @@ function GenerateReviewStepView({
|
|
|
29459
29543
|
for (const c2 of closures.values()) if (c2.nodes.length > 1) return true;
|
|
29460
29544
|
return false;
|
|
29461
29545
|
})();
|
|
29462
|
-
return /* @__PURE__ */ jsxs37(
|
|
29546
|
+
return /* @__PURE__ */ jsxs37(Box37, { flexDirection: "column", children: [
|
|
29463
29547
|
/* @__PURE__ */ jsx47(StepHeader, { step: "review" }),
|
|
29464
29548
|
/* @__PURE__ */ jsx47(
|
|
29465
29549
|
ReviewStepDialogs,
|
|
@@ -29472,14 +29556,14 @@ function GenerateReviewStepView({
|
|
|
29472
29556
|
}
|
|
29473
29557
|
),
|
|
29474
29558
|
/* @__PURE__ */ jsx47(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
29475
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs37(
|
|
29559
|
+
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs37(Box37, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
29476
29560
|
/* @__PURE__ */ jsx47(Text39, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
|
|
29477
29561
|
!removedBannerCollapsed && /* @__PURE__ */ jsxs37(Fragment14, { children: [
|
|
29478
29562
|
/* @__PURE__ */ jsx47(Text39, { children: " " }),
|
|
29479
29563
|
removedComponents.map((rc) => /* @__PURE__ */ jsx47(Text39, { children: removedComponentLine(rc) }, rc.id))
|
|
29480
29564
|
] })
|
|
29481
29565
|
] }),
|
|
29482
|
-
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx47(
|
|
29566
|
+
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx47(Box37, { paddingX: 1, children: /* @__PURE__ */ jsx47(
|
|
29483
29567
|
Text39,
|
|
29484
29568
|
{
|
|
29485
29569
|
color: PALETTE.warning,
|
|
@@ -29490,7 +29574,7 @@ function GenerateReviewStepView({
|
|
|
29490
29574
|
const row = breakingRows[breakingCursor];
|
|
29491
29575
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
29492
29576
|
if (!comp) return null;
|
|
29493
|
-
return /* @__PURE__ */ jsxs37(
|
|
29577
|
+
return /* @__PURE__ */ jsxs37(Box37, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
29494
29578
|
/* @__PURE__ */ jsx47(Text39, { bold: true, color: PALETTE.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
|
|
29495
29579
|
comp.impact && /* @__PURE__ */ jsx47(Text39, { color: PALETTE.muted, children: ` affects ${comp.impact.affectedExperiences} experience${comp.impact.affectedExperiences === 1 ? "" : "s"}, ${comp.impact.affectedFragments} fragment${comp.impact.affectedFragments === 1 ? "" : "s"}` }),
|
|
29496
29580
|
comp.changes.length === 0 ? /* @__PURE__ */ jsx47(Text39, { color: PALETTE.muted, children: " (no enumerated changes)" }) : comp.changes.map((change, ci) => /* @__PURE__ */ jsx47(Text39, { children: ` \u2022 ${formatBreakingChange(change, comp.current)}` }, `bd-detail-${ci}`)),
|
|
@@ -29516,7 +29600,7 @@ function GenerateReviewStepView({
|
|
|
29516
29600
|
const participantSet = cycleView.structural;
|
|
29517
29601
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
29518
29602
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
29519
|
-
return /* @__PURE__ */ jsxs37(
|
|
29603
|
+
return /* @__PURE__ */ jsxs37(Box37, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
29520
29604
|
/* @__PURE__ */ jsx47(Text39, { color: PALETTE.error, bold: true, children: `Cyclic component graph \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
|
|
29521
29605
|
members.length > 0 && /* @__PURE__ */ jsx47(Text39, { color: PALETTE.error, children: ` Cycle members: ${members.join(", ")}` }),
|
|
29522
29606
|
ancestors.length > 0 && /* @__PURE__ */ jsx47(Text39, { color: PALETTE.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
|
|
@@ -29546,7 +29630,7 @@ function GenerateReviewStepView({
|
|
|
29546
29630
|
height: panelHeight
|
|
29547
29631
|
}
|
|
29548
29632
|
),
|
|
29549
|
-
!dialogOpen && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(
|
|
29633
|
+
!dialogOpen && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(Box37, { children: [
|
|
29550
29634
|
breakingPanel.isOpen ? /* @__PURE__ */ jsx47(
|
|
29551
29635
|
GotoBanner,
|
|
29552
29636
|
{
|
|
@@ -29635,7 +29719,7 @@ function GenerateReviewStepView({
|
|
|
29635
29719
|
}
|
|
29636
29720
|
) : /* @__PURE__ */ jsx47(ReviewNoSelection, {})
|
|
29637
29721
|
] }),
|
|
29638
|
-
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(
|
|
29722
|
+
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs37(Box37, { flexDirection: "column", children: [
|
|
29639
29723
|
/* @__PURE__ */ jsx47(Text39, { color: PALETTE.warning, children: `\u26A0 ${cycleRows.length} slot dependency cycle${cycleRows.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
29640
29724
|
cycleRows.slice(0, 3).map((cycle, idx) => {
|
|
29641
29725
|
return /* @__PURE__ */ jsx47(
|
|
@@ -29779,11 +29863,11 @@ var init_generate_review_step = __esm({
|
|
|
29779
29863
|
});
|
|
29780
29864
|
|
|
29781
29865
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/CustomPromptBanner.tsx
|
|
29782
|
-
import { Box as
|
|
29866
|
+
import { Box as Box38, Text as Text40 } from "ink";
|
|
29783
29867
|
import { jsx as jsx48, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
29784
29868
|
function CustomPromptBanner({ generatePromptPath }) {
|
|
29785
29869
|
if (!generatePromptPath) return null;
|
|
29786
|
-
return /* @__PURE__ */ jsxs38(
|
|
29870
|
+
return /* @__PURE__ */ jsxs38(Box38, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
29787
29871
|
/* @__PURE__ */ jsx48(Text40, { color: PALETTE.warning, bold: true, children: "WARNING: Custom prompt active" }),
|
|
29788
29872
|
generatePromptPath ? /* @__PURE__ */ jsxs38(Text40, { color: PALETTE.warning, children: [
|
|
29789
29873
|
"components: ",
|
|
@@ -29818,10 +29902,10 @@ var init_contentful_urls2 = __esm({
|
|
|
29818
29902
|
});
|
|
29819
29903
|
|
|
29820
29904
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/SpaceEnvironment.tsx
|
|
29821
|
-
import { Box as
|
|
29905
|
+
import { Box as Box39, Text as Text41 } from "ink";
|
|
29822
29906
|
import { jsx as jsx49, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
29823
29907
|
function SpaceEnvironment({ spaceId, environmentId }) {
|
|
29824
|
-
return /* @__PURE__ */ jsxs39(
|
|
29908
|
+
return /* @__PURE__ */ jsxs39(Box39, { gap: 1, marginTop: 1, children: [
|
|
29825
29909
|
/* @__PURE__ */ jsx49(Text41, { color: PALETTE.muted, children: "Space:" }),
|
|
29826
29910
|
/* @__PURE__ */ jsx49(Text41, { children: spaceId }),
|
|
29827
29911
|
/* @__PURE__ */ jsx49(Text41, { color: PALETTE.muted, children: "/" }),
|
|
@@ -29837,7 +29921,7 @@ var init_SpaceEnvironment = __esm({
|
|
|
29837
29921
|
});
|
|
29838
29922
|
|
|
29839
29923
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/DoneStep.tsx
|
|
29840
|
-
import { Box as
|
|
29924
|
+
import { Box as Box40, Text as Text42 } from "ink";
|
|
29841
29925
|
import { Fragment as Fragment15, jsx as jsx50, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
29842
29926
|
function EntityRows({ entity, label }) {
|
|
29843
29927
|
const plural3 = (n) => `${n} ${label}${n !== 1 ? "s" : ""}`;
|
|
@@ -29857,7 +29941,7 @@ function EntityRows({ entity, label }) {
|
|
|
29857
29941
|
] });
|
|
29858
29942
|
}
|
|
29859
29943
|
function LinkRow({ title, url }) {
|
|
29860
|
-
return /* @__PURE__ */ jsxs40(
|
|
29944
|
+
return /* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", children: [
|
|
29861
29945
|
/* @__PURE__ */ jsx50(Text42, { color: PALETTE.muted, children: title }),
|
|
29862
29946
|
/* @__PURE__ */ jsx50(Text42, { color: PALETTE.accent, children: url })
|
|
29863
29947
|
] });
|
|
@@ -29883,14 +29967,14 @@ function DoneStep({
|
|
|
29883
29967
|
const totalPushed = componentTypes.created + componentTypes.updated + componentTypes.removed + designTokens.created + designTokens.updated + designTokens.removed;
|
|
29884
29968
|
const success = totalFailed === 0;
|
|
29885
29969
|
const urlArgs = { host: host ?? "api.contentful.com", spaceId, environmentId };
|
|
29886
|
-
return /* @__PURE__ */ jsxs40(
|
|
29970
|
+
return /* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", children: [
|
|
29887
29971
|
/* @__PURE__ */ jsx50(StepHeader, { step: "done" }),
|
|
29888
|
-
/* @__PURE__ */ jsxs40(
|
|
29972
|
+
/* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
29889
29973
|
success ? /* @__PURE__ */ jsx50(Text42, { bold: true, color: PALETTE.success, children: "Done!" }) : /* @__PURE__ */ jsx50(Text42, { bold: true, color: PALETTE.warning, children: "\u26A0 Finished with errors" }),
|
|
29890
|
-
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx50(Text42, { color: PALETTE.muted, children: credentialsSkipped ? "Nothing was pushed \u2014 you skipped the Contentful credentials, so the files were only saved locally." : "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs40(
|
|
29891
|
-
/* @__PURE__ */ jsx50(EntityRows, { entity: componentTypes, label: "Component
|
|
29974
|
+
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx50(Text42, { color: PALETTE.muted, children: credentialsSkipped ? "Nothing was pushed \u2014 you skipped the Contentful credentials, so the files were only saved locally." : "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", children: [
|
|
29975
|
+
/* @__PURE__ */ jsx50(EntityRows, { entity: componentTypes, label: "Component" }),
|
|
29892
29976
|
/* @__PURE__ */ jsx50(EntityRows, { entity: designTokens, label: "Design Token" }),
|
|
29893
|
-
summary && /* @__PURE__ */ jsx50(
|
|
29977
|
+
summary && /* @__PURE__ */ jsx50(Box40, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color: PALETTE.muted, children: [
|
|
29894
29978
|
"Push result: ",
|
|
29895
29979
|
summary.succeeded,
|
|
29896
29980
|
"/",
|
|
@@ -29903,7 +29987,7 @@ function DoneStep({
|
|
|
29903
29987
|
] })
|
|
29904
29988
|
] }) })
|
|
29905
29989
|
] }),
|
|
29906
|
-
failures.length > 0 && /* @__PURE__ */ jsxs40(
|
|
29990
|
+
failures.length > 0 && /* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", children: [
|
|
29907
29991
|
/* @__PURE__ */ jsx50(Text42, { bold: true, color: PALETTE.error, children: "Failure details" }),
|
|
29908
29992
|
failures.map((failure) => /* @__PURE__ */ jsxs40(Text42, { color: PALETTE.error, children: [
|
|
29909
29993
|
failure.entityType,
|
|
@@ -29914,7 +29998,7 @@ function DoneStep({
|
|
|
29914
29998
|
] }, `${failure.entityType}:${failure.entityId}`))
|
|
29915
29999
|
] }),
|
|
29916
30000
|
/* @__PURE__ */ jsx50(SpaceEnvironment, { spaceId, environmentId }),
|
|
29917
|
-
success && totalPushed > 0 && /* @__PURE__ */ jsxs40(
|
|
30001
|
+
success && totalPushed > 0 && /* @__PURE__ */ jsxs40(Box40, { flexDirection: "column", gap: 1, children: [
|
|
29918
30002
|
/* @__PURE__ */ jsx50(Text42, { color: PALETTE.success, children: "Your design system is now in Contentful Experiences." }),
|
|
29919
30003
|
produced.components && /* @__PURE__ */ jsx50(LinkRow, { title: "View your components here:", url: buildPostPushUrl2(urlArgs) }),
|
|
29920
30004
|
produced.tokens && /* @__PURE__ */ jsx50(
|
|
@@ -29984,7 +30068,7 @@ var init_use_blinking_cursor = __esm({
|
|
|
29984
30068
|
|
|
29985
30069
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/PathPrompt.tsx
|
|
29986
30070
|
import { useState as useState27 } from "react";
|
|
29987
|
-
import { Box as
|
|
30071
|
+
import { Box as Box41, Text as Text43 } from "ink";
|
|
29988
30072
|
import { readdirSync as readdirSync3 } from "node:fs";
|
|
29989
30073
|
import { dirname as dirname15, basename as basename6, join as join21 } from "node:path";
|
|
29990
30074
|
import { jsx as jsx51, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
@@ -30044,10 +30128,10 @@ function PathPrompt({
|
|
|
30044
30128
|
const shown = input || defaultPath;
|
|
30045
30129
|
const isPlaceholder = input === "";
|
|
30046
30130
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
30047
|
-
return /* @__PURE__ */ jsxs41(
|
|
30131
|
+
return /* @__PURE__ */ jsxs41(Box41, { flexDirection: "column", children: [
|
|
30048
30132
|
/* @__PURE__ */ jsx51(StepHeader, { step: "push" }),
|
|
30049
|
-
/* @__PURE__ */ jsxs41(
|
|
30050
|
-
/* @__PURE__ */ jsxs41(
|
|
30133
|
+
/* @__PURE__ */ jsxs41(Box41, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
30134
|
+
/* @__PURE__ */ jsxs41(Box41, { gap: 1, children: [
|
|
30051
30135
|
/* @__PURE__ */ jsx51(Text43, { color: PALETTE.accent, children: "?" }),
|
|
30052
30136
|
/* @__PURE__ */ jsxs41(Text43, { bold: true, children: [
|
|
30053
30137
|
label,
|
|
@@ -30124,7 +30208,7 @@ var init_use_timed_spinner = __esm({
|
|
|
30124
30208
|
});
|
|
30125
30209
|
|
|
30126
30210
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/PushingStep.tsx
|
|
30127
|
-
import { Box as
|
|
30211
|
+
import { Box as Box42, Text as Text44 } from "ink";
|
|
30128
30212
|
import { ProgressBar as ProgressBar2, ThemeProvider as ThemeProvider2 } from "@inkjs/ui";
|
|
30129
30213
|
import { jsx as jsx53, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
30130
30214
|
function PushingStep({ progress, produced }) {
|
|
@@ -30132,20 +30216,20 @@ function PushingStep({ progress, produced }) {
|
|
|
30132
30216
|
const operationId = progress && progress.kind === "queued" ? progress.operationId : null;
|
|
30133
30217
|
const showGlobal = progress && progress.kind === "progress";
|
|
30134
30218
|
const showCurrent = progress && progress.kind === "progress" && progress.current ? progress.current : null;
|
|
30135
|
-
return /* @__PURE__ */ jsxs42(
|
|
30219
|
+
return /* @__PURE__ */ jsxs42(Box42, { flexDirection: "column", children: [
|
|
30136
30220
|
/* @__PURE__ */ jsx53(StepHeader, { step: "push" }),
|
|
30137
|
-
/* @__PURE__ */ jsxs42(
|
|
30221
|
+
/* @__PURE__ */ jsxs42(Box42, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 1, children: [
|
|
30138
30222
|
/* @__PURE__ */ jsxs42(Text44, { children: [
|
|
30139
30223
|
"Writing ",
|
|
30140
30224
|
writtenThings(produced),
|
|
30141
30225
|
" to your Contentful space..."
|
|
30142
30226
|
] }),
|
|
30143
|
-
operationId && /* @__PURE__ */ jsxs42(
|
|
30227
|
+
operationId && /* @__PURE__ */ jsxs42(Box42, { gap: 1, children: [
|
|
30144
30228
|
/* @__PURE__ */ jsx53(Text44, { color: PALETTE.muted, children: "Operation:" }),
|
|
30145
30229
|
/* @__PURE__ */ jsx53(Text44, { children: operationId })
|
|
30146
30230
|
] }),
|
|
30147
|
-
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx53(
|
|
30148
|
-
/* @__PURE__ */ jsx53(
|
|
30231
|
+
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx53(Box42, { gap: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs42(Box42, { gap: 2, children: [
|
|
30232
|
+
/* @__PURE__ */ jsx53(Box42, { width: 40, children: /* @__PURE__ */ jsx53(ThemeProvider2, { theme: PROGRESS_THEME, children: /* @__PURE__ */ jsx53(ProgressBar2, { value: Math.round(progress.processed / progress.total * 100) }) }) }),
|
|
30149
30233
|
/* @__PURE__ */ jsxs42(Text44, { color: PALETTE.muted, children: [
|
|
30150
30234
|
progress.processed,
|
|
30151
30235
|
"/",
|
|
@@ -30153,11 +30237,11 @@ function PushingStep({ progress, produced }) {
|
|
|
30153
30237
|
" entities"
|
|
30154
30238
|
] })
|
|
30155
30239
|
] }) }),
|
|
30156
|
-
showCurrent && /* @__PURE__ */ jsxs42(
|
|
30240
|
+
showCurrent && /* @__PURE__ */ jsxs42(Box42, { gap: 1, children: [
|
|
30157
30241
|
/* @__PURE__ */ jsx53(Text44, { color: PALETTE.muted, children: "Now processing:" }),
|
|
30158
30242
|
/* @__PURE__ */ jsx53(Text44, { children: showCurrent })
|
|
30159
30243
|
] }),
|
|
30160
|
-
/* @__PURE__ */ jsx53(
|
|
30244
|
+
/* @__PURE__ */ jsx53(Box42, { marginTop: 1, children: /* @__PURE__ */ jsxs42(Text44, { color: PALETTE.muted, children: [
|
|
30161
30245
|
"Elapsed: ",
|
|
30162
30246
|
elapsed
|
|
30163
30247
|
] }) })
|
|
@@ -30363,7 +30447,7 @@ var init_preview_confirmation_input = __esm({
|
|
|
30363
30447
|
|
|
30364
30448
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/WizardPreviewStep.tsx
|
|
30365
30449
|
import { useEffect as useEffect20, useState as useState29, useMemo as useMemo5 } from "react";
|
|
30366
|
-
import { Box as
|
|
30450
|
+
import { Box as Box43, Text as Text45 } from "ink";
|
|
30367
30451
|
import { Fragment as Fragment16, jsx as jsx54, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
30368
30452
|
function buildPreviewSummaryLines(preview) {
|
|
30369
30453
|
const lines = [];
|
|
@@ -30616,9 +30700,9 @@ function WizardPreviewStep({
|
|
|
30616
30700
|
return;
|
|
30617
30701
|
}
|
|
30618
30702
|
});
|
|
30619
|
-
return /* @__PURE__ */ jsxs43(
|
|
30703
|
+
return /* @__PURE__ */ jsxs43(Box43, { flexDirection: "column", children: [
|
|
30620
30704
|
/* @__PURE__ */ jsx54(StepHeader, { step: "push" }),
|
|
30621
|
-
/* @__PURE__ */ jsxs43(
|
|
30705
|
+
/* @__PURE__ */ jsxs43(Box43, { flexDirection: "column", gap: 1, paddingX: 2, paddingBottom: 2, children: [
|
|
30622
30706
|
hasAnything ? /* @__PURE__ */ jsxs43(Fragment16, { children: [
|
|
30623
30707
|
/* @__PURE__ */ jsx54(Text45, { children: "Here's what will happen in your space:" }),
|
|
30624
30708
|
/* @__PURE__ */ jsxs43(
|
|
@@ -30635,9 +30719,9 @@ function WizardPreviewStep({
|
|
|
30635
30719
|
}
|
|
30636
30720
|
)
|
|
30637
30721
|
] }) : /* @__PURE__ */ jsx54(Text45, { color: PALETTE.muted, children: "Nothing to push \u2014 everything is already up to date." }),
|
|
30638
|
-
breakingWithImpact && /* @__PURE__ */ jsx54(
|
|
30722
|
+
breakingWithImpact && /* @__PURE__ */ jsx54(Box43, { marginTop: 1, children: /* @__PURE__ */ jsx54(Text45, { color: PALETTE.error, bold: true, children: "\u26A0 Breaking changes will affect downstream entities. Press Enter to acknowledge and apply." }) }),
|
|
30639
30723
|
/* @__PURE__ */ jsx54(SpaceEnvironment, { spaceId, environmentId }),
|
|
30640
|
-
/* @__PURE__ */ jsx54(
|
|
30724
|
+
/* @__PURE__ */ jsx54(Box43, { marginTop: 1, children: /* @__PURE__ */ jsx54(
|
|
30641
30725
|
ControlHints,
|
|
30642
30726
|
{
|
|
30643
30727
|
hints: [
|
|
@@ -30683,7 +30767,7 @@ var init_run_teaser = __esm({
|
|
|
30683
30767
|
});
|
|
30684
30768
|
|
|
30685
30769
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/screen.tsx
|
|
30686
|
-
import { Box as
|
|
30770
|
+
import { Box as Box44 } from "ink";
|
|
30687
30771
|
import { jsx as jsx55, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
30688
30772
|
function canEditFromPreview(cdf) {
|
|
30689
30773
|
if (!cdf) return false;
|
|
@@ -30801,7 +30885,7 @@ function FlowScreen({
|
|
|
30801
30885
|
);
|
|
30802
30886
|
}
|
|
30803
30887
|
})();
|
|
30804
|
-
return /* @__PURE__ */ jsxs44(
|
|
30888
|
+
return /* @__PURE__ */ jsxs44(Box44, { flexDirection: "column", children: [
|
|
30805
30889
|
/* @__PURE__ */ jsx55(CustomPromptBanner, { generatePromptPath }),
|
|
30806
30890
|
content
|
|
30807
30891
|
] });
|
|
@@ -32012,13 +32096,13 @@ var init_help_info = __esm({
|
|
|
32012
32096
|
|
|
32013
32097
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
32014
32098
|
import { useEffect as useEffect22, useState as useState30 } from "react";
|
|
32015
|
-
import { Box as
|
|
32099
|
+
import { Box as Box45, Text as Text46, useInput as useInput12 } from "ink";
|
|
32016
32100
|
import { Fragment as Fragment17, jsx as jsx56, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
32017
32101
|
function Section({ title, rows }) {
|
|
32018
|
-
return /* @__PURE__ */ jsxs45(
|
|
32102
|
+
return /* @__PURE__ */ jsxs45(Box45, { flexDirection: "column", children: [
|
|
32019
32103
|
/* @__PURE__ */ jsx56(Text46, { bold: true, color: PALETTE.accent, children: title }),
|
|
32020
|
-
rows.map((row) => /* @__PURE__ */ jsxs45(
|
|
32021
|
-
/* @__PURE__ */ jsx56(
|
|
32104
|
+
rows.map((row) => /* @__PURE__ */ jsxs45(Box45, { gap: 1, children: [
|
|
32105
|
+
/* @__PURE__ */ jsx56(Box45, { width: 16, flexShrink: 0, children: /* @__PURE__ */ jsx56(Text46, { color: PALETTE.muted, children: row.label }) }),
|
|
32022
32106
|
/* @__PURE__ */ jsx56(Text46, { children: row.value })
|
|
32023
32107
|
] }, row.label))
|
|
32024
32108
|
] });
|
|
@@ -32033,7 +32117,7 @@ function HelpScreen({ onDone }) {
|
|
|
32033
32117
|
void finishDebugRun({ outputs: {}, status: "success", exitMethod });
|
|
32034
32118
|
onDone();
|
|
32035
32119
|
};
|
|
32036
|
-
|
|
32120
|
+
useInput12((input, key) => {
|
|
32037
32121
|
if (key.return) {
|
|
32038
32122
|
leave("saved");
|
|
32039
32123
|
return;
|
|
@@ -32043,7 +32127,7 @@ function HelpScreen({ onDone }) {
|
|
|
32043
32127
|
return;
|
|
32044
32128
|
}
|
|
32045
32129
|
});
|
|
32046
|
-
return /* @__PURE__ */ jsxs45(
|
|
32130
|
+
return /* @__PURE__ */ jsxs45(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, gap: 1, children: [
|
|
32047
32131
|
/* @__PURE__ */ jsx56(Text46, { bold: true, children: "Help" }),
|
|
32048
32132
|
info ? /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
32049
32133
|
/* @__PURE__ */ jsx56(Section, { title: "Where things are stored", rows: info.storage }),
|
|
@@ -32073,7 +32157,7 @@ var init_PageContainer2 = __esm({
|
|
|
32073
32157
|
|
|
32074
32158
|
// packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx
|
|
32075
32159
|
import { useState as useState31 } from "react";
|
|
32076
|
-
import { Box as
|
|
32160
|
+
import { Box as Box46, Text as Text47, useInput as useInput13 } from "ink";
|
|
32077
32161
|
import { jsx as jsx57, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
32078
32162
|
function SettingsScreen({
|
|
32079
32163
|
onNavigate,
|
|
@@ -32085,7 +32169,7 @@ function SettingsScreen({
|
|
|
32085
32169
|
{ label: "Opt-in Analytics", screen: "settings-opt-in-analytics" },
|
|
32086
32170
|
{ label: "Debug Mode", screen: "settings-debug-mode" }
|
|
32087
32171
|
];
|
|
32088
|
-
|
|
32172
|
+
useInput13((input, key) => {
|
|
32089
32173
|
if (key.upArrow) {
|
|
32090
32174
|
setFocusIdx((i) => (i - 1 + items.length) % items.length);
|
|
32091
32175
|
return;
|
|
@@ -32105,7 +32189,7 @@ function SettingsScreen({
|
|
|
32105
32189
|
onBack();
|
|
32106
32190
|
}
|
|
32107
32191
|
});
|
|
32108
|
-
return /* @__PURE__ */ jsxs46(
|
|
32192
|
+
return /* @__PURE__ */ jsxs46(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
32109
32193
|
/* @__PURE__ */ jsx57(Text47, { bold: true, children: "Settings" }),
|
|
32110
32194
|
/* @__PURE__ */ jsx57(Text47, { color: PALETTE.muted, children: " " }),
|
|
32111
32195
|
items.map((item, i) => /* @__PURE__ */ jsxs46(Text47, { color: i === focusIdx ? PALETTE.accent : void 0, children: [
|
|
@@ -32447,10 +32531,10 @@ var init_AgentStatusBadge = __esm({
|
|
|
32447
32531
|
|
|
32448
32532
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx
|
|
32449
32533
|
import { useEffect as useEffect23, useState as useState32 } from "react";
|
|
32450
|
-
import { Box as
|
|
32534
|
+
import { Box as Box47, Text as Text49 } from "ink";
|
|
32451
32535
|
import { jsx as jsx59, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
32452
32536
|
function StatusHeading() {
|
|
32453
|
-
return /* @__PURE__ */ jsxs47(
|
|
32537
|
+
return /* @__PURE__ */ jsxs47(Box47, { gap: 1, children: [
|
|
32454
32538
|
/* @__PURE__ */ jsx59(Text49, { bold: true, color: PALETTE.muted, children: "STATUS" }),
|
|
32455
32539
|
/* @__PURE__ */ jsx59(Text49, { color: PALETTE.muted, children: "\xB7 read only" })
|
|
32456
32540
|
] });
|
|
@@ -32532,7 +32616,7 @@ function AgentDetail({
|
|
|
32532
32616
|
actions: [action],
|
|
32533
32617
|
notice: testing ? null : notice,
|
|
32534
32618
|
busy: saving || testing,
|
|
32535
|
-
children: /* @__PURE__ */ jsxs47(
|
|
32619
|
+
children: /* @__PURE__ */ jsxs47(Box47, { flexDirection: "column", marginTop: 1, children: [
|
|
32536
32620
|
/* @__PURE__ */ jsx59(StatusHeading, {}),
|
|
32537
32621
|
statusRows(name, checks, settings.binary).map((row) => /* @__PURE__ */ jsx59(FormReadOnlyRow, { label: row.label, labelWidth, children: /* @__PURE__ */ jsx59(Text49, { color: TONE_COLOR[row.tone], children: row.value }) }, row.label))
|
|
32538
32622
|
] })
|
|
@@ -32560,7 +32644,7 @@ var init_AgentDetail = __esm({
|
|
|
32560
32644
|
|
|
32561
32645
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentsScreen.tsx
|
|
32562
32646
|
import { useEffect as useEffect24, useRef as useRef15, useState as useState33 } from "react";
|
|
32563
|
-
import { Box as
|
|
32647
|
+
import { Box as Box48, Text as Text50, useInput as useInput14 } from "ink";
|
|
32564
32648
|
import { Fragment as Fragment18, jsx as jsx60, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
32565
32649
|
function AgentsScreen({ onDone }) {
|
|
32566
32650
|
const [config, setConfig] = useState33(null);
|
|
@@ -32637,7 +32721,7 @@ function AgentsScreen({ onDone }) {
|
|
|
32637
32721
|
setNotice({ kind: "error", text: `Default agent not changed: ${visit.error}` });
|
|
32638
32722
|
}).finally(() => setSaving(false));
|
|
32639
32723
|
};
|
|
32640
|
-
|
|
32724
|
+
useInput14((input, key) => {
|
|
32641
32725
|
if (loadError && (key.escape || input === "q")) {
|
|
32642
32726
|
endVisit(null);
|
|
32643
32727
|
onDone();
|
|
@@ -32669,7 +32753,7 @@ function AgentsScreen({ onDone }) {
|
|
|
32669
32753
|
}
|
|
32670
32754
|
});
|
|
32671
32755
|
if (!config) {
|
|
32672
|
-
return /* @__PURE__ */ jsxs48(
|
|
32756
|
+
return /* @__PURE__ */ jsxs48(Box48, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
32673
32757
|
/* @__PURE__ */ jsx60(Text50, { bold: true, children: "Settings \u203A Configuration \u203A Agents" }),
|
|
32674
32758
|
/* @__PURE__ */ jsx60(Text50, { children: " " }),
|
|
32675
32759
|
loadError ? /* @__PURE__ */ jsxs48(Fragment18, { children: [
|
|
@@ -32704,35 +32788,35 @@ function AgentsScreen({ onDone }) {
|
|
|
32704
32788
|
);
|
|
32705
32789
|
}
|
|
32706
32790
|
const focusedAgent = AGENT_NAMES[focus];
|
|
32707
|
-
return /* @__PURE__ */ jsxs48(
|
|
32791
|
+
return /* @__PURE__ */ jsxs48(Box48, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
32708
32792
|
/* @__PURE__ */ jsx60(Text50, { bold: true, children: "Settings \u203A Configuration \u203A Agents" }),
|
|
32709
32793
|
/* @__PURE__ */ jsx60(Text50, { children: " " }),
|
|
32710
32794
|
/* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: "The coding agent the CLI runs, and what was found for each one." }),
|
|
32711
32795
|
/* @__PURE__ */ jsx60(Text50, { children: " " }),
|
|
32712
|
-
/* @__PURE__ */ jsxs48(
|
|
32796
|
+
/* @__PURE__ */ jsxs48(Box48, { gap: 1, children: [
|
|
32713
32797
|
/* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: "Default agent" }),
|
|
32714
32798
|
/* @__PURE__ */ jsx60(Text50, { bold: true, children: AGENT_LABELS[config.defaultAgent] }),
|
|
32715
32799
|
saving && /* @__PURE__ */ jsx60(Text50, { color: PALETTE.accent, children: "\u2026 saving" })
|
|
32716
32800
|
] }),
|
|
32717
|
-
/* @__PURE__ */ jsxs48(
|
|
32801
|
+
/* @__PURE__ */ jsxs48(Box48, { marginTop: 1, gap: 1, children: [
|
|
32718
32802
|
/* @__PURE__ */ jsx60(Text50, { children: " " }),
|
|
32719
32803
|
/* @__PURE__ */ jsx60(Text50, { children: " " }),
|
|
32720
|
-
/* @__PURE__ */ jsx60(
|
|
32804
|
+
/* @__PURE__ */ jsx60(Box48, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: "AGENT" }) }),
|
|
32721
32805
|
/* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: "STATUS" })
|
|
32722
32806
|
] }),
|
|
32723
32807
|
AGENT_NAMES.map((name) => {
|
|
32724
32808
|
const isFocused = focusedAgent === name;
|
|
32725
|
-
return /* @__PURE__ */ jsxs48(
|
|
32809
|
+
return /* @__PURE__ */ jsxs48(Box48, { gap: 1, children: [
|
|
32726
32810
|
/* @__PURE__ */ jsx60(Text50, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " }),
|
|
32727
32811
|
/* @__PURE__ */ jsx60(Text50, { color: PALETTE.success, children: name === config.defaultAgent ? "\u2605" : " " }),
|
|
32728
|
-
/* @__PURE__ */ jsx60(
|
|
32812
|
+
/* @__PURE__ */ jsx60(Box48, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx60(Text50, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[name] }) }),
|
|
32729
32813
|
/* @__PURE__ */ jsx60(AgentStatusBadge, { name, checks: checks[name], binary: config.agents[name].binary })
|
|
32730
32814
|
] }, name);
|
|
32731
32815
|
}),
|
|
32732
|
-
/* @__PURE__ */ jsxs48(
|
|
32816
|
+
/* @__PURE__ */ jsxs48(Box48, { flexDirection: "column", marginTop: 1, children: [
|
|
32733
32817
|
/* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: `\u2500 ${AGENT_LABELS[focusedAgent]} ${"\u2500".repeat(30)}` }),
|
|
32734
|
-
panelRows(focusedAgent, checks[focusedAgent], config.agents[focusedAgent]).map((row) => /* @__PURE__ */ jsxs48(
|
|
32735
|
-
/* @__PURE__ */ jsx60(
|
|
32818
|
+
panelRows(focusedAgent, checks[focusedAgent], config.agents[focusedAgent]).map((row) => /* @__PURE__ */ jsxs48(Box48, { gap: 1, paddingLeft: 1, children: [
|
|
32819
|
+
/* @__PURE__ */ jsx60(Box48, { width: PANEL_LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx60(Text50, { color: PALETTE.muted, children: row.label }) }),
|
|
32736
32820
|
/* @__PURE__ */ jsx60(Text50, { color: TONE_COLOR[row.tone], children: row.value })
|
|
32737
32821
|
] }, row.label))
|
|
32738
32822
|
] }),
|
|
@@ -32810,7 +32894,7 @@ var init_project_store = __esm({
|
|
|
32810
32894
|
|
|
32811
32895
|
// packages/experience-design-system-cli/src/tui/settings/configuration/project/ProjectScreen.tsx
|
|
32812
32896
|
import { useEffect as useEffect25, useRef as useRef16, useState as useState34 } from "react";
|
|
32813
|
-
import { Box as
|
|
32897
|
+
import { Box as Box49, Text as Text51, useInput as useInput15 } from "ink";
|
|
32814
32898
|
import { Fragment as Fragment19, jsx as jsx61, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
32815
32899
|
function debugFields(config) {
|
|
32816
32900
|
return {
|
|
@@ -32873,14 +32957,14 @@ function ProjectScreen({ onDone }) {
|
|
|
32873
32957
|
exitMethod: change.changed ? "saved" : "discarded"
|
|
32874
32958
|
});
|
|
32875
32959
|
};
|
|
32876
|
-
|
|
32960
|
+
useInput15((input, key) => {
|
|
32877
32961
|
if (!config && loadError && (key.escape || input === "q")) {
|
|
32878
32962
|
endVisit(null);
|
|
32879
32963
|
onDone();
|
|
32880
32964
|
}
|
|
32881
32965
|
});
|
|
32882
32966
|
if (!config) {
|
|
32883
|
-
return /* @__PURE__ */ jsxs49(
|
|
32967
|
+
return /* @__PURE__ */ jsxs49(Box49, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
32884
32968
|
/* @__PURE__ */ jsx61(Text51, { bold: true, children: "Settings \u203A Configuration \u203A Project" }),
|
|
32885
32969
|
/* @__PURE__ */ jsx61(Text51, { children: " " }),
|
|
32886
32970
|
loadError ? /* @__PURE__ */ jsxs49(Fragment19, { children: [
|
|
@@ -32957,13 +33041,13 @@ var init_ProjectScreen = __esm({
|
|
|
32957
33041
|
|
|
32958
33042
|
// packages/experience-design-system-cli/src/tui/settings/configuration/ConfigurationScreen.tsx
|
|
32959
33043
|
import { useState as useState35 } from "react";
|
|
32960
|
-
import { Box as
|
|
33044
|
+
import { Box as Box50, Text as Text52, useInput as useInput16 } from "ink";
|
|
32961
33045
|
import { jsx as jsx62, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
32962
33046
|
function ConfigurationScreen({ onDone }) {
|
|
32963
33047
|
const [focus, setFocus] = useState35(0);
|
|
32964
33048
|
const [open, setOpen] = useState35(null);
|
|
32965
33049
|
const close = () => setOpen(null);
|
|
32966
|
-
|
|
33050
|
+
useInput16((input, key) => {
|
|
32967
33051
|
if (open) return;
|
|
32968
33052
|
if (key.upArrow) {
|
|
32969
33053
|
setFocus((i) => (i - 1 + SECTIONS.length) % SECTIONS.length);
|
|
@@ -32981,12 +33065,12 @@ function ConfigurationScreen({ onDone }) {
|
|
|
32981
33065
|
});
|
|
32982
33066
|
if (open === "project") return /* @__PURE__ */ jsx62(ProjectScreen, { onDone: close });
|
|
32983
33067
|
if (open === "agents") return /* @__PURE__ */ jsx62(AgentsScreen, { onDone: close });
|
|
32984
|
-
return /* @__PURE__ */ jsxs50(
|
|
33068
|
+
return /* @__PURE__ */ jsxs50(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
32985
33069
|
/* @__PURE__ */ jsx62(Text52, { bold: true, children: "Settings \u203A Configuration" }),
|
|
32986
33070
|
/* @__PURE__ */ jsx62(Text52, { children: " " }),
|
|
32987
|
-
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs50(
|
|
33071
|
+
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs50(Box50, { gap: 1, children: [
|
|
32988
33072
|
/* @__PURE__ */ jsx62(Text52, { color: index === focus ? PALETTE.accent : void 0, children: index === focus ? "\u276F" : " " }),
|
|
32989
|
-
/* @__PURE__ */ jsx62(
|
|
33073
|
+
/* @__PURE__ */ jsx62(Box50, { width: 9, flexShrink: 0, children: /* @__PURE__ */ jsx62(Text52, { bold: index === focus, color: index === focus ? PALETTE.accent : void 0, children: section.label }) }),
|
|
32990
33074
|
/* @__PURE__ */ jsx62(Text52, { color: PALETTE.muted, children: section.description })
|
|
32991
33075
|
] }, section.id)),
|
|
32992
33076
|
/* @__PURE__ */ jsx62(Text52, { children: " " }),
|
|
@@ -33023,7 +33107,7 @@ var init_ConfigurationScreen = __esm({
|
|
|
33023
33107
|
|
|
33024
33108
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
33025
33109
|
import { useEffect as useEffect26, useState as useState36 } from "react";
|
|
33026
|
-
import { Box as
|
|
33110
|
+
import { Box as Box51, Text as Text53, useInput as useInput17 } from "ink";
|
|
33027
33111
|
import { Fragment as Fragment20, jsx as jsx63, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
33028
33112
|
function OptInAnalyticsScreen({ onDone }) {
|
|
33029
33113
|
const [loading, setLoading] = useState36(true);
|
|
@@ -33040,7 +33124,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
33040
33124
|
});
|
|
33041
33125
|
});
|
|
33042
33126
|
}, []);
|
|
33043
|
-
|
|
33127
|
+
useInput17((input, key) => {
|
|
33044
33128
|
if (loading) return;
|
|
33045
33129
|
if (key.return || input === " ") {
|
|
33046
33130
|
setEnabled((current) => {
|
|
@@ -33055,7 +33139,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
33055
33139
|
onDone();
|
|
33056
33140
|
}
|
|
33057
33141
|
});
|
|
33058
|
-
return /* @__PURE__ */ jsxs51(
|
|
33142
|
+
return /* @__PURE__ */ jsxs51(Box51, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33059
33143
|
/* @__PURE__ */ jsx63(Text53, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
33060
33144
|
/* @__PURE__ */ jsx63(Text53, { children: " " }),
|
|
33061
33145
|
loading ? /* @__PURE__ */ jsx63(Text53, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs51(Fragment20, { children: [
|
|
@@ -33092,7 +33176,7 @@ var init_screen11 = __esm({
|
|
|
33092
33176
|
|
|
33093
33177
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
33094
33178
|
import { useEffect as useEffect27, useRef as useRef17, useState as useState37 } from "react";
|
|
33095
|
-
import { Box as
|
|
33179
|
+
import { Box as Box52, Text as Text54, useInput as useInput18 } from "ink";
|
|
33096
33180
|
import { Fragment as Fragment21, jsx as jsx64, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
33097
33181
|
function DebugModeScreen({ onDone }) {
|
|
33098
33182
|
const [setting, setSetting] = useState37(null);
|
|
@@ -33142,7 +33226,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
33142
33226
|
exitMethod: change.changed ? "saved" : "discarded"
|
|
33143
33227
|
});
|
|
33144
33228
|
};
|
|
33145
|
-
|
|
33229
|
+
useInput18((input, key) => {
|
|
33146
33230
|
if (!setting) return;
|
|
33147
33231
|
if (key.upArrow || key.downArrow) {
|
|
33148
33232
|
setFocus((current) => ROWS[(ROWS.indexOf(current) + (key.downArrow ? 1 : ROWS.length - 1)) % ROWS.length]);
|
|
@@ -33171,16 +33255,16 @@ function DebugModeScreen({ onDone }) {
|
|
|
33171
33255
|
});
|
|
33172
33256
|
const marker = (row) => /* @__PURE__ */ jsx64(Text54, { color: focus === row ? PALETTE.accent : void 0, children: focus === row ? "\u276F" : " " });
|
|
33173
33257
|
const label = (row, text) => /* @__PURE__ */ jsx64(Text54, { bold: focus === row, color: focus === row ? PALETTE.accent : PALETTE.muted, children: text });
|
|
33174
|
-
return /* @__PURE__ */ jsxs52(
|
|
33258
|
+
return /* @__PURE__ */ jsxs52(Box52, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33175
33259
|
/* @__PURE__ */ jsx64(Text54, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
33176
33260
|
/* @__PURE__ */ jsx64(Text54, { children: " " }),
|
|
33177
33261
|
setting ? /* @__PURE__ */ jsxs52(Fragment21, { children: [
|
|
33178
|
-
/* @__PURE__ */ jsxs52(
|
|
33262
|
+
/* @__PURE__ */ jsxs52(Box52, { gap: 1, children: [
|
|
33179
33263
|
marker("enabled"),
|
|
33180
33264
|
label("enabled", "Debug logging:"),
|
|
33181
33265
|
/* @__PURE__ */ jsx64(Text54, { bold: true, color: setting.enabled ? PALETTE.success : PALETTE.muted, children: setting.enabled ? "On" : "Off" })
|
|
33182
33266
|
] }),
|
|
33183
|
-
/* @__PURE__ */ jsxs52(
|
|
33267
|
+
/* @__PURE__ */ jsxs52(Box52, { gap: 1, children: [
|
|
33184
33268
|
marker("retentionDays"),
|
|
33185
33269
|
label("retentionDays", "Delete logs after:"),
|
|
33186
33270
|
RETENTION_CHOICES.map((days) => {
|