@contentful/experience-design-system-cli 2.36.2-dev-build-4fe2ee93.0 → 2.36.2-dev-build-c4497102.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 +187 -122
- package/dist/index.js +199 -122
- package/dist/package.json +1 -1
- package/dist/src/tui/control-hints.d.ts +7 -0
- package/legacy/package.json +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -167,10 +167,23 @@ var init_use_terminal_width = __esm({
|
|
|
167
167
|
}
|
|
168
168
|
});
|
|
169
169
|
|
|
170
|
+
// packages/experience-design-system-cli/src/tui/control-hints.tsx
|
|
171
|
+
import { Text } from "ink";
|
|
172
|
+
import { jsx } from "react/jsx-runtime";
|
|
173
|
+
function ControlHints({ hints }) {
|
|
174
|
+
return /* @__PURE__ */ jsx(Text, { color: PALETTE.muted, children: hints.map((hint) => `${hint.keys} ${hint.label}`).join(" \xB7 ") });
|
|
175
|
+
}
|
|
176
|
+
var init_control_hints = __esm({
|
|
177
|
+
"packages/experience-design-system-cli/src/tui/control-hints.tsx"() {
|
|
178
|
+
"use strict";
|
|
179
|
+
init_home_theme();
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
|
|
170
183
|
// packages/experience-design-system-cli/src/tui/home/home.tsx
|
|
171
184
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
172
|
-
import { Box, Text, useApp, useInput } from "ink";
|
|
173
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
185
|
+
import { Box, Text as Text2, useApp, useInput } from "ink";
|
|
186
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
174
187
|
function upgradeItemDisplay(upgradeCheck) {
|
|
175
188
|
if (upgradeCheck?.status === "update-available") {
|
|
176
189
|
return { label: `Upgrade Version (v${upgradeCheck.latest} available)`, color: PALETTE.success };
|
|
@@ -213,27 +226,27 @@ function HomeScreen({ onNavigate }) {
|
|
|
213
226
|
});
|
|
214
227
|
if (tooNarrow) {
|
|
215
228
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ jsx2(Text2, { bold: true, color: PALETTE.warning, children: "Terminal too small" }),
|
|
230
|
+
/* @__PURE__ */ jsx2(Text2, { color: PALETTE.muted, children: "Press q to quit, make your terminal full screen, then run experiences import again." })
|
|
218
231
|
] });
|
|
219
232
|
}
|
|
220
233
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
221
234
|
/* @__PURE__ */ jsxs(Box, { flexDirection: "column", alignItems: "center", children: [
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */ jsxs(
|
|
235
|
+
/* @__PURE__ */ jsx2(Text2, { bold: true, color: PALETTE.heading, children: HEADING }),
|
|
236
|
+
/* @__PURE__ */ jsx2(Text2, { children: brandBar(HEADING.length).map((segment, i) => /* @__PURE__ */ jsx2(Text2, { color: segment.color, children: segment.text }, i)) }),
|
|
237
|
+
/* @__PURE__ */ jsx2(Text2, { color: PALETTE.muted, children: SUBTITLE }),
|
|
238
|
+
/* @__PURE__ */ jsxs(Text2, { color: PALETTE.muted, children: [
|
|
226
239
|
"v",
|
|
227
240
|
VERSION
|
|
228
241
|
] })
|
|
229
242
|
] }),
|
|
230
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ jsx2(Box, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx2(Box, { flexDirection: "column", children: START_ITEMS.map((item, i) => {
|
|
231
244
|
const focused = i === focusIdx;
|
|
232
245
|
const isUpgradeItem = item.screen === "upgrade";
|
|
233
246
|
const display = isUpgradeItem ? upgradeItemDisplay(upgradeCheck) : { label: item.label };
|
|
234
247
|
const dimmed = isUpgradeItem && upgradeDisabled;
|
|
235
248
|
return /* @__PURE__ */ jsxs(
|
|
236
|
-
|
|
249
|
+
Text2,
|
|
237
250
|
{
|
|
238
251
|
bold: focused && !dimmed,
|
|
239
252
|
dimColor: dimmed,
|
|
@@ -246,7 +259,16 @@ function HomeScreen({ onNavigate }) {
|
|
|
246
259
|
item.label
|
|
247
260
|
);
|
|
248
261
|
}) }) }),
|
|
249
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ jsx2(Box, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx2(
|
|
263
|
+
ControlHints,
|
|
264
|
+
{
|
|
265
|
+
hints: [
|
|
266
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
267
|
+
{ keys: "\u23CE", label: "select" },
|
|
268
|
+
{ keys: "q", label: "quit" }
|
|
269
|
+
]
|
|
270
|
+
}
|
|
271
|
+
) })
|
|
250
272
|
] });
|
|
251
273
|
}
|
|
252
274
|
var VERSION, HEADING, SUBTITLE, MIN_TERMINAL_WIDTH, START_ITEMS;
|
|
@@ -256,6 +278,7 @@ var init_home = __esm({
|
|
|
256
278
|
init_home_theme();
|
|
257
279
|
init_version();
|
|
258
280
|
init_use_terminal_width();
|
|
281
|
+
init_control_hints();
|
|
259
282
|
VERSION = readPackageVersion();
|
|
260
283
|
HEADING = "Contentful Experiences";
|
|
261
284
|
SUBTITLE = "Let's import your design system into Contentful";
|
|
@@ -270,8 +293,8 @@ var init_home = __esm({
|
|
|
270
293
|
});
|
|
271
294
|
|
|
272
295
|
// packages/experience-design-system-cli/src/tui/import/PageContainer.tsx
|
|
273
|
-
import { Box as Box2, Text as
|
|
274
|
-
import { jsx as
|
|
296
|
+
import { Box as Box2, Text as Text3, useInput as useInput2 } from "ink";
|
|
297
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
275
298
|
function ImportScreen({ exitCode, onDone }) {
|
|
276
299
|
useInput2((input, key) => {
|
|
277
300
|
if (key.return || key.escape || input === "q") {
|
|
@@ -280,14 +303,14 @@ function ImportScreen({ exitCode, onDone }) {
|
|
|
280
303
|
});
|
|
281
304
|
const isSuccess = exitCode === 0;
|
|
282
305
|
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
283
|
-
/* @__PURE__ */
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
isSuccess ? /* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ jsx3(Text3, { bold: true, children: "Import" }),
|
|
307
|
+
/* @__PURE__ */ jsx3(Text3, { children: " " }),
|
|
308
|
+
isSuccess ? /* @__PURE__ */ jsx3(Text3, { color: PALETTE.success, children: "\u2713 Import complete" }) : /* @__PURE__ */ jsxs2(Text3, { color: PALETTE.error, children: [
|
|
286
309
|
"\u2717 Import failed: process exited with code ",
|
|
287
310
|
exitCode ?? "unknown"
|
|
288
311
|
] }),
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ jsx3(Text3, { children: " " }),
|
|
313
|
+
/* @__PURE__ */ jsx3(Text3, { dimColor: true, children: "[Enter] Back to Start" })
|
|
291
314
|
] });
|
|
292
315
|
}
|
|
293
316
|
var init_PageContainer = __esm({
|
|
@@ -333,9 +356,9 @@ var init_controls = __esm({
|
|
|
333
356
|
|
|
334
357
|
// packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx
|
|
335
358
|
import { useState as useState3 } from "react";
|
|
336
|
-
import { Box as Box3, Text as
|
|
359
|
+
import { Box as Box3, Text as Text4 } from "ink";
|
|
337
360
|
import TextInput from "ink-text-input";
|
|
338
|
-
import { jsx as
|
|
361
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
339
362
|
function WelcomeScreen({ onContinue, onQuit, initialPath = "" }) {
|
|
340
363
|
const [projectPath, setProjectPath] = useState3(initialPath);
|
|
341
364
|
useWelcomeControls(projectPath, onQuit);
|
|
@@ -344,25 +367,25 @@ function WelcomeScreen({ onContinue, onQuit, initialPath = "" }) {
|
|
|
344
367
|
if (path) onContinue(path);
|
|
345
368
|
};
|
|
346
369
|
return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ jsx4(Text4, { bold: true, color: PALETTE.success, children: "\u{1F44B} Hey! Let's import your design system into Contentful." }),
|
|
371
|
+
/* @__PURE__ */ jsx4(Text4, { dimColor: true, children: "I'll walk you through 5 steps to get your components into Contentful ExO." }),
|
|
349
372
|
/* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", marginTop: 1, children: [
|
|
350
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ jsx4(Text4, { dimColor: true, children: RULE }),
|
|
351
374
|
OVERVIEW.map((item) => /* @__PURE__ */ jsxs3(Box3, { gap: 1, children: [
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ jsx4(Text4, { bold: true, children: item.label }),
|
|
376
|
+
/* @__PURE__ */ jsx4(Text4, { dimColor: true, children: item.description })
|
|
354
377
|
] }, item.label)),
|
|
355
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ jsx4(Text4, { dimColor: true, children: RULE })
|
|
356
379
|
] }),
|
|
357
380
|
/* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", marginTop: 1, children: [
|
|
358
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ jsx4(Text4, { children: "Where is your component library?" }),
|
|
359
382
|
/* @__PURE__ */ jsxs3(Box3, { gap: 1, children: [
|
|
360
|
-
/* @__PURE__ */
|
|
361
|
-
/* @__PURE__ */
|
|
362
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ jsx4(Text4, { color: PALETTE.accent, children: "?" }),
|
|
384
|
+
/* @__PURE__ */ jsx4(Text4, { children: "Project path:" }),
|
|
385
|
+
/* @__PURE__ */ jsx4(TextInput, { value: projectPath, onChange: setProjectPath, onSubmit: submit })
|
|
363
386
|
] })
|
|
364
387
|
] }),
|
|
365
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ jsx4(Box3, { marginTop: 1, gap: 3, children: WELCOME_CONTROLS.map((control) => /* @__PURE__ */ jsxs3(Text4, { dimColor: true, children: [
|
|
366
389
|
"[",
|
|
367
390
|
control.keys,
|
|
368
391
|
"] ",
|
|
@@ -468,9 +491,9 @@ var init_validate_path = __esm({
|
|
|
468
491
|
|
|
469
492
|
// packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx
|
|
470
493
|
import { useState as useState4 } from "react";
|
|
471
|
-
import { Box as Box4, Text as
|
|
494
|
+
import { Box as Box4, Text as Text5 } from "ink";
|
|
472
495
|
import TextInput2 from "ink-text-input";
|
|
473
|
-
import { jsx as
|
|
496
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
474
497
|
function TokenInputScreen({
|
|
475
498
|
onConfirm,
|
|
476
499
|
onSkip,
|
|
@@ -495,26 +518,26 @@ function TokenInputScreen({
|
|
|
495
518
|
else setFailure({ error: check.error, resolvedPath: check.resolvedPath });
|
|
496
519
|
};
|
|
497
520
|
return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
498
|
-
/* @__PURE__ */
|
|
499
|
-
/* @__PURE__ */
|
|
521
|
+
/* @__PURE__ */ jsx5(Text5, { bold: true, children: "Design tokens" }),
|
|
522
|
+
/* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "Point me to your raw token file (e.g. ~/design-tokens/tokens.json). You can use ~, relative, or absolute paths. Claude will map it to DTCG format." }),
|
|
500
523
|
/* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", marginTop: 1, children: [
|
|
501
524
|
/* @__PURE__ */ jsxs4(Box4, { gap: 1, children: [
|
|
502
|
-
/* @__PURE__ */
|
|
503
|
-
/* @__PURE__ */
|
|
504
|
-
/* @__PURE__ */
|
|
525
|
+
/* @__PURE__ */ jsx5(Text5, { color: PALETTE.accent, children: "?" }),
|
|
526
|
+
/* @__PURE__ */ jsx5(Text5, { children: "Token path:" }),
|
|
527
|
+
/* @__PURE__ */ jsx5(TextInput2, { value: tokenPath, onChange: change, onSubmit: submit })
|
|
505
528
|
] }),
|
|
506
529
|
failure && /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
|
|
507
|
-
/* @__PURE__ */ jsxs4(
|
|
530
|
+
/* @__PURE__ */ jsxs4(Text5, { color: PALETTE.error, children: [
|
|
508
531
|
"\u2717 ",
|
|
509
532
|
failure.error
|
|
510
533
|
] }),
|
|
511
|
-
/* @__PURE__ */ jsxs4(
|
|
534
|
+
/* @__PURE__ */ jsxs4(Text5, { dimColor: true, children: [
|
|
512
535
|
" Resolved to: ",
|
|
513
536
|
failure.resolvedPath
|
|
514
537
|
] })
|
|
515
538
|
] })
|
|
516
539
|
] }),
|
|
517
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ jsx5(Box4, { marginTop: 1, gap: 3, children: TOKEN_INPUT_CONTROLS.map((control) => /* @__PURE__ */ jsxs4(Text5, { dimColor: true, children: [
|
|
518
541
|
"[",
|
|
519
542
|
control.keys,
|
|
520
543
|
"] ",
|
|
@@ -837,14 +860,14 @@ var init_help_info = __esm({
|
|
|
837
860
|
|
|
838
861
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
839
862
|
import { useEffect as useEffect3, useState as useState5 } from "react";
|
|
840
|
-
import { Box as Box5, Text as
|
|
841
|
-
import { Fragment, jsx as
|
|
863
|
+
import { Box as Box5, Text as Text6, useInput as useInput5 } from "ink";
|
|
864
|
+
import { Fragment, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
842
865
|
function Section({ title, rows }) {
|
|
843
866
|
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
|
|
844
|
-
/* @__PURE__ */
|
|
867
|
+
/* @__PURE__ */ jsx6(Text6, { bold: true, color: PALETTE.accent, children: title }),
|
|
845
868
|
rows.map((row) => /* @__PURE__ */ jsxs5(Box5, { gap: 1, children: [
|
|
846
|
-
/* @__PURE__ */
|
|
847
|
-
/* @__PURE__ */
|
|
869
|
+
/* @__PURE__ */ jsx6(Box5, { width: 14, flexShrink: 0, children: /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: row.label }) }),
|
|
870
|
+
/* @__PURE__ */ jsx6(Text6, { children: row.value })
|
|
848
871
|
] }, row.label))
|
|
849
872
|
] });
|
|
850
873
|
}
|
|
@@ -869,13 +892,21 @@ function HelpScreen({ onDone }) {
|
|
|
869
892
|
}
|
|
870
893
|
});
|
|
871
894
|
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingX: 2, paddingY: 1, gap: 1, children: [
|
|
872
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ jsx6(Text6, { bold: true, children: "Help" }),
|
|
873
896
|
info ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
874
|
-
/* @__PURE__ */
|
|
875
|
-
/* @__PURE__ */
|
|
876
|
-
/* @__PURE__ */
|
|
877
|
-
] }) : /* @__PURE__ */
|
|
878
|
-
/* @__PURE__ */
|
|
897
|
+
/* @__PURE__ */ jsx6(Section, { title: "Where things are stored", rows: info.storage }),
|
|
898
|
+
/* @__PURE__ */ jsx6(Section, { title: "Troubleshooting", rows: info.troubleshooting }),
|
|
899
|
+
/* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "Hit a problem? Turn on Debug Mode in Settings, reproduce it, then share the session folder above. The CMA token is redacted from those logs." })
|
|
900
|
+
] }) : /* @__PURE__ */ jsx6(Text6, { color: PALETTE.accent, children: "Loading..." }),
|
|
901
|
+
/* @__PURE__ */ jsx6(
|
|
902
|
+
ControlHints,
|
|
903
|
+
{
|
|
904
|
+
hints: [
|
|
905
|
+
{ keys: "\u23CE", label: "done" },
|
|
906
|
+
{ keys: "Esc/q", label: "back to start" }
|
|
907
|
+
]
|
|
908
|
+
}
|
|
909
|
+
)
|
|
879
910
|
] });
|
|
880
911
|
}
|
|
881
912
|
var init_PageContainer2 = __esm({
|
|
@@ -883,14 +914,15 @@ var init_PageContainer2 = __esm({
|
|
|
883
914
|
"use strict";
|
|
884
915
|
init_home_theme();
|
|
885
916
|
init_debug_store();
|
|
917
|
+
init_control_hints();
|
|
886
918
|
init_help_info();
|
|
887
919
|
}
|
|
888
920
|
});
|
|
889
921
|
|
|
890
922
|
// packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx
|
|
891
923
|
import { useState as useState6 } from "react";
|
|
892
|
-
import { Box as Box6, Text as
|
|
893
|
-
import { jsx as
|
|
924
|
+
import { Box as Box6, Text as Text7, useInput as useInput6 } from "ink";
|
|
925
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
894
926
|
function SettingsScreen({
|
|
895
927
|
onNavigate,
|
|
896
928
|
onBack
|
|
@@ -922,19 +954,29 @@ function SettingsScreen({
|
|
|
922
954
|
}
|
|
923
955
|
});
|
|
924
956
|
return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
items.map((item, i) => /* @__PURE__ */ jsxs6(
|
|
957
|
+
/* @__PURE__ */ jsx7(Text7, { bold: true, children: "Settings" }),
|
|
958
|
+
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
959
|
+
items.map((item, i) => /* @__PURE__ */ jsxs6(Text7, { color: i === focusIdx ? "cyan" : void 0, children: [
|
|
928
960
|
i === focusIdx ? "> " : " ",
|
|
929
961
|
item.label
|
|
930
962
|
] }, item.label)),
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
/* @__PURE__ */
|
|
963
|
+
/* @__PURE__ */ jsx7(Text7, { children: " " }),
|
|
964
|
+
/* @__PURE__ */ jsx7(
|
|
965
|
+
ControlHints,
|
|
966
|
+
{
|
|
967
|
+
hints: [
|
|
968
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
969
|
+
{ keys: "\u23CE", label: "select" },
|
|
970
|
+
{ keys: "Esc/q", label: "back" }
|
|
971
|
+
]
|
|
972
|
+
}
|
|
973
|
+
)
|
|
933
974
|
] });
|
|
934
975
|
}
|
|
935
976
|
var init_PageContainer3 = __esm({
|
|
936
977
|
"packages/experience-design-system-cli/src/tui/settings/PageContainer.tsx"() {
|
|
937
978
|
"use strict";
|
|
979
|
+
init_control_hints();
|
|
938
980
|
}
|
|
939
981
|
});
|
|
940
982
|
|
|
@@ -981,9 +1023,9 @@ var init_config_store = __esm({
|
|
|
981
1023
|
|
|
982
1024
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
983
1025
|
import { useEffect as useEffect4, useState as useState7 } from "react";
|
|
984
|
-
import { Box as Box7, Text as
|
|
1026
|
+
import { Box as Box7, Text as Text8, useInput as useInput7 } from "ink";
|
|
985
1027
|
import TextInput3 from "ink-text-input";
|
|
986
|
-
import { Fragment as Fragment2, jsx as
|
|
1028
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
987
1029
|
function debugFields(config) {
|
|
988
1030
|
return {
|
|
989
1031
|
space_id: config?.spaceId ?? "",
|
|
@@ -1080,25 +1122,25 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1080
1122
|
});
|
|
1081
1123
|
if (stage === "loading") {
|
|
1082
1124
|
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1083
|
-
/* @__PURE__ */
|
|
1084
|
-
/* @__PURE__ */
|
|
1085
|
-
/* @__PURE__ */
|
|
1125
|
+
/* @__PURE__ */ jsx8(Text8, { bold: true, children: "Configuration" }),
|
|
1126
|
+
/* @__PURE__ */ jsx8(Text8, { children: " " }),
|
|
1127
|
+
/* @__PURE__ */ jsx8(Text8, { color: PALETTE.accent, children: "Loading..." })
|
|
1086
1128
|
] });
|
|
1087
1129
|
}
|
|
1088
1130
|
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1089
|
-
/* @__PURE__ */
|
|
1090
|
-
/* @__PURE__ */
|
|
1091
|
-
/* @__PURE__ */
|
|
1131
|
+
/* @__PURE__ */ jsx8(Text8, { bold: true, children: "Configuration" }),
|
|
1132
|
+
/* @__PURE__ */ jsx8(Text8, { children: " " }),
|
|
1133
|
+
/* @__PURE__ */ jsx8(Box7, { flexDirection: "column", children: FIELD_ORDER.map((field) => {
|
|
1092
1134
|
const isActive = activeField === field;
|
|
1093
1135
|
const value = fieldValue(field);
|
|
1094
1136
|
const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
|
|
1095
1137
|
return /* @__PURE__ */ jsxs7(Box7, { gap: 1, children: [
|
|
1096
|
-
/* @__PURE__ */
|
|
1097
|
-
/* @__PURE__ */ jsxs7(
|
|
1138
|
+
/* @__PURE__ */ jsx8(Text8, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
1139
|
+
/* @__PURE__ */ jsxs7(Text8, { bold: isActive, children: [
|
|
1098
1140
|
FIELD_LABELS[field],
|
|
1099
1141
|
":"
|
|
1100
1142
|
] }),
|
|
1101
|
-
isActive && editing ? /* @__PURE__ */
|
|
1143
|
+
isActive && editing ? /* @__PURE__ */ jsx8(
|
|
1102
1144
|
TextInput3,
|
|
1103
1145
|
{
|
|
1104
1146
|
value,
|
|
@@ -1106,19 +1148,35 @@ function ConfigurationScreen({ onDone }) {
|
|
|
1106
1148
|
onSubmit: () => setEditing(false),
|
|
1107
1149
|
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
1108
1150
|
}
|
|
1109
|
-
) : /* @__PURE__ */
|
|
1151
|
+
) : /* @__PURE__ */ jsx8(Text8, { children: display || /* @__PURE__ */ jsx8(Text8, { dimColor: true, children: "(empty)" }) })
|
|
1110
1152
|
] }, field);
|
|
1111
1153
|
}) }),
|
|
1112
1154
|
notice && /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
1113
|
-
/* @__PURE__ */
|
|
1114
|
-
/* @__PURE__ */ jsxs7(
|
|
1155
|
+
/* @__PURE__ */ jsx8(Text8, { children: " " }),
|
|
1156
|
+
/* @__PURE__ */ jsxs7(Text8, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
1115
1157
|
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
1116
1158
|
" ",
|
|
1117
1159
|
notice.text
|
|
1118
1160
|
] })
|
|
1119
1161
|
] }),
|
|
1120
|
-
/* @__PURE__ */
|
|
1121
|
-
/* @__PURE__ */
|
|
1162
|
+
/* @__PURE__ */ jsx8(Text8, { children: " " }),
|
|
1163
|
+
/* @__PURE__ */ jsx8(
|
|
1164
|
+
ControlHints,
|
|
1165
|
+
{
|
|
1166
|
+
hints: editing ? [
|
|
1167
|
+
{ keys: "type", label: "edit" },
|
|
1168
|
+
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
1169
|
+
{ keys: "\u23CE", label: "done" },
|
|
1170
|
+
{ keys: "Esc", label: "cancel edit" }
|
|
1171
|
+
] : [
|
|
1172
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
1173
|
+
{ keys: "\u23CE", label: "edit" },
|
|
1174
|
+
{ keys: "c", label: "clear" },
|
|
1175
|
+
{ keys: "s", label: "save" },
|
|
1176
|
+
{ keys: "Esc/q", label: "quit without saving" }
|
|
1177
|
+
]
|
|
1178
|
+
}
|
|
1179
|
+
)
|
|
1122
1180
|
] });
|
|
1123
1181
|
}
|
|
1124
1182
|
var FIELD_ORDER, FIELD_LABELS;
|
|
@@ -1128,6 +1186,7 @@ var init_ContentfulConfigScreen = __esm({
|
|
|
1128
1186
|
init_home_theme();
|
|
1129
1187
|
init_config_store();
|
|
1130
1188
|
init_debug_store();
|
|
1189
|
+
init_control_hints();
|
|
1131
1190
|
FIELD_ORDER = [
|
|
1132
1191
|
"spaceId",
|
|
1133
1192
|
"environmentId",
|
|
@@ -1170,8 +1229,8 @@ var init_analytics_store = __esm({
|
|
|
1170
1229
|
|
|
1171
1230
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
1172
1231
|
import { useEffect as useEffect5, useState as useState8 } from "react";
|
|
1173
|
-
import { Box as Box8, Text as
|
|
1174
|
-
import { Fragment as Fragment3, jsx as
|
|
1232
|
+
import { Box as Box8, Text as Text9, useInput as useInput8 } from "ink";
|
|
1233
|
+
import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1175
1234
|
function OptInAnalyticsScreen({ onDone }) {
|
|
1176
1235
|
const [loading, setLoading] = useState8(true);
|
|
1177
1236
|
const [enabled, setEnabled] = useState8(true);
|
|
@@ -1203,20 +1262,28 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
1203
1262
|
}
|
|
1204
1263
|
});
|
|
1205
1264
|
return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1206
|
-
/* @__PURE__ */
|
|
1207
|
-
/* @__PURE__ */
|
|
1208
|
-
loading ? /* @__PURE__ */
|
|
1209
|
-
/* @__PURE__ */ jsxs8(
|
|
1265
|
+
/* @__PURE__ */ jsx9(Text9, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
1266
|
+
/* @__PURE__ */ jsx9(Text9, { children: " " }),
|
|
1267
|
+
loading ? /* @__PURE__ */ jsx9(Text9, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
1268
|
+
/* @__PURE__ */ jsxs8(Text9, { children: [
|
|
1210
1269
|
"Share anonymous usage data:",
|
|
1211
1270
|
" ",
|
|
1212
|
-
/* @__PURE__ */
|
|
1271
|
+
/* @__PURE__ */ jsx9(Text9, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
1213
1272
|
] }),
|
|
1214
|
-
/* @__PURE__ */
|
|
1215
|
-
/* @__PURE__ */
|
|
1216
|
-
/* @__PURE__ */
|
|
1273
|
+
/* @__PURE__ */ jsx9(Text9, { children: " " }),
|
|
1274
|
+
/* @__PURE__ */ jsx9(Text9, { dimColor: true, children: "Shares which CLI commands are used and where imports succeed or fail." }),
|
|
1275
|
+
/* @__PURE__ */ jsx9(Text9, { dimColor: true, children: "Never includes source code, file paths, credentials, or authored content." })
|
|
1217
1276
|
] }),
|
|
1218
|
-
/* @__PURE__ */
|
|
1219
|
-
/* @__PURE__ */
|
|
1277
|
+
/* @__PURE__ */ jsx9(Text9, { children: " " }),
|
|
1278
|
+
/* @__PURE__ */ jsx9(
|
|
1279
|
+
ControlHints,
|
|
1280
|
+
{
|
|
1281
|
+
hints: [
|
|
1282
|
+
{ keys: "\u23CE/Space", label: "toggle" },
|
|
1283
|
+
{ keys: "Esc/q", label: "back" }
|
|
1284
|
+
]
|
|
1285
|
+
}
|
|
1286
|
+
)
|
|
1220
1287
|
] });
|
|
1221
1288
|
}
|
|
1222
1289
|
var init_screen3 = __esm({
|
|
@@ -1225,13 +1292,14 @@ var init_screen3 = __esm({
|
|
|
1225
1292
|
init_home_theme();
|
|
1226
1293
|
init_analytics_store();
|
|
1227
1294
|
init_debug_store();
|
|
1295
|
+
init_control_hints();
|
|
1228
1296
|
}
|
|
1229
1297
|
});
|
|
1230
1298
|
|
|
1231
1299
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
1232
1300
|
import { useEffect as useEffect6, useState as useState9 } from "react";
|
|
1233
|
-
import { Box as Box9, Text as
|
|
1234
|
-
import { jsx as
|
|
1301
|
+
import { Box as Box9, Text as Text10, useInput as useInput9 } from "ink";
|
|
1302
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1235
1303
|
function UpgradeScreen({ onDone }) {
|
|
1236
1304
|
const [upgradeCheck, setUpgradeCheck] = useState9();
|
|
1237
1305
|
useEffect6(() => {
|
|
@@ -1255,11 +1323,11 @@ function UpgradeScreen({ onDone }) {
|
|
|
1255
1323
|
}
|
|
1256
1324
|
});
|
|
1257
1325
|
return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1258
|
-
/* @__PURE__ */
|
|
1259
|
-
/* @__PURE__ */
|
|
1326
|
+
/* @__PURE__ */ jsx10(Text10, { bold: true, children: "Upgrade" }),
|
|
1327
|
+
/* @__PURE__ */ jsx10(Text10, { children: " " }),
|
|
1260
1328
|
renderBody(upgradeCheck),
|
|
1261
|
-
/* @__PURE__ */
|
|
1262
|
-
/* @__PURE__ */ jsxs9(
|
|
1329
|
+
/* @__PURE__ */ jsx10(Text10, { children: " " }),
|
|
1330
|
+
/* @__PURE__ */ jsxs9(Text10, { bold: true, color: PALETTE.accent, children: [
|
|
1263
1331
|
FOCUS_MARKER,
|
|
1264
1332
|
" Go Back"
|
|
1265
1333
|
] })
|
|
@@ -1267,34 +1335,34 @@ function UpgradeScreen({ onDone }) {
|
|
|
1267
1335
|
}
|
|
1268
1336
|
function renderBody(upgradeCheck) {
|
|
1269
1337
|
if (!upgradeCheck) {
|
|
1270
|
-
return /* @__PURE__ */
|
|
1338
|
+
return /* @__PURE__ */ jsx10(Text10, { color: PALETTE.muted, children: "Checking for updates\u2026" });
|
|
1271
1339
|
}
|
|
1272
1340
|
if (upgradeCheck.status === "error") {
|
|
1273
|
-
return /* @__PURE__ */
|
|
1341
|
+
return /* @__PURE__ */ jsx10(Text10, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
|
|
1274
1342
|
}
|
|
1275
1343
|
if (upgradeCheck.status === "up-to-date") {
|
|
1276
|
-
return /* @__PURE__ */ jsxs9(
|
|
1344
|
+
return /* @__PURE__ */ jsxs9(Text10, { color: PALETTE.success, children: [
|
|
1277
1345
|
"You're already on the latest version (v",
|
|
1278
1346
|
upgradeCheck.current,
|
|
1279
1347
|
")."
|
|
1280
1348
|
] });
|
|
1281
1349
|
}
|
|
1282
1350
|
return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", children: [
|
|
1283
|
-
/* @__PURE__ */ jsxs9(
|
|
1284
|
-
/* @__PURE__ */ jsxs9(
|
|
1351
|
+
/* @__PURE__ */ jsxs9(Text10, { color: PALETTE.muted, children: [
|
|
1352
|
+
/* @__PURE__ */ jsxs9(Text10, { bold: true, color: PALETTE.success, children: [
|
|
1285
1353
|
"v",
|
|
1286
1354
|
upgradeCheck.latest
|
|
1287
1355
|
] }),
|
|
1288
1356
|
" ",
|
|
1289
1357
|
"is available (you're on ",
|
|
1290
|
-
/* @__PURE__ */ jsxs9(
|
|
1358
|
+
/* @__PURE__ */ jsxs9(Text10, { bold: true, children: [
|
|
1291
1359
|
"v",
|
|
1292
1360
|
upgradeCheck.current
|
|
1293
1361
|
] }),
|
|
1294
1362
|
"). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
|
|
1295
1363
|
] }),
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */
|
|
1364
|
+
/* @__PURE__ */ jsx10(Text10, { children: " " }),
|
|
1365
|
+
/* @__PURE__ */ jsx10(Box9, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.border, paddingX: 1, children: UPGRADE_COMMANDS.map((cmd) => /* @__PURE__ */ jsx10(Text10, { bold: true, children: cmd }, cmd)) })
|
|
1298
1366
|
] });
|
|
1299
1367
|
}
|
|
1300
1368
|
var UPGRADE_COMMANDS;
|
|
@@ -1310,8 +1378,8 @@ var init_PageContainer4 = __esm({
|
|
|
1310
1378
|
|
|
1311
1379
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
1312
1380
|
import { useEffect as useEffect7, useState as useState10 } from "react";
|
|
1313
|
-
import { Box as Box10, Text as
|
|
1314
|
-
import { jsx as
|
|
1381
|
+
import { Box as Box10, Text as Text11, useInput as useInput10 } from "ink";
|
|
1382
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1315
1383
|
function DebugModeScreen({ onDone }) {
|
|
1316
1384
|
const [loading, setLoading] = useState10(true);
|
|
1317
1385
|
const [enabled, setEnabled] = useState10(true);
|
|
@@ -1343,15 +1411,23 @@ function DebugModeScreen({ onDone }) {
|
|
|
1343
1411
|
}
|
|
1344
1412
|
});
|
|
1345
1413
|
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
1346
|
-
/* @__PURE__ */
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
loading ? /* @__PURE__ */
|
|
1414
|
+
/* @__PURE__ */ jsx11(Text11, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
1415
|
+
/* @__PURE__ */ jsx11(Text11, { children: " " }),
|
|
1416
|
+
loading ? /* @__PURE__ */ jsx11(Text11, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs10(Text11, { children: [
|
|
1349
1417
|
"Debug logging:",
|
|
1350
1418
|
" ",
|
|
1351
|
-
/* @__PURE__ */
|
|
1419
|
+
/* @__PURE__ */ jsx11(Text11, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
1352
1420
|
] }),
|
|
1353
|
-
/* @__PURE__ */
|
|
1354
|
-
/* @__PURE__ */
|
|
1421
|
+
/* @__PURE__ */ jsx11(Text11, { children: " " }),
|
|
1422
|
+
/* @__PURE__ */ jsx11(
|
|
1423
|
+
ControlHints,
|
|
1424
|
+
{
|
|
1425
|
+
hints: [
|
|
1426
|
+
{ keys: "\u23CE/Space", label: "toggle" },
|
|
1427
|
+
{ keys: "Esc/q", label: "back" }
|
|
1428
|
+
]
|
|
1429
|
+
}
|
|
1430
|
+
)
|
|
1355
1431
|
] });
|
|
1356
1432
|
}
|
|
1357
1433
|
var init_screen4 = __esm({
|
|
@@ -1360,6 +1436,7 @@ var init_screen4 = __esm({
|
|
|
1360
1436
|
init_home_theme();
|
|
1361
1437
|
init_debug_mode_store();
|
|
1362
1438
|
init_debug_store();
|
|
1439
|
+
init_control_hints();
|
|
1363
1440
|
}
|
|
1364
1441
|
});
|
|
1365
1442
|
|
|
@@ -1369,7 +1446,7 @@ __export(app_exports, {
|
|
|
1369
1446
|
runApp: () => runApp
|
|
1370
1447
|
});
|
|
1371
1448
|
import { useEffect as useEffect8, useState as useState11 } from "react";
|
|
1372
|
-
import { Fragment as Fragment4, jsx as
|
|
1449
|
+
import { Fragment as Fragment4, jsx as jsx12 } from "react/jsx-runtime";
|
|
1373
1450
|
function App({ onLaunchImport, importExitCode }) {
|
|
1374
1451
|
const returnedFromImport = importExitCode !== void 0;
|
|
1375
1452
|
const [screen, setScreen] = useState11(returnedFromImport ? "import" : "start");
|
|
@@ -1398,12 +1475,12 @@ function App({ onLaunchImport, importExitCode }) {
|
|
|
1398
1475
|
};
|
|
1399
1476
|
switch (screen) {
|
|
1400
1477
|
case "import":
|
|
1401
|
-
if (showImportResult) return /* @__PURE__ */
|
|
1402
|
-
if (importDefaults === void 0) return /* @__PURE__ */
|
|
1478
|
+
if (showImportResult) return /* @__PURE__ */ jsx12(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
1479
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx12(Fragment4, {});
|
|
1403
1480
|
if (projectPath === void 0) {
|
|
1404
|
-
return /* @__PURE__ */
|
|
1481
|
+
return /* @__PURE__ */ jsx12(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
1405
1482
|
}
|
|
1406
|
-
return /* @__PURE__ */
|
|
1483
|
+
return /* @__PURE__ */ jsx12(
|
|
1407
1484
|
TokenInputScreen,
|
|
1408
1485
|
{
|
|
1409
1486
|
initialPath: importDefaults.tokenFile,
|
|
@@ -1413,25 +1490,25 @@ function App({ onLaunchImport, importExitCode }) {
|
|
|
1413
1490
|
}
|
|
1414
1491
|
);
|
|
1415
1492
|
case "help":
|
|
1416
|
-
return /* @__PURE__ */
|
|
1493
|
+
return /* @__PURE__ */ jsx12(HelpScreen, { onDone: goToStart });
|
|
1417
1494
|
case "upgrade":
|
|
1418
|
-
return /* @__PURE__ */
|
|
1495
|
+
return /* @__PURE__ */ jsx12(UpgradeScreen, { onDone: goToStart });
|
|
1419
1496
|
case "settings":
|
|
1420
|
-
return /* @__PURE__ */
|
|
1497
|
+
return /* @__PURE__ */ jsx12(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
|
|
1421
1498
|
case "settings-configuration":
|
|
1422
|
-
return /* @__PURE__ */
|
|
1499
|
+
return /* @__PURE__ */ jsx12(ConfigurationScreen, { onDone: goToSettings });
|
|
1423
1500
|
case "settings-opt-in-analytics":
|
|
1424
|
-
return /* @__PURE__ */
|
|
1501
|
+
return /* @__PURE__ */ jsx12(OptInAnalyticsScreen, { onDone: goToSettings });
|
|
1425
1502
|
case "settings-debug-mode":
|
|
1426
|
-
return /* @__PURE__ */
|
|
1503
|
+
return /* @__PURE__ */ jsx12(DebugModeScreen, { onDone: goToSettings });
|
|
1427
1504
|
case "start":
|
|
1428
|
-
return /* @__PURE__ */
|
|
1505
|
+
return /* @__PURE__ */ jsx12(HomeScreen, { onNavigate: setScreen });
|
|
1429
1506
|
}
|
|
1430
1507
|
}
|
|
1431
1508
|
async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
|
|
1432
1509
|
let requestedImport;
|
|
1433
1510
|
const instance = renderApp(
|
|
1434
|
-
/* @__PURE__ */
|
|
1511
|
+
/* @__PURE__ */ jsx12(
|
|
1435
1512
|
App,
|
|
1436
1513
|
{
|
|
1437
1514
|
importExitCode,
|