@contentful/experience-design-system-cli 2.35.1-dev-build-210d1941.0 → 2.35.1-dev-build-525507db.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 +26 -12
- package/dist/index.js +26 -12
- package/dist/package.json +1 -1
- package/legacy/package.json +1 -1
- package/package.json +2 -2
package/dist/app.js
CHANGED
|
@@ -818,7 +818,8 @@ function ConfigurationScreen({ onDone }) {
|
|
|
818
818
|
const [stage, setStage] = useState6("loading");
|
|
819
819
|
const [config, setConfig] = useState6(null);
|
|
820
820
|
const [activeField, setActiveField] = useState6("spaceId");
|
|
821
|
-
const [
|
|
821
|
+
const [notice, setNotice] = useState6(null);
|
|
822
|
+
const [lastSaved, setLastSaved] = useState6(null);
|
|
822
823
|
const [editing, setEditing] = useState6(false);
|
|
823
824
|
const [valueBeforeEdit, setValueBeforeEdit] = useState6("");
|
|
824
825
|
useEffect4(() => {
|
|
@@ -840,19 +841,27 @@ function ConfigurationScreen({ onDone }) {
|
|
|
840
841
|
function setFieldValue(field, value) {
|
|
841
842
|
if (!config) return;
|
|
842
843
|
setConfig({ ...config, [field]: value });
|
|
844
|
+
setNotice(null);
|
|
843
845
|
}
|
|
844
|
-
function
|
|
846
|
+
function handleSave() {
|
|
845
847
|
if (!config) return;
|
|
846
848
|
setStage("saving");
|
|
847
|
-
|
|
849
|
+
setNotice(null);
|
|
848
850
|
writeCredentials(config).then(() => {
|
|
849
|
-
|
|
850
|
-
|
|
851
|
+
setLastSaved(config);
|
|
852
|
+
setNotice({ kind: "success", text: "Configuration saved" });
|
|
853
|
+
setStage("form");
|
|
851
854
|
}).catch((err) => {
|
|
852
|
-
|
|
855
|
+
setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" });
|
|
853
856
|
setStage("form");
|
|
854
857
|
});
|
|
855
858
|
}
|
|
859
|
+
function quit() {
|
|
860
|
+
void finishDebugRun(
|
|
861
|
+
lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
|
|
862
|
+
);
|
|
863
|
+
onDone();
|
|
864
|
+
}
|
|
856
865
|
useInput7((input, key) => {
|
|
857
866
|
if (stage === "loading" || stage === "saving") return;
|
|
858
867
|
if (editing) {
|
|
@@ -863,7 +872,11 @@ function ConfigurationScreen({ onDone }) {
|
|
|
863
872
|
return;
|
|
864
873
|
}
|
|
865
874
|
if (key.escape || input === "q") {
|
|
866
|
-
|
|
875
|
+
quit();
|
|
876
|
+
return;
|
|
877
|
+
}
|
|
878
|
+
if (input === "s") {
|
|
879
|
+
handleSave();
|
|
867
880
|
return;
|
|
868
881
|
}
|
|
869
882
|
if (input === "c") {
|
|
@@ -918,15 +931,16 @@ function ConfigurationScreen({ onDone }) {
|
|
|
918
931
|
) : /* @__PURE__ */ jsx7(Text7, { children: display || /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" }) })
|
|
919
932
|
] }, field);
|
|
920
933
|
}) }),
|
|
921
|
-
|
|
934
|
+
notice && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
922
935
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
923
|
-
/* @__PURE__ */ jsxs7(Text7, { color: PALETTE.error, children: [
|
|
924
|
-
"\
|
|
925
|
-
|
|
936
|
+
/* @__PURE__ */ jsxs7(Text7, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
937
|
+
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
938
|
+
" ",
|
|
939
|
+
notice.text
|
|
926
940
|
] })
|
|
927
941
|
] }),
|
|
928
942
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
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]
|
|
943
|
+
/* @__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 [s] Save \xB7 [Esc/q] Quit without saving" })
|
|
930
944
|
] });
|
|
931
945
|
}
|
|
932
946
|
|
package/dist/index.js
CHANGED
|
@@ -949,7 +949,8 @@ function ConfigurationScreen({ onDone }) {
|
|
|
949
949
|
const [stage, setStage] = useState6("loading");
|
|
950
950
|
const [config, setConfig] = useState6(null);
|
|
951
951
|
const [activeField, setActiveField] = useState6("spaceId");
|
|
952
|
-
const [
|
|
952
|
+
const [notice, setNotice] = useState6(null);
|
|
953
|
+
const [lastSaved, setLastSaved] = useState6(null);
|
|
953
954
|
const [editing, setEditing] = useState6(false);
|
|
954
955
|
const [valueBeforeEdit, setValueBeforeEdit] = useState6("");
|
|
955
956
|
useEffect4(() => {
|
|
@@ -971,19 +972,27 @@ function ConfigurationScreen({ onDone }) {
|
|
|
971
972
|
function setFieldValue(field, value) {
|
|
972
973
|
if (!config) return;
|
|
973
974
|
setConfig({ ...config, [field]: value });
|
|
975
|
+
setNotice(null);
|
|
974
976
|
}
|
|
975
|
-
function
|
|
977
|
+
function handleSave() {
|
|
976
978
|
if (!config) return;
|
|
977
979
|
setStage("saving");
|
|
978
|
-
|
|
980
|
+
setNotice(null);
|
|
979
981
|
writeCredentials(config).then(() => {
|
|
980
|
-
|
|
981
|
-
|
|
982
|
+
setLastSaved(config);
|
|
983
|
+
setNotice({ kind: "success", text: "Configuration saved" });
|
|
984
|
+
setStage("form");
|
|
982
985
|
}).catch((err) => {
|
|
983
|
-
|
|
986
|
+
setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" });
|
|
984
987
|
setStage("form");
|
|
985
988
|
});
|
|
986
989
|
}
|
|
990
|
+
function quit() {
|
|
991
|
+
void finishDebugRun(
|
|
992
|
+
lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
|
|
993
|
+
);
|
|
994
|
+
onDone();
|
|
995
|
+
}
|
|
987
996
|
useInput7((input, key) => {
|
|
988
997
|
if (stage === "loading" || stage === "saving") return;
|
|
989
998
|
if (editing) {
|
|
@@ -994,7 +1003,11 @@ function ConfigurationScreen({ onDone }) {
|
|
|
994
1003
|
return;
|
|
995
1004
|
}
|
|
996
1005
|
if (key.escape || input === "q") {
|
|
997
|
-
|
|
1006
|
+
quit();
|
|
1007
|
+
return;
|
|
1008
|
+
}
|
|
1009
|
+
if (input === "s") {
|
|
1010
|
+
handleSave();
|
|
998
1011
|
return;
|
|
999
1012
|
}
|
|
1000
1013
|
if (input === "c") {
|
|
@@ -1049,15 +1062,16 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1049
1062
|
) : /* @__PURE__ */ jsx7(Text7, { children: display || /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "(empty)" }) })
|
|
1050
1063
|
] }, field);
|
|
1051
1064
|
}) }),
|
|
1052
|
-
|
|
1065
|
+
notice && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
1053
1066
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
1054
|
-
/* @__PURE__ */ jsxs7(Text7, { color: PALETTE.error, children: [
|
|
1055
|
-
"\
|
|
1056
|
-
|
|
1067
|
+
/* @__PURE__ */ jsxs7(Text7, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
1068
|
+
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
1069
|
+
" ",
|
|
1070
|
+
notice.text
|
|
1057
1071
|
] })
|
|
1058
1072
|
] }),
|
|
1059
1073
|
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
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]
|
|
1074
|
+
/* @__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 [s] Save \xB7 [Esc/q] Quit without saving" })
|
|
1061
1075
|
] });
|
|
1062
1076
|
}
|
|
1063
1077
|
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-525507db.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-525507db.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@tsconfig/node24": "^24.0.4",
|