@contentful/experience-design-system-cli 2.37.1-dev-build-75039ab7.0 → 2.37.1-dev-build-2ec208d2.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 +25 -17
- package/dist/index.js +26 -18
- package/dist/package.json +1 -1
- package/dist/src/tui/settings/shared/FieldForm.d.ts +13 -0
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -28856,6 +28856,20 @@ import { useState as useState29 } from "react";
|
|
|
28856
28856
|
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
28857
28857
|
import TextInput4 from "ink-text-input";
|
|
28858
28858
|
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
28859
|
+
function formLabelWidth(rows) {
|
|
28860
|
+
return Math.max(...rows.map((row) => row.label.length));
|
|
28861
|
+
}
|
|
28862
|
+
function FormReadOnlyRow({
|
|
28863
|
+
label,
|
|
28864
|
+
labelWidth,
|
|
28865
|
+
children
|
|
28866
|
+
}) {
|
|
28867
|
+
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
28868
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
28869
|
+
/* @__PURE__ */ jsx55(Box44, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: label }) }),
|
|
28870
|
+
children
|
|
28871
|
+
] });
|
|
28872
|
+
}
|
|
28859
28873
|
function FieldForm({
|
|
28860
28874
|
title,
|
|
28861
28875
|
subtitle,
|
|
@@ -28873,10 +28887,7 @@ function FieldForm({
|
|
|
28873
28887
|
const [editing, setEditing] = useState29(false);
|
|
28874
28888
|
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
28875
28889
|
const rowCount = fields2.length + actions.length;
|
|
28876
|
-
const labelWidth =
|
|
28877
|
-
...fields2.map((field) => field.label.length),
|
|
28878
|
-
...actions.map((action) => action.label.length)
|
|
28879
|
-
);
|
|
28890
|
+
const labelWidth = formLabelWidth([...fields2, ...actions]);
|
|
28880
28891
|
const currentField = active < fields2.length ? fields2[active] : void 0;
|
|
28881
28892
|
const currentAction = currentField ? void 0 : actions[active - fields2.length];
|
|
28882
28893
|
useInput11((input, key) => {
|
|
@@ -28938,8 +28949,12 @@ function FieldForm({
|
|
|
28938
28949
|
onSubmit: () => setEditing(false),
|
|
28939
28950
|
mask: field.masked ? "\u2022" : void 0
|
|
28940
28951
|
}
|
|
28941
|
-
) :
|
|
28942
|
-
|
|
28952
|
+
) : display ? /* @__PURE__ */ jsx55(Text46, { bold: true, children: display }) : (
|
|
28953
|
+
// An empty value shows its hint (or "(empty)") in the value's place, not after an empty element, so the
|
|
28954
|
+
// text starts in the same column as every other row's.
|
|
28955
|
+
/* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: field.hint ?? "(empty)" })
|
|
28956
|
+
),
|
|
28957
|
+
display && field.hint && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: field.hint })
|
|
28943
28958
|
] }, field.key);
|
|
28944
28959
|
}),
|
|
28945
28960
|
actions.map((action, index) => {
|
|
@@ -29023,15 +29038,6 @@ var fields = (name) => [
|
|
|
29023
29038
|
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(name)})` }
|
|
29024
29039
|
];
|
|
29025
29040
|
var INSPECT_DELAY_MS = 400;
|
|
29026
|
-
var LABEL_WIDTH = "Command path".length;
|
|
29027
|
-
var LABEL_GAP = 2;
|
|
29028
|
-
var POINTER_WIDTH = 2;
|
|
29029
|
-
function Row2({ label, children }) {
|
|
29030
|
-
return /* @__PURE__ */ jsxs46(Box45, { children: [
|
|
29031
|
-
/* @__PURE__ */ jsx57(Box45, { width: POINTER_WIDTH + LABEL_WIDTH + LABEL_GAP, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: label }) }),
|
|
29032
|
-
children
|
|
29033
|
-
] });
|
|
29034
|
-
}
|
|
29035
29041
|
function StatusHeading() {
|
|
29036
29042
|
return /* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
|
|
29037
29043
|
/* @__PURE__ */ jsx57(Text48, { bold: true, color: PALETTE.muted, children: "STATUS" }),
|
|
@@ -29090,12 +29096,14 @@ function AgentDetail({
|
|
|
29090
29096
|
hint: "run test",
|
|
29091
29097
|
onRun: runTest
|
|
29092
29098
|
};
|
|
29099
|
+
const formFields = fields(name);
|
|
29100
|
+
const labelWidth = formLabelWidth([...formFields, action]);
|
|
29093
29101
|
return /* @__PURE__ */ jsx57(
|
|
29094
29102
|
FieldForm,
|
|
29095
29103
|
{
|
|
29096
29104
|
title: AGENT_LABELS[name],
|
|
29097
29105
|
subtitle: config.defaultAgent === name ? "This is the default agent." : `Runs the \`${AGENT_BINARIES[name]}\` command.`,
|
|
29098
|
-
fields:
|
|
29106
|
+
fields: formFields,
|
|
29099
29107
|
values: { binary: settings.binary, model: settings.model },
|
|
29100
29108
|
onChange: (key, value) => {
|
|
29101
29109
|
setConfig({ ...config, agents: { ...config.agents, [name]: { ...settings, [key]: value } } });
|
|
@@ -29108,7 +29116,7 @@ function AgentDetail({
|
|
|
29108
29116
|
busy: saving || testing,
|
|
29109
29117
|
children: /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", marginTop: 1, children: [
|
|
29110
29118
|
/* @__PURE__ */ jsx57(StatusHeading, {}),
|
|
29111
|
-
statusRows(name, checks, settings.binary).map((row) => /* @__PURE__ */ jsx57(
|
|
29119
|
+
statusRows(name, checks, settings.binary).map((row) => /* @__PURE__ */ jsx57(FormReadOnlyRow, { label: row.label, labelWidth, children: /* @__PURE__ */ jsx57(Text48, { color: TONE_COLOR[row.tone], children: row.value }) }, row.label))
|
|
29112
29120
|
] })
|
|
29113
29121
|
}
|
|
29114
29122
|
);
|
package/dist/index.js
CHANGED
|
@@ -33314,6 +33314,20 @@ import { useState as useState29 } from "react";
|
|
|
33314
33314
|
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
33315
33315
|
import TextInput4 from "ink-text-input";
|
|
33316
33316
|
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
33317
|
+
function formLabelWidth(rows) {
|
|
33318
|
+
return Math.max(...rows.map((row) => row.label.length));
|
|
33319
|
+
}
|
|
33320
|
+
function FormReadOnlyRow({
|
|
33321
|
+
label,
|
|
33322
|
+
labelWidth,
|
|
33323
|
+
children
|
|
33324
|
+
}) {
|
|
33325
|
+
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
33326
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33327
|
+
/* @__PURE__ */ jsx55(Box44, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: label }) }),
|
|
33328
|
+
children
|
|
33329
|
+
] });
|
|
33330
|
+
}
|
|
33317
33331
|
function FieldForm({
|
|
33318
33332
|
title,
|
|
33319
33333
|
subtitle,
|
|
@@ -33331,10 +33345,7 @@ function FieldForm({
|
|
|
33331
33345
|
const [editing, setEditing] = useState29(false);
|
|
33332
33346
|
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
33333
33347
|
const rowCount = fields2.length + actions.length;
|
|
33334
|
-
const labelWidth =
|
|
33335
|
-
...fields2.map((field) => field.label.length),
|
|
33336
|
-
...actions.map((action) => action.label.length)
|
|
33337
|
-
);
|
|
33348
|
+
const labelWidth = formLabelWidth([...fields2, ...actions]);
|
|
33338
33349
|
const currentField = active < fields2.length ? fields2[active] : void 0;
|
|
33339
33350
|
const currentAction = currentField ? void 0 : actions[active - fields2.length];
|
|
33340
33351
|
useInput11((input, key) => {
|
|
@@ -33396,8 +33407,12 @@ function FieldForm({
|
|
|
33396
33407
|
onSubmit: () => setEditing(false),
|
|
33397
33408
|
mask: field.masked ? "\u2022" : void 0
|
|
33398
33409
|
}
|
|
33399
|
-
) :
|
|
33400
|
-
|
|
33410
|
+
) : display ? /* @__PURE__ */ jsx55(Text46, { bold: true, children: display }) : (
|
|
33411
|
+
// An empty value shows its hint (or "(empty)") in the value's place, not after an empty element, so the
|
|
33412
|
+
// text starts in the same column as every other row's.
|
|
33413
|
+
/* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: field.hint ?? "(empty)" })
|
|
33414
|
+
),
|
|
33415
|
+
display && field.hint && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: field.hint })
|
|
33401
33416
|
] }, field.key);
|
|
33402
33417
|
}),
|
|
33403
33418
|
actions.map((action, index) => {
|
|
@@ -33475,12 +33490,6 @@ var init_AgentStatusBadge = __esm({
|
|
|
33475
33490
|
import { useEffect as useEffect22, useState as useState30 } from "react";
|
|
33476
33491
|
import { Box as Box45, Text as Text48 } from "ink";
|
|
33477
33492
|
import { jsx as jsx57, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
33478
|
-
function Row2({ label, children }) {
|
|
33479
|
-
return /* @__PURE__ */ jsxs46(Box45, { children: [
|
|
33480
|
-
/* @__PURE__ */ jsx57(Box45, { width: POINTER_WIDTH + LABEL_WIDTH + LABEL_GAP, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: label }) }),
|
|
33481
|
-
children
|
|
33482
|
-
] });
|
|
33483
|
-
}
|
|
33484
33493
|
function StatusHeading() {
|
|
33485
33494
|
return /* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
|
|
33486
33495
|
/* @__PURE__ */ jsx57(Text48, { bold: true, color: PALETTE.muted, children: "STATUS" }),
|
|
@@ -33539,12 +33548,14 @@ function AgentDetail({
|
|
|
33539
33548
|
hint: "run test",
|
|
33540
33549
|
onRun: runTest
|
|
33541
33550
|
};
|
|
33551
|
+
const formFields = fields(name);
|
|
33552
|
+
const labelWidth = formLabelWidth([...formFields, action]);
|
|
33542
33553
|
return /* @__PURE__ */ jsx57(
|
|
33543
33554
|
FieldForm,
|
|
33544
33555
|
{
|
|
33545
33556
|
title: AGENT_LABELS[name],
|
|
33546
33557
|
subtitle: config.defaultAgent === name ? "This is the default agent." : `Runs the \`${AGENT_BINARIES[name]}\` command.`,
|
|
33547
|
-
fields:
|
|
33558
|
+
fields: formFields,
|
|
33548
33559
|
values: { binary: settings.binary, model: settings.model },
|
|
33549
33560
|
onChange: (key, value) => {
|
|
33550
33561
|
setConfig({ ...config, agents: { ...config.agents, [name]: { ...settings, [key]: value } } });
|
|
@@ -33557,12 +33568,12 @@ function AgentDetail({
|
|
|
33557
33568
|
busy: saving || testing,
|
|
33558
33569
|
children: /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", marginTop: 1, children: [
|
|
33559
33570
|
/* @__PURE__ */ jsx57(StatusHeading, {}),
|
|
33560
|
-
statusRows(name, checks, settings.binary).map((row) => /* @__PURE__ */ jsx57(
|
|
33571
|
+
statusRows(name, checks, settings.binary).map((row) => /* @__PURE__ */ jsx57(FormReadOnlyRow, { label: row.label, labelWidth, children: /* @__PURE__ */ jsx57(Text48, { color: TONE_COLOR[row.tone], children: row.value }) }, row.label))
|
|
33561
33572
|
] })
|
|
33562
33573
|
}
|
|
33563
33574
|
);
|
|
33564
33575
|
}
|
|
33565
|
-
var fields, INSPECT_DELAY_MS
|
|
33576
|
+
var fields, INSPECT_DELAY_MS;
|
|
33566
33577
|
var init_AgentDetail = __esm({
|
|
33567
33578
|
"packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx"() {
|
|
33568
33579
|
"use strict";
|
|
@@ -33578,9 +33589,6 @@ var init_AgentDetail = __esm({
|
|
|
33578
33589
|
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(name)})` }
|
|
33579
33590
|
];
|
|
33580
33591
|
INSPECT_DELAY_MS = 400;
|
|
33581
|
-
LABEL_WIDTH = "Command path".length;
|
|
33582
|
-
LABEL_GAP = 2;
|
|
33583
|
-
POINTER_WIDTH = 2;
|
|
33584
33592
|
}
|
|
33585
33593
|
});
|
|
33586
33594
|
|
package/dist/package.json
CHANGED
|
@@ -41,6 +41,19 @@ interface FieldFormProps<K extends string> {
|
|
|
41
41
|
/** Shown after the rows and the notice, for read-only content that belongs to the same screen. */
|
|
42
42
|
children?: React.ReactNode;
|
|
43
43
|
}
|
|
44
|
+
/** The widest label among a form's rows. The form pads every label to it, and read-only rows use it to line up with them. */
|
|
45
|
+
export declare function formLabelWidth(rows: readonly {
|
|
46
|
+
label: string;
|
|
47
|
+
}[]): number;
|
|
48
|
+
/**
|
|
49
|
+
* A label and value for read-only content shown with a form. It is built the same way as the form's own rows (a pointer
|
|
50
|
+
* slot, the label padded to the shared width, then the value), so its values start in the same column as the form's.
|
|
51
|
+
*/
|
|
52
|
+
export declare function FormReadOnlyRow({ label, labelWidth, children, }: {
|
|
53
|
+
label: string;
|
|
54
|
+
labelWidth: number;
|
|
55
|
+
children: React.ReactNode;
|
|
56
|
+
}): React.ReactElement;
|
|
44
57
|
/**
|
|
45
58
|
* The edit-in-place form the Configuration pages share. Fields are read-only until Enter opens one; Enter again closes it.
|
|
46
59
|
* While one is open, keys type into it (so a "q" in a path is just a "q"), and Esc closes it and restores the old value.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.37.1-dev-build-
|
|
3
|
+
"version": "2.37.1-dev-build-2ec208d2.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"ts-morph": "^27.0.2",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
47
|
"zod": "^4.6.5",
|
|
48
|
-
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-
|
|
49
|
-
"@contentful/experience-design-system-types": "2.37.1-dev-build-
|
|
48
|
+
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-2ec208d2.0",
|
|
49
|
+
"@contentful/experience-design-system-types": "2.37.1-dev-build-2ec208d2.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tsconfig/node24": "^24.0.4",
|