@contentful/experience-design-system-cli 2.35.1-dev-build-3eb7b118.0 → 2.35.1-dev-build-210d1941.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 +17 -41
- package/dist/index.js +17 -41
- package/dist/package.json +1 -1
- package/legacy/package.json +1 -1
- package/package.json +2 -2
package/dist/app.js
CHANGED
|
@@ -756,6 +756,7 @@ function SettingsScreen({
|
|
|
756
756
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
757
757
|
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
758
758
|
import { Box as Box7, Text as Text7, useInput as useInput7 } from "ink";
|
|
759
|
+
import TextInput3 from "ink-text-input";
|
|
759
760
|
|
|
760
761
|
// packages/experience-design-system-cli/src/tui/settings/utils/v1-store.ts
|
|
761
762
|
var readV1Store = readSettings;
|
|
@@ -840,13 +841,13 @@ function ConfigurationScreen({ onDone }) {
|
|
|
840
841
|
if (!config) return;
|
|
841
842
|
setConfig({ ...config, [field]: value });
|
|
842
843
|
}
|
|
843
|
-
function
|
|
844
|
+
function saveAndLeave() {
|
|
844
845
|
if (!config) return;
|
|
845
846
|
setStage("saving");
|
|
846
847
|
setMessage(null);
|
|
847
848
|
writeCredentials(config).then(() => {
|
|
848
|
-
|
|
849
|
-
|
|
849
|
+
void finishDebugRun({ outputs: debugFields(config), status: "success", exitMethod: "saved" });
|
|
850
|
+
onDone();
|
|
850
851
|
}).catch((err) => {
|
|
851
852
|
setMessage(err instanceof Error ? err.message : "Failed to save");
|
|
852
853
|
setStage("form");
|
|
@@ -854,39 +855,19 @@ function ConfigurationScreen({ onDone }) {
|
|
|
854
855
|
}
|
|
855
856
|
useInput7((input, key) => {
|
|
856
857
|
if (stage === "loading" || stage === "saving") return;
|
|
857
|
-
if (stage === "saved") {
|
|
858
|
-
if (key.return || key.escape || input === "q") {
|
|
859
|
-
void finishDebugRun({ outputs: debugFields(config), status: "success", exitMethod: "saved" });
|
|
860
|
-
onDone();
|
|
861
|
-
}
|
|
862
|
-
return;
|
|
863
|
-
}
|
|
864
858
|
if (editing) {
|
|
865
|
-
if (key.return) {
|
|
866
|
-
setEditing(false);
|
|
867
|
-
return;
|
|
868
|
-
}
|
|
869
859
|
if (key.escape) {
|
|
870
860
|
setFieldValue(activeField, valueBeforeEdit);
|
|
871
861
|
setEditing(false);
|
|
872
|
-
return;
|
|
873
|
-
}
|
|
874
|
-
if (key.backspace || key.delete) {
|
|
875
|
-
setFieldValue(activeField, fieldValue(activeField).slice(0, -1));
|
|
876
|
-
return;
|
|
877
|
-
}
|
|
878
|
-
if (input && !key.ctrl && !key.meta && !key.tab && !key.upArrow && !key.downArrow) {
|
|
879
|
-
setFieldValue(activeField, fieldValue(activeField) + input);
|
|
880
862
|
}
|
|
881
863
|
return;
|
|
882
864
|
}
|
|
883
865
|
if (key.escape || input === "q") {
|
|
884
|
-
|
|
885
|
-
onDone();
|
|
866
|
+
saveAndLeave();
|
|
886
867
|
return;
|
|
887
868
|
}
|
|
888
|
-
if (input === "
|
|
889
|
-
|
|
869
|
+
if (input === "c") {
|
|
870
|
+
setFieldValue(activeField, "");
|
|
890
871
|
return;
|
|
891
872
|
}
|
|
892
873
|
if (key.tab || key.downArrow) {
|
|
@@ -911,18 +892,6 @@ function ConfigurationScreen({ onDone }) {
|
|
|
911
892
|
/* @__PURE__ */ jsx7(Text7, { color: PALETTE.accent, children: "Loading..." })
|
|
912
893
|
] });
|
|
913
894
|
}
|
|
914
|
-
if (stage === "saved") {
|
|
915
|
-
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
916
|
-
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
|
|
917
|
-
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
918
|
-
/* @__PURE__ */ jsxs7(Text7, { color: PALETTE.success, children: [
|
|
919
|
-
"\u2713 ",
|
|
920
|
-
message
|
|
921
|
-
] }),
|
|
922
|
-
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
923
|
-
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "[Enter] Back to Settings" })
|
|
924
|
-
] });
|
|
925
|
-
}
|
|
926
895
|
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
927
896
|
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
|
|
928
897
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
@@ -938,8 +907,15 @@ function ConfigurationScreen({ onDone }) {
|
|
|
938
907
|
FIELD_LABELS[field],
|
|
939
908
|
":"
|
|
940
909
|
] }),
|
|
941
|
-
|
|
942
|
-
|
|
910
|
+
isActive && editing ? /* @__PURE__ */ jsx7(
|
|
911
|
+
TextInput3,
|
|
912
|
+
{
|
|
913
|
+
value,
|
|
914
|
+
onChange: (next) => setFieldValue(field, next),
|
|
915
|
+
onSubmit: () => setEditing(false),
|
|
916
|
+
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
917
|
+
}
|
|
918
|
+
) : /* @__PURE__ */ jsx7(Text7, { children: display || /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" }) })
|
|
943
919
|
] }, field);
|
|
944
920
|
}) }),
|
|
945
921
|
message && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
@@ -950,7 +926,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
950
926
|
] })
|
|
951
927
|
] }),
|
|
952
928
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
953
|
-
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: editing ? "[type] Edit
|
|
929
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: editing ? "[type] Edit \xB7 [\u2190/\u2192] Move cursor \xB7 [Enter] Done \xB7 [Esc] Cancel edit" : "[\u2191/\u2193] Switch field \xB7 [Enter] Edit \xB7 [c] Clear field \xB7 [Esc/q] Save & back" })
|
|
954
930
|
] });
|
|
955
931
|
}
|
|
956
932
|
|
package/dist/index.js
CHANGED
|
@@ -933,6 +933,7 @@ var init_config_store = __esm({
|
|
|
933
933
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
934
934
|
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
935
935
|
import { Box as Box7, Text as Text7, useInput as useInput7 } from "ink";
|
|
936
|
+
import TextInput3 from "ink-text-input";
|
|
936
937
|
import { Fragment, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
937
938
|
function debugFields(config) {
|
|
938
939
|
return {
|
|
@@ -971,13 +972,13 @@ function ConfigurationScreen({ onDone }) {
|
|
|
971
972
|
if (!config) return;
|
|
972
973
|
setConfig({ ...config, [field]: value });
|
|
973
974
|
}
|
|
974
|
-
function
|
|
975
|
+
function saveAndLeave() {
|
|
975
976
|
if (!config) return;
|
|
976
977
|
setStage("saving");
|
|
977
978
|
setMessage(null);
|
|
978
979
|
writeCredentials(config).then(() => {
|
|
979
|
-
|
|
980
|
-
|
|
980
|
+
void finishDebugRun({ outputs: debugFields(config), status: "success", exitMethod: "saved" });
|
|
981
|
+
onDone();
|
|
981
982
|
}).catch((err) => {
|
|
982
983
|
setMessage(err instanceof Error ? err.message : "Failed to save");
|
|
983
984
|
setStage("form");
|
|
@@ -985,39 +986,19 @@ function ConfigurationScreen({ onDone }) {
|
|
|
985
986
|
}
|
|
986
987
|
useInput7((input, key) => {
|
|
987
988
|
if (stage === "loading" || stage === "saving") return;
|
|
988
|
-
if (stage === "saved") {
|
|
989
|
-
if (key.return || key.escape || input === "q") {
|
|
990
|
-
void finishDebugRun({ outputs: debugFields(config), status: "success", exitMethod: "saved" });
|
|
991
|
-
onDone();
|
|
992
|
-
}
|
|
993
|
-
return;
|
|
994
|
-
}
|
|
995
989
|
if (editing) {
|
|
996
|
-
if (key.return) {
|
|
997
|
-
setEditing(false);
|
|
998
|
-
return;
|
|
999
|
-
}
|
|
1000
990
|
if (key.escape) {
|
|
1001
991
|
setFieldValue(activeField, valueBeforeEdit);
|
|
1002
992
|
setEditing(false);
|
|
1003
|
-
return;
|
|
1004
|
-
}
|
|
1005
|
-
if (key.backspace || key.delete) {
|
|
1006
|
-
setFieldValue(activeField, fieldValue(activeField).slice(0, -1));
|
|
1007
|
-
return;
|
|
1008
|
-
}
|
|
1009
|
-
if (input && !key.ctrl && !key.meta && !key.tab && !key.upArrow && !key.downArrow) {
|
|
1010
|
-
setFieldValue(activeField, fieldValue(activeField) + input);
|
|
1011
993
|
}
|
|
1012
994
|
return;
|
|
1013
995
|
}
|
|
1014
996
|
if (key.escape || input === "q") {
|
|
1015
|
-
|
|
1016
|
-
onDone();
|
|
997
|
+
saveAndLeave();
|
|
1017
998
|
return;
|
|
1018
999
|
}
|
|
1019
|
-
if (input === "
|
|
1020
|
-
|
|
1000
|
+
if (input === "c") {
|
|
1001
|
+
setFieldValue(activeField, "");
|
|
1021
1002
|
return;
|
|
1022
1003
|
}
|
|
1023
1004
|
if (key.tab || key.downArrow) {
|
|
@@ -1042,18 +1023,6 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1042
1023
|
/* @__PURE__ */ jsx7(Text7, { color: PALETTE.accent, children: "Loading..." })
|
|
1043
1024
|
] });
|
|
1044
1025
|
}
|
|
1045
|
-
if (stage === "saved") {
|
|
1046
|
-
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1047
|
-
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
|
|
1048
|
-
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1049
|
-
/* @__PURE__ */ jsxs7(Text7, { color: PALETTE.success, children: [
|
|
1050
|
-
"\u2713 ",
|
|
1051
|
-
message
|
|
1052
|
-
] }),
|
|
1053
|
-
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1054
|
-
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "[Enter] Back to Settings" })
|
|
1055
|
-
] });
|
|
1056
|
-
}
|
|
1057
1026
|
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1058
1027
|
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Configuration" }),
|
|
1059
1028
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
@@ -1069,8 +1038,15 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1069
1038
|
FIELD_LABELS[field],
|
|
1070
1039
|
":"
|
|
1071
1040
|
] }),
|
|
1072
|
-
|
|
1073
|
-
|
|
1041
|
+
isActive && editing ? /* @__PURE__ */ jsx7(
|
|
1042
|
+
TextInput3,
|
|
1043
|
+
{
|
|
1044
|
+
value,
|
|
1045
|
+
onChange: (next) => setFieldValue(field, next),
|
|
1046
|
+
onSubmit: () => setEditing(false),
|
|
1047
|
+
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
1048
|
+
}
|
|
1049
|
+
) : /* @__PURE__ */ jsx7(Text7, { children: display || /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" }) })
|
|
1074
1050
|
] }, field);
|
|
1075
1051
|
}) }),
|
|
1076
1052
|
message && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
@@ -1081,7 +1057,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1081
1057
|
] })
|
|
1082
1058
|
] }),
|
|
1083
1059
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1084
|
-
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: editing ? "[type] Edit
|
|
1060
|
+
/* @__PURE__ */ jsx7(Text7, { dimColor: true, children: editing ? "[type] Edit \xB7 [\u2190/\u2192] Move cursor \xB7 [Enter] Done \xB7 [Esc] Cancel edit" : "[\u2191/\u2193] Switch field \xB7 [Enter] Edit \xB7 [c] Clear field \xB7 [Esc/q] Save & back" })
|
|
1085
1061
|
] });
|
|
1086
1062
|
}
|
|
1087
1063
|
var FIELD_ORDER, FIELD_LABELS;
|
package/dist/package.json
CHANGED
package/legacy/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.35.1-dev-build-
|
|
3
|
+
"version": "2.35.1-dev-build-210d1941.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"svelte": "^5.56.4",
|
|
43
43
|
"ts-morph": "^27.0.2",
|
|
44
44
|
"typescript": "^5.9.3",
|
|
45
|
-
"@contentful/experience-design-system-types": "2.35.1-dev-build-
|
|
45
|
+
"@contentful/experience-design-system-types": "2.35.1-dev-build-210d1941.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@tsconfig/node24": "^24.0.4",
|