@contentful/experience-design-system-cli 2.37.1-dev-build-900f9bf0.0 → 2.37.1-dev-build-05c9c394.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 CHANGED
@@ -18230,6 +18230,15 @@ var MENU = [
18230
18230
  { choice: "continue", label: "Continue", description: "Check the credentials and go on" },
18231
18231
  { choice: "edit", label: "Edit", description: "Change the credentials" }
18232
18232
  ];
18233
+ function SectionLabel({ label, active = false }) {
18234
+ const columns = useTerminalWidth();
18235
+ const rule = "\u2500".repeat(Math.max(2, columns - label.length - 8));
18236
+ return /* @__PURE__ */ jsxs14(Text14, { color: PALETTE.border, dimColor: !active, children: [
18237
+ "\u2500\u2500 ",
18238
+ /* @__PURE__ */ jsx15(Text14, { color: active ? PALETTE.accent : PALETTE.muted, children: label }),
18239
+ ` ${rule}`
18240
+ ] });
18241
+ }
18233
18242
  function CredentialsScreen({
18234
18243
  onDone,
18235
18244
  onBack,
@@ -18298,7 +18307,6 @@ function CredentialsScreen({
18298
18307
  else if (key.downArrow || key.tab) setFocus((current) => (current + 1) % MENU.length);
18299
18308
  });
18300
18309
  const labelWidth = formLabelWidth([...FIELDS2, ...MENU]);
18301
- const isLastField = active === FIELDS2.length - 1;
18302
18310
  const changed = !isUnchanged(normalize(values), initialValues);
18303
18311
  return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", children: [
18304
18312
  /* @__PURE__ */ jsx15(StepHeader, { step: "setup" }),
@@ -18307,7 +18315,7 @@ function CredentialsScreen({
18307
18315
  /* @__PURE__ */ jsx15(Text14, { children: " " }),
18308
18316
  /* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: prefilled ? "Credentials pre-filled from the configuration settings." : "Enter the Contentful space you want to import into." }),
18309
18317
  /* @__PURE__ */ jsx15(Text14, { children: " " }),
18310
- /* @__PURE__ */ jsx15(Text14, { bold: true, color: editing ? PALETTE.muted : PALETTE.accent, children: "ACTIONS" }),
18318
+ /* @__PURE__ */ jsx15(SectionLabel, { label: "Actions", active: !editing }),
18311
18319
  MENU.map((item, index) => {
18312
18320
  const focused = !editing && index === focus;
18313
18321
  return /* @__PURE__ */ jsxs14(Box14, { gap: 1, children: [
@@ -18316,42 +18324,30 @@ function CredentialsScreen({
18316
18324
  /* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: item.description })
18317
18325
  ] }, item.choice);
18318
18326
  }),
18319
- /* @__PURE__ */ jsxs14(
18320
- Box14,
18321
- {
18322
- flexDirection: "column",
18323
- marginTop: 1,
18324
- borderStyle: "single",
18325
- borderColor: PALETTE.border,
18326
- borderBottom: false,
18327
- borderLeft: false,
18328
- borderRight: false,
18329
- children: [
18330
- /* @__PURE__ */ jsx15(Text14, { bold: true, color: editing ? PALETTE.accent : PALETTE.muted, children: "SPACE" }),
18331
- FIELDS2.map((field, index) => {
18332
- const open = editing && index === active;
18333
- const value = values[field.key];
18334
- const display = field.masked ? "\u2022".repeat(value.length) : value;
18335
- return /* @__PURE__ */ jsxs14(Box14, { gap: 1, children: [
18336
- /* @__PURE__ */ jsx15(Text14, { color: PALETTE.accent, children: open ? "\u276F" : " " }),
18337
- /* @__PURE__ */ jsx15(Box14, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx15(Text14, { bold: open, color: open ? PALETTE.accent : PALETTE.muted, children: field.label }) }),
18338
- open ? /* @__PURE__ */ jsx15(
18339
- ClearableTextInput,
18340
- {
18341
- value,
18342
- onChange: (next) => {
18343
- setValues((current) => ({ ...current, [field.key]: next }));
18344
- setNotice(null);
18345
- },
18346
- onSubmit: () => isLastField ? stopEditing() : setActive(index + 1),
18347
- mask: field.masked ? "\u2022" : void 0
18348
- }
18349
- ) : /* @__PURE__ */ jsx15(Text14, { color: display ? PALETTE.text : PALETTE.muted, children: display || (field.hint ?? "(empty)") })
18350
- ] }, field.key);
18351
- })
18352
- ]
18353
- }
18354
- ),
18327
+ /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", marginTop: 1, children: [
18328
+ /* @__PURE__ */ jsx15(SectionLabel, { label: "Space", active: editing }),
18329
+ FIELDS2.map((field, index) => {
18330
+ const open = editing && index === active;
18331
+ const value = values[field.key];
18332
+ const display = field.masked ? "\u2022".repeat(value.length) : value;
18333
+ return /* @__PURE__ */ jsxs14(Box14, { gap: 1, children: [
18334
+ /* @__PURE__ */ jsx15(Text14, { color: PALETTE.accent, children: open ? "\u276F" : " " }),
18335
+ /* @__PURE__ */ jsx15(Box14, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx15(Text14, { bold: open, color: open ? PALETTE.accent : PALETTE.muted, children: field.label }) }),
18336
+ open ? /* @__PURE__ */ jsx15(
18337
+ ClearableTextInput,
18338
+ {
18339
+ value,
18340
+ onChange: (next) => {
18341
+ setValues((current) => ({ ...current, [field.key]: next }));
18342
+ setNotice(null);
18343
+ },
18344
+ onSubmit: stopEditing,
18345
+ mask: field.masked ? "\u2022" : void 0
18346
+ }
18347
+ ) : /* @__PURE__ */ jsx15(Text14, { color: display ? PALETTE.text : PALETTE.muted, children: display || (field.hint ?? "(empty)") })
18348
+ ] }, field.key);
18349
+ })
18350
+ ] }),
18355
18351
  notice && /* @__PURE__ */ jsxs14(Fragment2, { children: [
18356
18352
  /* @__PURE__ */ jsx15(Text14, { children: " " }),
18357
18353
  /* @__PURE__ */ jsxs14(Text14, { color: PALETTE.error, children: [
@@ -18379,7 +18375,7 @@ function CredentialsScreen({
18379
18375
  {
18380
18376
  hints: [
18381
18377
  { keys: "\u2191/\u2193", label: "field" },
18382
- { keys: "\u23CE", label: isLastField ? "done" : "next field" },
18378
+ { keys: "\u23CE", label: "save" },
18383
18379
  { keys: "Ctrl+D", label: "clear" },
18384
18380
  { keys: "Esc", label: prefilled ? "cancel" : "back" }
18385
18381
  ]
package/dist/index.js CHANGED
@@ -20686,6 +20686,15 @@ var init_validate4 = __esm({
20686
20686
  import { useRef as useRef2, useState as useState9 } from "react";
20687
20687
  import { Box as Box14, Text as Text14, useInput as useInput11 } from "ink";
20688
20688
  import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
20689
+ function SectionLabel({ label, active = false }) {
20690
+ const columns = useTerminalWidth();
20691
+ const rule = "\u2500".repeat(Math.max(2, columns - label.length - 8));
20692
+ return /* @__PURE__ */ jsxs14(Text14, { color: PALETTE.border, dimColor: !active, children: [
20693
+ "\u2500\u2500 ",
20694
+ /* @__PURE__ */ jsx15(Text14, { color: active ? PALETTE.accent : PALETTE.muted, children: label }),
20695
+ ` ${rule}`
20696
+ ] });
20697
+ }
20689
20698
  function CredentialsScreen({
20690
20699
  onDone,
20691
20700
  onBack,
@@ -20754,7 +20763,6 @@ function CredentialsScreen({
20754
20763
  else if (key.downArrow || key.tab) setFocus((current) => (current + 1) % MENU.length);
20755
20764
  });
20756
20765
  const labelWidth = formLabelWidth([...FIELDS2, ...MENU]);
20757
- const isLastField = active === FIELDS2.length - 1;
20758
20766
  const changed = !isUnchanged(normalize(values), initialValues);
20759
20767
  return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", children: [
20760
20768
  /* @__PURE__ */ jsx15(StepHeader, { step: "setup" }),
@@ -20763,7 +20771,7 @@ function CredentialsScreen({
20763
20771
  /* @__PURE__ */ jsx15(Text14, { children: " " }),
20764
20772
  /* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: prefilled ? "Credentials pre-filled from the configuration settings." : "Enter the Contentful space you want to import into." }),
20765
20773
  /* @__PURE__ */ jsx15(Text14, { children: " " }),
20766
- /* @__PURE__ */ jsx15(Text14, { bold: true, color: editing ? PALETTE.muted : PALETTE.accent, children: "ACTIONS" }),
20774
+ /* @__PURE__ */ jsx15(SectionLabel, { label: "Actions", active: !editing }),
20767
20775
  MENU.map((item, index) => {
20768
20776
  const focused = !editing && index === focus;
20769
20777
  return /* @__PURE__ */ jsxs14(Box14, { gap: 1, children: [
@@ -20772,42 +20780,30 @@ function CredentialsScreen({
20772
20780
  /* @__PURE__ */ jsx15(Text14, { color: PALETTE.muted, children: item.description })
20773
20781
  ] }, item.choice);
20774
20782
  }),
20775
- /* @__PURE__ */ jsxs14(
20776
- Box14,
20777
- {
20778
- flexDirection: "column",
20779
- marginTop: 1,
20780
- borderStyle: "single",
20781
- borderColor: PALETTE.border,
20782
- borderBottom: false,
20783
- borderLeft: false,
20784
- borderRight: false,
20785
- children: [
20786
- /* @__PURE__ */ jsx15(Text14, { bold: true, color: editing ? PALETTE.accent : PALETTE.muted, children: "SPACE" }),
20787
- FIELDS2.map((field, index) => {
20788
- const open = editing && index === active;
20789
- const value = values[field.key];
20790
- const display = field.masked ? "\u2022".repeat(value.length) : value;
20791
- return /* @__PURE__ */ jsxs14(Box14, { gap: 1, children: [
20792
- /* @__PURE__ */ jsx15(Text14, { color: PALETTE.accent, children: open ? "\u276F" : " " }),
20793
- /* @__PURE__ */ jsx15(Box14, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx15(Text14, { bold: open, color: open ? PALETTE.accent : PALETTE.muted, children: field.label }) }),
20794
- open ? /* @__PURE__ */ jsx15(
20795
- ClearableTextInput,
20796
- {
20797
- value,
20798
- onChange: (next) => {
20799
- setValues((current) => ({ ...current, [field.key]: next }));
20800
- setNotice(null);
20801
- },
20802
- onSubmit: () => isLastField ? stopEditing() : setActive(index + 1),
20803
- mask: field.masked ? "\u2022" : void 0
20804
- }
20805
- ) : /* @__PURE__ */ jsx15(Text14, { color: display ? PALETTE.text : PALETTE.muted, children: display || (field.hint ?? "(empty)") })
20806
- ] }, field.key);
20807
- })
20808
- ]
20809
- }
20810
- ),
20783
+ /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", marginTop: 1, children: [
20784
+ /* @__PURE__ */ jsx15(SectionLabel, { label: "Space", active: editing }),
20785
+ FIELDS2.map((field, index) => {
20786
+ const open = editing && index === active;
20787
+ const value = values[field.key];
20788
+ const display = field.masked ? "\u2022".repeat(value.length) : value;
20789
+ return /* @__PURE__ */ jsxs14(Box14, { gap: 1, children: [
20790
+ /* @__PURE__ */ jsx15(Text14, { color: PALETTE.accent, children: open ? "\u276F" : " " }),
20791
+ /* @__PURE__ */ jsx15(Box14, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx15(Text14, { bold: open, color: open ? PALETTE.accent : PALETTE.muted, children: field.label }) }),
20792
+ open ? /* @__PURE__ */ jsx15(
20793
+ ClearableTextInput,
20794
+ {
20795
+ value,
20796
+ onChange: (next) => {
20797
+ setValues((current) => ({ ...current, [field.key]: next }));
20798
+ setNotice(null);
20799
+ },
20800
+ onSubmit: stopEditing,
20801
+ mask: field.masked ? "\u2022" : void 0
20802
+ }
20803
+ ) : /* @__PURE__ */ jsx15(Text14, { color: display ? PALETTE.text : PALETTE.muted, children: display || (field.hint ?? "(empty)") })
20804
+ ] }, field.key);
20805
+ })
20806
+ ] }),
20811
20807
  notice && /* @__PURE__ */ jsxs14(Fragment2, { children: [
20812
20808
  /* @__PURE__ */ jsx15(Text14, { children: " " }),
20813
20809
  /* @__PURE__ */ jsxs14(Text14, { color: PALETTE.error, children: [
@@ -20835,7 +20831,7 @@ function CredentialsScreen({
20835
20831
  {
20836
20832
  hints: [
20837
20833
  { keys: "\u2191/\u2193", label: "field" },
20838
- { keys: "\u23CE", label: isLastField ? "done" : "next field" },
20834
+ { keys: "\u23CE", label: "save" },
20839
20835
  { keys: "Ctrl+D", label: "clear" },
20840
20836
  { keys: "Esc", label: prefilled ? "cancel" : "back" }
20841
20837
  ]
@@ -20854,6 +20850,7 @@ var init_screen5 = __esm({
20854
20850
  init_ClearableTextInput();
20855
20851
  init_ControlHints();
20856
20852
  init_StepHeader();
20853
+ init_use_terminal_width();
20857
20854
  init_logic8();
20858
20855
  init_validate4();
20859
20856
  FIELDS2 = [
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-900f9bf0.0",
3
+ "version": "2.37.1-dev-build-05c9c394.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
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-900f9bf0.0",
3
+ "version": "2.37.1-dev-build-05c9c394.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-types": "2.37.1-dev-build-900f9bf0.0",
49
- "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-900f9bf0.0"
48
+ "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-05c9c394.0",
49
+ "@contentful/experience-design-system-types": "2.37.1-dev-build-05c9c394.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@tsconfig/node24": "^24.0.4",