@contentful/experience-design-system-cli 2.37.1-dev-build-b65632a0.0 → 2.37.1-dev-build-200af99b.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 +370 -136
- package/dist/index.js +401 -140
- package/dist/package.json +2 -1
- package/dist/src/tui/import/spawn-v1-import.d.ts +1 -0
- package/dist/src/tui/import/steps/04-credentials/controls.d.ts +21 -0
- package/dist/src/tui/import/steps/04-credentials/logic.d.ts +18 -0
- package/dist/src/tui/import/steps/04-credentials/screen.d.ts +17 -0
- package/dist/src/tui/import/steps/04-credentials/validate.d.ts +8 -0
- package/dist/src/tui/import/steps/index.d.ts +1 -0
- package/legacy/dist/src/index.js +973 -1375
- package/legacy/package.json +2 -1
- package/package.json +3 -2
- package/legacy/dist/src/import/tui/steps/CredentialsStep.d.ts +0 -43
package/legacy/dist/src/index.js
CHANGED
|
@@ -9919,196 +9919,9 @@ var init_GateStep = __esm({
|
|
|
9919
9919
|
}
|
|
9920
9920
|
});
|
|
9921
9921
|
|
|
9922
|
-
// packages/experience-design-system-cli-legacy/src/import/tui/steps/CredentialsStep.tsx
|
|
9923
|
-
import { useState as useState6, useRef as useRef3 } from "react";
|
|
9924
|
-
import { Box as Box11, Text as Text12 } from "ink";
|
|
9925
|
-
import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
9926
|
-
function CredentialsStep({
|
|
9927
|
-
summary,
|
|
9928
|
-
error: externalError,
|
|
9929
|
-
initialSpaceId = "",
|
|
9930
|
-
initialEnvironmentId = "master",
|
|
9931
|
-
initialCmaToken = "",
|
|
9932
|
-
initialHost,
|
|
9933
|
-
validating = false,
|
|
9934
|
-
backgroundValidating = false,
|
|
9935
|
-
generatePrefetchStatus = "idle",
|
|
9936
|
-
generatePrefetchError = null,
|
|
9937
|
-
onConfirm,
|
|
9938
|
-
onValuesChange,
|
|
9939
|
-
onContinue,
|
|
9940
|
-
onQuit,
|
|
9941
|
-
onRetryPrefetch,
|
|
9942
|
-
onSkip
|
|
9943
|
-
}) {
|
|
9944
|
-
const normalizedInitialHost = toConfiguredHost(initialHost) ?? DEFAULT_CONFIGURED_HOST;
|
|
9945
|
-
const [spaceId, setSpaceId] = useState6(initialSpaceId);
|
|
9946
|
-
const [environmentId, setEnvironmentId] = useState6(initialEnvironmentId);
|
|
9947
|
-
const [cmaToken, setCmaToken] = useState6(initialCmaToken);
|
|
9948
|
-
const [host, setHost] = useState6(normalizedInitialHost);
|
|
9949
|
-
const [activeField, setActiveField] = useState6("spaceId");
|
|
9950
|
-
const [inlineError, setInlineError] = useState6(null);
|
|
9951
|
-
const cursorVisible = useBlinkingCursor();
|
|
9952
|
-
const hasTypedRef = useRef3(false);
|
|
9953
|
-
useImmediateInput((input, key) => {
|
|
9954
|
-
if (validating && !backgroundValidating) {
|
|
9955
|
-
return;
|
|
9956
|
-
}
|
|
9957
|
-
if ((input === "r" || input === "R") && generatePrefetchStatus === "failed" && onRetryPrefetch) {
|
|
9958
|
-
onRetryPrefetch();
|
|
9959
|
-
return;
|
|
9960
|
-
}
|
|
9961
|
-
if (key.return) {
|
|
9962
|
-
if (activeField === "spaceId") {
|
|
9963
|
-
setActiveField("environmentId");
|
|
9964
|
-
return;
|
|
9965
|
-
}
|
|
9966
|
-
if (activeField === "environmentId") {
|
|
9967
|
-
setActiveField("cmaToken");
|
|
9968
|
-
return;
|
|
9969
|
-
}
|
|
9970
|
-
if (activeField === "cmaToken") {
|
|
9971
|
-
setActiveField("host");
|
|
9972
|
-
return;
|
|
9973
|
-
}
|
|
9974
|
-
if (!spaceId.trim() || !environmentId.trim() || !cmaToken.trim()) {
|
|
9975
|
-
setInlineError("All fields are required.");
|
|
9976
|
-
return;
|
|
9977
|
-
}
|
|
9978
|
-
setInlineError(null);
|
|
9979
|
-
const submittedHost = toConfiguredHost(host) ?? DEFAULT_CONFIGURED_HOST;
|
|
9980
|
-
const unchanged = spaceId.trim() === initialSpaceId && environmentId.trim() === initialEnvironmentId && cmaToken.trim() === initialCmaToken && submittedHost === normalizedInitialHost;
|
|
9981
|
-
if (unchanged && onContinue) {
|
|
9982
|
-
onContinue(spaceId.trim(), environmentId.trim(), cmaToken.trim(), submittedHost);
|
|
9983
|
-
} else {
|
|
9984
|
-
onConfirm(spaceId.trim(), environmentId.trim(), cmaToken.trim(), submittedHost);
|
|
9985
|
-
}
|
|
9986
|
-
return;
|
|
9987
|
-
}
|
|
9988
|
-
if (key.tab) {
|
|
9989
|
-
setActiveField(
|
|
9990
|
-
(f) => f === "spaceId" ? "environmentId" : f === "environmentId" ? "cmaToken" : f === "cmaToken" ? "host" : "spaceId"
|
|
9991
|
-
);
|
|
9992
|
-
return;
|
|
9993
|
-
}
|
|
9994
|
-
if (key.escape || input === "q") {
|
|
9995
|
-
onQuit();
|
|
9996
|
-
return;
|
|
9997
|
-
}
|
|
9998
|
-
if ((input === "s" || input === "S") && onSkip && !hasTypedRef.current) {
|
|
9999
|
-
onSkip();
|
|
10000
|
-
return;
|
|
10001
|
-
}
|
|
10002
|
-
if (key.backspace || key.delete) {
|
|
10003
|
-
const nextValue = (value) => value.slice(0, -1);
|
|
10004
|
-
if (activeField === "spaceId") {
|
|
10005
|
-
const next = nextValue(spaceId);
|
|
10006
|
-
setSpaceId(next);
|
|
10007
|
-
onValuesChange?.(next, environmentId, cmaToken, host);
|
|
10008
|
-
} else if (activeField === "environmentId") {
|
|
10009
|
-
const next = nextValue(environmentId);
|
|
10010
|
-
setEnvironmentId(next);
|
|
10011
|
-
onValuesChange?.(spaceId, next, cmaToken, host);
|
|
10012
|
-
} else if (activeField === "cmaToken") {
|
|
10013
|
-
const next = nextValue(cmaToken);
|
|
10014
|
-
setCmaToken(next);
|
|
10015
|
-
onValuesChange?.(spaceId, environmentId, next, host);
|
|
10016
|
-
} else {
|
|
10017
|
-
const next = nextValue(host);
|
|
10018
|
-
setHost(next);
|
|
10019
|
-
onValuesChange?.(spaceId, environmentId, cmaToken, next);
|
|
10020
|
-
}
|
|
10021
|
-
return;
|
|
10022
|
-
}
|
|
10023
|
-
if (input && !key.ctrl && !key.meta) {
|
|
10024
|
-
hasTypedRef.current = true;
|
|
10025
|
-
if (activeField === "spaceId") {
|
|
10026
|
-
const next = spaceId + input;
|
|
10027
|
-
setSpaceId(next);
|
|
10028
|
-
onValuesChange?.(next, environmentId, cmaToken, host);
|
|
10029
|
-
} else if (activeField === "environmentId") {
|
|
10030
|
-
const next = environmentId + input;
|
|
10031
|
-
setEnvironmentId(next);
|
|
10032
|
-
onValuesChange?.(spaceId, next, cmaToken, host);
|
|
10033
|
-
} else if (activeField === "cmaToken") {
|
|
10034
|
-
const next = cmaToken + input;
|
|
10035
|
-
setCmaToken(next);
|
|
10036
|
-
onValuesChange?.(spaceId, environmentId, next, host);
|
|
10037
|
-
} else {
|
|
10038
|
-
const next = host + input;
|
|
10039
|
-
setHost(next);
|
|
10040
|
-
onValuesChange?.(spaceId, environmentId, cmaToken, next);
|
|
10041
|
-
}
|
|
10042
|
-
}
|
|
10043
|
-
});
|
|
10044
|
-
const cursor = cursorVisible ? "\u2588" : " ";
|
|
10045
|
-
function renderField(label, value, field, masked = false) {
|
|
10046
|
-
const isActive = activeField === field;
|
|
10047
|
-
const display = masked ? "\u2022".repeat(value.length) : value;
|
|
10048
|
-
const fallback = field === "host" ? DEFAULT_CONFIGURED_HOST : /* @__PURE__ */ jsx15(Text12, { color: PALETTE.muted, children: "(empty)" });
|
|
10049
|
-
return /* @__PURE__ */ jsxs11(Box11, { gap: 1, children: [
|
|
10050
|
-
/* @__PURE__ */ jsx15(Text12, { color: isActive ? PALETTE.info : void 0, children: "?" }),
|
|
10051
|
-
/* @__PURE__ */ jsxs11(Text12, { bold: isActive, children: [
|
|
10052
|
-
label,
|
|
10053
|
-
":"
|
|
10054
|
-
] }),
|
|
10055
|
-
/* @__PURE__ */ jsx15(Text12, { children: isActive ? display + cursor : display || fallback })
|
|
10056
|
-
] });
|
|
10057
|
-
}
|
|
10058
|
-
const displayError = inlineError ?? externalError ?? null;
|
|
10059
|
-
return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
10060
|
-
summary && /* @__PURE__ */ jsxs11(Text12, { color: PALETTE.success, children: [
|
|
10061
|
-
"\u2713 ",
|
|
10062
|
-
summary
|
|
10063
|
-
] }),
|
|
10064
|
-
/* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", children: [
|
|
10065
|
-
/* @__PURE__ */ jsx15(Text12, { children: initialSpaceId && initialCmaToken ? "Credentials pre-filled from the configuration settings." : "Enter the Contentful space you want to import into." }),
|
|
10066
|
-
!(initialSpaceId && initialCmaToken) && /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
10067
|
-
/* @__PURE__ */ jsx15(Text12, { color: PALETTE.muted, children: "These credentials are used both to align agent suggestions with what already exists in the space and to push your import at the end. Press S to skip and run without space context (push will be disabled)." }),
|
|
10068
|
-
/* @__PURE__ */ jsx15(Text12, { color: PALETTE.muted, children: "Tip: run experiences setup to save these to ~/.contentful/experience-design-system-cli/config.json so they pre-fill here automatically." })
|
|
10069
|
-
] })
|
|
10070
|
-
] }),
|
|
10071
|
-
/* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", children: [
|
|
10072
|
-
renderField("Space ID", spaceId, "spaceId"),
|
|
10073
|
-
renderField("Environment", environmentId, "environmentId"),
|
|
10074
|
-
renderField("CMA Token", cmaToken, "cmaToken", true),
|
|
10075
|
-
renderField("API Host", host, "host")
|
|
10076
|
-
] }),
|
|
10077
|
-
activeField === "host" && /* @__PURE__ */ jsx15(Text12, { color: PALETTE.muted, children: "Default: api.contentful.com \xB7 EU spaces: api.eu.contentful.com" }),
|
|
10078
|
-
displayError && /* @__PURE__ */ jsxs11(Text12, { color: PALETTE.error, children: [
|
|
10079
|
-
"\u2717 ",
|
|
10080
|
-
displayError
|
|
10081
|
-
] }),
|
|
10082
|
-
validating && !backgroundValidating && /* @__PURE__ */ jsx15(Text12, { color: PALETTE.info, children: generatePrefetchStatus === "running" ? "Validating credentials & finishing component generation..." : "Validating credentials..." }),
|
|
10083
|
-
!validating && generatePrefetchStatus === "running" && /* @__PURE__ */ jsx15(Text12, { color: PALETTE.muted, children: "Component generation in progress..." }),
|
|
10084
|
-
!validating && generatePrefetchStatus === "complete" && /* @__PURE__ */ jsx15(Text12, { color: PALETTE.success, children: "Component generation complete." }),
|
|
10085
|
-
!validating && generatePrefetchStatus === "failed" && /* @__PURE__ */ jsxs11(Text12, { color: PALETTE.warning, children: [
|
|
10086
|
-
"Component generation failed",
|
|
10087
|
-
generatePrefetchError ? `: ${generatePrefetchError}` : "",
|
|
10088
|
-
". Will retry after credential validation.",
|
|
10089
|
-
onRetryPrefetch ? " Press R to retry now." : ""
|
|
10090
|
-
] }),
|
|
10091
|
-
/* @__PURE__ */ jsxs11(Box11, { gap: 3, children: [
|
|
10092
|
-
/* @__PURE__ */ jsx15(Text12, { children: "[Enter] Next field / Submit" }),
|
|
10093
|
-
/* @__PURE__ */ jsx15(Text12, { children: "[Tab] Switch field" }),
|
|
10094
|
-
/* @__PURE__ */ jsx15(Text12, { children: "[q] Quit" }),
|
|
10095
|
-
onSkip && /* @__PURE__ */ jsx15(Text12, { children: "[s] Skip \u2014 review locally only (no push, no live preview)" })
|
|
10096
|
-
] })
|
|
10097
|
-
] });
|
|
10098
|
-
}
|
|
10099
|
-
var init_CredentialsStep = __esm({
|
|
10100
|
-
"packages/experience-design-system-cli-legacy/src/import/tui/steps/CredentialsStep.tsx"() {
|
|
10101
|
-
"use strict";
|
|
10102
|
-
init_theme();
|
|
10103
|
-
init_useImmediateInput();
|
|
10104
|
-
init_host_utils();
|
|
10105
|
-
init_use_blinking_cursor();
|
|
10106
|
-
}
|
|
10107
|
-
});
|
|
10108
|
-
|
|
10109
9922
|
// packages/experience-design-system-cli-legacy/src/tui/use-terminal-size.ts
|
|
10110
9923
|
import { useStdout } from "ink";
|
|
10111
|
-
import { useEffect as useEffect4, useState as
|
|
9924
|
+
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
10112
9925
|
function readTerminalSize(stdout) {
|
|
10113
9926
|
return {
|
|
10114
9927
|
columns: stdout?.columns ?? 80,
|
|
@@ -10117,7 +9930,7 @@ function readTerminalSize(stdout) {
|
|
|
10117
9930
|
}
|
|
10118
9931
|
function useTerminalSize() {
|
|
10119
9932
|
const { stdout } = useStdout();
|
|
10120
|
-
const [size, setSize] =
|
|
9933
|
+
const [size, setSize] = useState6(() => readTerminalSize(stdout));
|
|
10121
9934
|
useEffect4(() => {
|
|
10122
9935
|
const updateSize = () => setSize(readTerminalSize(stdout));
|
|
10123
9936
|
stdout?.on("resize", updateSize);
|
|
@@ -10300,15 +10113,15 @@ var init_preview_diff = __esm({
|
|
|
10300
10113
|
});
|
|
10301
10114
|
|
|
10302
10115
|
// packages/experience-design-system-cli-legacy/src/import/tui/components/SpaceEnvironment.tsx
|
|
10303
|
-
import { Box as
|
|
10304
|
-
import { jsx as
|
|
10116
|
+
import { Box as Box11, Text as Text12 } from "ink";
|
|
10117
|
+
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
10305
10118
|
function SpaceEnvironment({ spaceId, environmentId }) {
|
|
10306
|
-
return /* @__PURE__ */
|
|
10307
|
-
/* @__PURE__ */
|
|
10308
|
-
/* @__PURE__ */
|
|
10309
|
-
/* @__PURE__ */
|
|
10310
|
-
/* @__PURE__ */
|
|
10311
|
-
/* @__PURE__ */
|
|
10119
|
+
return /* @__PURE__ */ jsxs11(Box11, { gap: 1, marginTop: 1, children: [
|
|
10120
|
+
/* @__PURE__ */ jsx15(Text12, { color: PALETTE.muted, children: "Space:" }),
|
|
10121
|
+
/* @__PURE__ */ jsx15(Text12, { children: spaceId }),
|
|
10122
|
+
/* @__PURE__ */ jsx15(Text12, { color: PALETTE.muted, children: "/" }),
|
|
10123
|
+
/* @__PURE__ */ jsx15(Text12, { color: PALETTE.muted, children: "Environment:" }),
|
|
10124
|
+
/* @__PURE__ */ jsx15(Text12, { children: environmentId })
|
|
10312
10125
|
] });
|
|
10313
10126
|
}
|
|
10314
10127
|
var init_SpaceEnvironment = __esm({
|
|
@@ -10343,8 +10156,8 @@ var init_preview_confirmation_input = __esm({
|
|
|
10343
10156
|
});
|
|
10344
10157
|
|
|
10345
10158
|
// packages/experience-design-system-cli-legacy/src/tui/windowed-panel.tsx
|
|
10346
|
-
import { Box as
|
|
10347
|
-
import { jsx as
|
|
10159
|
+
import { Box as Box12, Text as Text13 } from "ink";
|
|
10160
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
10348
10161
|
function terminalPanelHeight(rows, reservedRows = 4) {
|
|
10349
10162
|
return Math.max(MIN_TERMINAL_PANEL_HEIGHT, rows - reservedRows);
|
|
10350
10163
|
}
|
|
@@ -10359,8 +10172,8 @@ function FixedPanel({
|
|
|
10359
10172
|
clipOverflow = true,
|
|
10360
10173
|
children
|
|
10361
10174
|
}) {
|
|
10362
|
-
return /* @__PURE__ */
|
|
10363
|
-
|
|
10175
|
+
return /* @__PURE__ */ jsx16(
|
|
10176
|
+
Box12,
|
|
10364
10177
|
{
|
|
10365
10178
|
flexDirection: "column",
|
|
10366
10179
|
width,
|
|
@@ -10376,7 +10189,7 @@ function FixedPanel({
|
|
|
10376
10189
|
);
|
|
10377
10190
|
}
|
|
10378
10191
|
function WindowedPanel({ width, height, title, focused, children }) {
|
|
10379
|
-
return /* @__PURE__ */
|
|
10192
|
+
return /* @__PURE__ */ jsxs12(
|
|
10380
10193
|
FixedPanel,
|
|
10381
10194
|
{
|
|
10382
10195
|
width,
|
|
@@ -10385,7 +10198,7 @@ function WindowedPanel({ width, height, title, focused, children }) {
|
|
|
10385
10198
|
...height === void 0 ? {} : { height },
|
|
10386
10199
|
focused,
|
|
10387
10200
|
children: [
|
|
10388
|
-
title && /* @__PURE__ */
|
|
10201
|
+
title && /* @__PURE__ */ jsx16(WindowedPanelHeader, { title, width, focused }),
|
|
10389
10202
|
children
|
|
10390
10203
|
]
|
|
10391
10204
|
}
|
|
@@ -10396,9 +10209,9 @@ function WindowedPanelHeader({
|
|
|
10396
10209
|
width,
|
|
10397
10210
|
focused
|
|
10398
10211
|
}) {
|
|
10399
|
-
return /* @__PURE__ */
|
|
10400
|
-
/* @__PURE__ */
|
|
10401
|
-
/* @__PURE__ */
|
|
10212
|
+
return /* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", children: [
|
|
10213
|
+
/* @__PURE__ */ jsx16(Text13, { bold: true, color: PALETTE.info, inverse: focused, children: title }),
|
|
10214
|
+
/* @__PURE__ */ jsx16(Text13, { dimColor: true, children: "\u2500".repeat(Math.max(0, width - 2)) })
|
|
10402
10215
|
] });
|
|
10403
10216
|
}
|
|
10404
10217
|
function formatWindowIndicator(direction, count) {
|
|
@@ -10406,7 +10219,7 @@ function formatWindowIndicator(direction, count) {
|
|
|
10406
10219
|
return `${direction === "up" ? "\u2191" : "\u2193"} ${count} more`;
|
|
10407
10220
|
}
|
|
10408
10221
|
function WindowIndicator({ direction, count }) {
|
|
10409
|
-
return /* @__PURE__ */
|
|
10222
|
+
return /* @__PURE__ */ jsx16(Text13, { color: PALETTE.muted, children: formatWindowIndicator(direction, count) });
|
|
10410
10223
|
}
|
|
10411
10224
|
var MIN_TERMINAL_PANEL_HEIGHT;
|
|
10412
10225
|
var init_windowed_panel = __esm({
|
|
@@ -10418,9 +10231,9 @@ var init_windowed_panel = __esm({
|
|
|
10418
10231
|
});
|
|
10419
10232
|
|
|
10420
10233
|
// packages/experience-design-system-cli-legacy/src/import/tui/steps/WizardPreviewStep.tsx
|
|
10421
|
-
import { useEffect as useEffect5, useState as
|
|
10422
|
-
import { Box as
|
|
10423
|
-
import { Fragment as
|
|
10234
|
+
import { useEffect as useEffect5, useState as useState7, useMemo } from "react";
|
|
10235
|
+
import { Box as Box13, Text as Text14 } from "ink";
|
|
10236
|
+
import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
10424
10237
|
function buildPreviewSummaryLines(preview) {
|
|
10425
10238
|
const lines = [];
|
|
10426
10239
|
const { components, tokens } = preview;
|
|
@@ -10614,8 +10427,8 @@ function WizardPreviewStep({
|
|
|
10614
10427
|
onQuit
|
|
10615
10428
|
}) {
|
|
10616
10429
|
const breakingWithImpact = hasBreakingChangesWithImpact(preview);
|
|
10617
|
-
const [diffExpanded, setDiffExpanded] =
|
|
10618
|
-
const [scrollOffset, setScrollOffset] =
|
|
10430
|
+
const [diffExpanded, setDiffExpanded] = useState7(false);
|
|
10431
|
+
const [scrollOffset, setScrollOffset] = useState7(0);
|
|
10619
10432
|
const { columns: terminalColumns, rows: terminalRows } = useTerminalSize();
|
|
10620
10433
|
const summaryLines = useMemo(() => buildPreviewSummaryLines(preview), [preview]);
|
|
10621
10434
|
const diffLines = useMemo(() => buildPreviewDiffLines(preview), [preview]);
|
|
@@ -10674,11 +10487,11 @@ function WizardPreviewStep({
|
|
|
10674
10487
|
return;
|
|
10675
10488
|
}
|
|
10676
10489
|
});
|
|
10677
|
-
return /* @__PURE__ */
|
|
10678
|
-
/* @__PURE__ */
|
|
10679
|
-
hasAnything ? /* @__PURE__ */
|
|
10680
|
-
/* @__PURE__ */
|
|
10681
|
-
/* @__PURE__ */
|
|
10490
|
+
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 2, children: [
|
|
10491
|
+
/* @__PURE__ */ jsx17(StepHeader, { stepNumber, totalSteps, title: "Push to Contentful" }),
|
|
10492
|
+
hasAnything ? /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
10493
|
+
/* @__PURE__ */ jsx17(Text14, { children: "Here's what will happen in your space:" }),
|
|
10494
|
+
/* @__PURE__ */ jsxs13(
|
|
10682
10495
|
WindowedPanel,
|
|
10683
10496
|
{
|
|
10684
10497
|
width: Math.max(20, terminalColumns - 4),
|
|
@@ -10686,24 +10499,24 @@ function WizardPreviewStep({
|
|
|
10686
10499
|
title: diffExpanded ? `Diff (${diffLines.length} lines)` : "",
|
|
10687
10500
|
focused: false,
|
|
10688
10501
|
children: [
|
|
10689
|
-
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */
|
|
10690
|
-
/* @__PURE__ */
|
|
10502
|
+
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx17(Text14, { color: line.color === "gray" ? PALETTE.muted : line.color, wrap: "truncate-end", children: line.text }, line.key)),
|
|
10503
|
+
/* @__PURE__ */ jsx17(Text14, { color: PALETTE.muted, wrap: "truncate-end", children: formatPreviewScrollIndicator(activeLines.length, boundedScrollOffset, viewportHeight) })
|
|
10691
10504
|
]
|
|
10692
10505
|
}
|
|
10693
10506
|
)
|
|
10694
|
-
] }) : /* @__PURE__ */
|
|
10695
|
-
breakingWithImpact && /* @__PURE__ */
|
|
10696
|
-
/* @__PURE__ */
|
|
10697
|
-
/* @__PURE__ */
|
|
10698
|
-
/* @__PURE__ */
|
|
10699
|
-
/* @__PURE__ */
|
|
10507
|
+
] }) : /* @__PURE__ */ jsx17(Text14, { color: PALETTE.muted, children: "Nothing to push \u2014 everything is already up to date." }),
|
|
10508
|
+
breakingWithImpact && /* @__PURE__ */ jsx17(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx17(Text14, { color: PALETTE.error, bold: true, children: "\u26A0 Breaking changes will affect downstream entities. Press Enter to acknowledge and apply." }) }),
|
|
10509
|
+
/* @__PURE__ */ jsx17(SpaceEnvironment, { spaceId, environmentId }),
|
|
10510
|
+
/* @__PURE__ */ jsxs13(Box13, { gap: 3, marginTop: 1, children: [
|
|
10511
|
+
/* @__PURE__ */ jsx17(Text14, { children: "[Enter] Push to Contentful" }),
|
|
10512
|
+
/* @__PURE__ */ jsxs13(Text14, { children: [
|
|
10700
10513
|
"[d] ",
|
|
10701
10514
|
diffExpanded ? "Hide" : "Show",
|
|
10702
10515
|
" diff"
|
|
10703
10516
|
] }),
|
|
10704
|
-
diffExpanded && /* @__PURE__ */
|
|
10705
|
-
onEdit && /* @__PURE__ */
|
|
10706
|
-
/* @__PURE__ */
|
|
10517
|
+
diffExpanded && /* @__PURE__ */ jsx17(Text14, { children: "[\u2191\u2193] Scroll [f/b] Page" }),
|
|
10518
|
+
onEdit && /* @__PURE__ */ jsx17(Text14, { children: "[e] Edit definitions" }),
|
|
10519
|
+
/* @__PURE__ */ jsx17(Text14, { children: "[q] Cancel" })
|
|
10707
10520
|
] })
|
|
10708
10521
|
] });
|
|
10709
10522
|
}
|
|
@@ -10723,19 +10536,19 @@ var init_WizardPreviewStep = __esm({
|
|
|
10723
10536
|
});
|
|
10724
10537
|
|
|
10725
10538
|
// packages/experience-design-system-cli-legacy/src/import/tui/steps/DoneStep.tsx
|
|
10726
|
-
import { Box as
|
|
10727
|
-
import { Fragment as
|
|
10539
|
+
import { Box as Box14, Text as Text15 } from "ink";
|
|
10540
|
+
import { Fragment as Fragment5, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
10728
10541
|
function EntityRows({ entity, label }) {
|
|
10729
10542
|
const plural = (n) => `${n} ${label}${n !== 1 ? "s" : ""}`;
|
|
10730
|
-
return /* @__PURE__ */
|
|
10731
|
-
ACTIONS.filter((action) => entity[action] > 0).map((action) => /* @__PURE__ */
|
|
10732
|
-
/* @__PURE__ */
|
|
10543
|
+
return /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
10544
|
+
ACTIONS.filter((action) => entity[action] > 0).map((action) => /* @__PURE__ */ jsxs14(Text15, { children: [
|
|
10545
|
+
/* @__PURE__ */ jsx18(Text15, { color: PALETTE.success, children: "\u2713" }),
|
|
10733
10546
|
" ",
|
|
10734
10547
|
plural(entity[action]),
|
|
10735
10548
|
" ",
|
|
10736
10549
|
action
|
|
10737
10550
|
] }, action)),
|
|
10738
|
-
entity.failed > 0 && /* @__PURE__ */
|
|
10551
|
+
entity.failed > 0 && /* @__PURE__ */ jsxs14(Text15, { color: PALETTE.error, children: [
|
|
10739
10552
|
"\u2717 ",
|
|
10740
10553
|
plural(entity.failed),
|
|
10741
10554
|
" failed \u2014 check logs above"
|
|
@@ -10743,9 +10556,9 @@ function EntityRows({ entity, label }) {
|
|
|
10743
10556
|
] });
|
|
10744
10557
|
}
|
|
10745
10558
|
function LinkRow({ title, url }) {
|
|
10746
|
-
return /* @__PURE__ */
|
|
10747
|
-
/* @__PURE__ */
|
|
10748
|
-
/* @__PURE__ */
|
|
10559
|
+
return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", children: [
|
|
10560
|
+
/* @__PURE__ */ jsx18(Text15, { color: PALETTE.muted, children: title }),
|
|
10561
|
+
/* @__PURE__ */ jsx18(Text15, { color: PALETTE.link, children: url })
|
|
10749
10562
|
] });
|
|
10750
10563
|
}
|
|
10751
10564
|
function DoneStep({
|
|
@@ -10767,27 +10580,27 @@ function DoneStep({
|
|
|
10767
10580
|
const totalPushed = componentTypes.created + componentTypes.updated + componentTypes.removed + designTokens.created + designTokens.updated + designTokens.removed;
|
|
10768
10581
|
const success = totalFailed === 0;
|
|
10769
10582
|
const urlArgs = { host: host ?? "api.contentful.com", spaceId, environmentId };
|
|
10770
|
-
return /* @__PURE__ */
|
|
10771
|
-
success ? /* @__PURE__ */
|
|
10772
|
-
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */
|
|
10773
|
-
/* @__PURE__ */
|
|
10774
|
-
/* @__PURE__ */
|
|
10775
|
-
summary && /* @__PURE__ */
|
|
10583
|
+
return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
10584
|
+
success ? /* @__PURE__ */ jsx18(Text15, { bold: true, color: PALETTE.success, children: "Done!" }) : /* @__PURE__ */ jsx18(Text15, { bold: true, color: PALETTE.warning, children: "\u26A0 Finished with errors" }),
|
|
10585
|
+
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx18(Text15, { color: PALETTE.muted, children: "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", children: [
|
|
10586
|
+
/* @__PURE__ */ jsx18(EntityRows, { entity: componentTypes, label: "Component Type" }),
|
|
10587
|
+
/* @__PURE__ */ jsx18(EntityRows, { entity: designTokens, label: "Design Token" }),
|
|
10588
|
+
summary && /* @__PURE__ */ jsx18(Box14, { marginTop: 1, children: /* @__PURE__ */ jsxs14(Text15, { color: PALETTE.muted, children: [
|
|
10776
10589
|
"Push result: ",
|
|
10777
10590
|
summary.succeeded,
|
|
10778
10591
|
"/",
|
|
10779
10592
|
summary.total,
|
|
10780
10593
|
" succeeded",
|
|
10781
|
-
summary.failed > 0 && /* @__PURE__ */
|
|
10594
|
+
summary.failed > 0 && /* @__PURE__ */ jsxs14(Text15, { color: PALETTE.error, children: [
|
|
10782
10595
|
", ",
|
|
10783
10596
|
summary.failed,
|
|
10784
10597
|
" failed"
|
|
10785
10598
|
] })
|
|
10786
10599
|
] }) })
|
|
10787
10600
|
] }),
|
|
10788
|
-
failures.length > 0 && /* @__PURE__ */
|
|
10789
|
-
/* @__PURE__ */
|
|
10790
|
-
failures.map((failure) => /* @__PURE__ */
|
|
10601
|
+
failures.length > 0 && /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", children: [
|
|
10602
|
+
/* @__PURE__ */ jsx18(Text15, { bold: true, color: PALETTE.error, children: "Failure details" }),
|
|
10603
|
+
failures.map((failure) => /* @__PURE__ */ jsxs14(Text15, { color: PALETTE.error, children: [
|
|
10791
10604
|
failure.entityType,
|
|
10792
10605
|
" ",
|
|
10793
10606
|
failure.entityId,
|
|
@@ -10795,11 +10608,11 @@ function DoneStep({
|
|
|
10795
10608
|
failure.message
|
|
10796
10609
|
] }, `${failure.entityType}:${failure.entityId}`))
|
|
10797
10610
|
] }),
|
|
10798
|
-
/* @__PURE__ */
|
|
10799
|
-
success && totalPushed > 0 && /* @__PURE__ */
|
|
10800
|
-
/* @__PURE__ */
|
|
10801
|
-
/* @__PURE__ */
|
|
10802
|
-
/* @__PURE__ */
|
|
10611
|
+
/* @__PURE__ */ jsx18(SpaceEnvironment, { spaceId, environmentId }),
|
|
10612
|
+
success && totalPushed > 0 && /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", gap: 1, children: [
|
|
10613
|
+
/* @__PURE__ */ jsx18(Text15, { color: PALETTE.success, children: "Your design system is now in Contentful Experiences." }),
|
|
10614
|
+
/* @__PURE__ */ jsx18(LinkRow, { title: "View your components here:", url: buildPostPushUrl(urlArgs) }),
|
|
10615
|
+
/* @__PURE__ */ jsx18(
|
|
10803
10616
|
LinkRow,
|
|
10804
10617
|
{
|
|
10805
10618
|
title: "View your design tokens here:",
|
|
@@ -10807,7 +10620,7 @@ function DoneStep({
|
|
|
10807
10620
|
}
|
|
10808
10621
|
)
|
|
10809
10622
|
] }),
|
|
10810
|
-
/* @__PURE__ */
|
|
10623
|
+
/* @__PURE__ */ jsx18(Text15, { children: "[Enter / q] Exit" })
|
|
10811
10624
|
] });
|
|
10812
10625
|
}
|
|
10813
10626
|
var ACTIONS;
|
|
@@ -10823,8 +10636,8 @@ var init_DoneStep = __esm({
|
|
|
10823
10636
|
});
|
|
10824
10637
|
|
|
10825
10638
|
// packages/experience-design-system-cli-legacy/src/import/tui/steps/ErrorStep.tsx
|
|
10826
|
-
import { Box as
|
|
10827
|
-
import { Fragment as
|
|
10639
|
+
import { Box as Box15, Text as Text16 } from "ink";
|
|
10640
|
+
import { Fragment as Fragment6, jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
10828
10641
|
function ErrorStep({
|
|
10829
10642
|
stepName,
|
|
10830
10643
|
message,
|
|
@@ -10845,19 +10658,19 @@ function ErrorStep({
|
|
|
10845
10658
|
onExit();
|
|
10846
10659
|
}
|
|
10847
10660
|
});
|
|
10848
|
-
return /* @__PURE__ */
|
|
10849
|
-
/* @__PURE__ */
|
|
10661
|
+
return /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
10662
|
+
/* @__PURE__ */ jsxs15(Text16, { bold: true, color: PALETTE.error, children: [
|
|
10850
10663
|
"\u2717 ",
|
|
10851
10664
|
stepName,
|
|
10852
10665
|
" failed"
|
|
10853
10666
|
] }),
|
|
10854
|
-
/* @__PURE__ */
|
|
10855
|
-
/* @__PURE__ */
|
|
10856
|
-
onAcknowledgeBreakingChanges ? /* @__PURE__ */
|
|
10857
|
-
/* @__PURE__ */
|
|
10858
|
-
/* @__PURE__ */
|
|
10859
|
-
] }) : /* @__PURE__ */
|
|
10860
|
-
onRetryCredentials && /* @__PURE__ */
|
|
10667
|
+
/* @__PURE__ */ jsx19(Text16, { color: PALETTE.error, children: message }),
|
|
10668
|
+
/* @__PURE__ */ jsxs15(Box15, { gap: 3, marginTop: 1, children: [
|
|
10669
|
+
onAcknowledgeBreakingChanges ? /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
10670
|
+
/* @__PURE__ */ jsx19(Text16, { children: "[Enter] Acknowledge and apply" }),
|
|
10671
|
+
/* @__PURE__ */ jsx19(Text16, { children: "[Esc / q] Exit" })
|
|
10672
|
+
] }) : /* @__PURE__ */ jsx19(Text16, { children: "[Enter / q] Exit" }),
|
|
10673
|
+
onRetryCredentials && /* @__PURE__ */ jsx19(Text16, { children: "[r] Re-enter credentials" })
|
|
10861
10674
|
] })
|
|
10862
10675
|
] });
|
|
10863
10676
|
}
|
|
@@ -10870,7 +10683,7 @@ var init_ErrorStep = __esm({
|
|
|
10870
10683
|
});
|
|
10871
10684
|
|
|
10872
10685
|
// packages/experience-design-system-cli-legacy/src/import/tui/steps/PreviewValidationErrorStep.tsx
|
|
10873
|
-
import { jsx as
|
|
10686
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
10874
10687
|
function PreviewValidationErrorStep({
|
|
10875
10688
|
errors,
|
|
10876
10689
|
missingNames,
|
|
@@ -10893,7 +10706,7 @@ function PreviewValidationErrorStep({
|
|
|
10893
10706
|
|
|
10894
10707
|
Note: ${missingNames.length} component name${missingNames.length === 1 ? "" : "s"} from the server (${missingNames.join(", ")}) ${missingNames.length === 1 ? "does" : "do"} not match anything in this session \u2014 they cannot be edited or skipped from here.` : "";
|
|
10895
10708
|
const skipLabel = matchedNames.length === 0 ? "No matching components to skip" : `Skip ${matchedNames.length === 1 ? matchedNames[0] : `${matchedNames.length} components`} and retry`;
|
|
10896
|
-
return /* @__PURE__ */
|
|
10709
|
+
return /* @__PURE__ */ jsx20(
|
|
10897
10710
|
GateStep,
|
|
10898
10711
|
{
|
|
10899
10712
|
intent: "error",
|
|
@@ -10918,35 +10731,35 @@ var init_PreviewValidationErrorStep = __esm({
|
|
|
10918
10731
|
});
|
|
10919
10732
|
|
|
10920
10733
|
// packages/experience-design-system-cli-legacy/src/import/tui/steps/PushingStep.tsx
|
|
10921
|
-
import { Box as
|
|
10734
|
+
import { Box as Box16, Text as Text17 } from "ink";
|
|
10922
10735
|
import { ProgressBar as ProgressBar2, ThemeProvider as ThemeProvider2 } from "@inkjs/ui";
|
|
10923
|
-
import { jsx as
|
|
10736
|
+
import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
10924
10737
|
function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
10925
10738
|
const { elapsed } = useTimedSpinner();
|
|
10926
10739
|
const operationId = progress && progress.kind === "queued" ? progress.operationId : null;
|
|
10927
10740
|
const showGlobal = progress && progress.kind === "progress";
|
|
10928
10741
|
const showCurrent = progress && progress.kind === "progress" && progress.current ? progress.current : null;
|
|
10929
|
-
return /* @__PURE__ */
|
|
10930
|
-
/* @__PURE__ */
|
|
10931
|
-
/* @__PURE__ */
|
|
10932
|
-
operationId && /* @__PURE__ */
|
|
10933
|
-
/* @__PURE__ */
|
|
10934
|
-
/* @__PURE__ */
|
|
10742
|
+
return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
10743
|
+
/* @__PURE__ */ jsx21(StepHeader, { stepNumber, totalSteps, title: "Push to Contentful" }),
|
|
10744
|
+
/* @__PURE__ */ jsx21(Text17, { children: "Writing component types and design tokens to your Contentful space..." }),
|
|
10745
|
+
operationId && /* @__PURE__ */ jsxs16(Box16, { gap: 1, children: [
|
|
10746
|
+
/* @__PURE__ */ jsx21(Text17, { color: PALETTE.muted, children: "Operation:" }),
|
|
10747
|
+
/* @__PURE__ */ jsx21(Text17, { children: operationId })
|
|
10935
10748
|
] }),
|
|
10936
|
-
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */
|
|
10937
|
-
/* @__PURE__ */
|
|
10938
|
-
/* @__PURE__ */
|
|
10749
|
+
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx21(Box16, { gap: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs16(Box16, { gap: 2, children: [
|
|
10750
|
+
/* @__PURE__ */ jsx21(Box16, { width: 40, children: /* @__PURE__ */ jsx21(ThemeProvider2, { theme: INK_UI_THEME, children: /* @__PURE__ */ jsx21(ProgressBar2, { value: Math.round(progress.processed / progress.total * 100) }) }) }),
|
|
10751
|
+
/* @__PURE__ */ jsxs16(Text17, { color: PALETTE.muted, children: [
|
|
10939
10752
|
progress.processed,
|
|
10940
10753
|
"/",
|
|
10941
10754
|
progress.total,
|
|
10942
10755
|
" entities"
|
|
10943
10756
|
] })
|
|
10944
10757
|
] }) }),
|
|
10945
|
-
showCurrent && /* @__PURE__ */
|
|
10946
|
-
/* @__PURE__ */
|
|
10947
|
-
/* @__PURE__ */
|
|
10758
|
+
showCurrent && /* @__PURE__ */ jsxs16(Box16, { gap: 1, children: [
|
|
10759
|
+
/* @__PURE__ */ jsx21(Text17, { color: PALETTE.muted, children: "Now processing:" }),
|
|
10760
|
+
/* @__PURE__ */ jsx21(Text17, { children: showCurrent })
|
|
10948
10761
|
] }),
|
|
10949
|
-
/* @__PURE__ */
|
|
10762
|
+
/* @__PURE__ */ jsx21(Box16, { marginTop: 1, children: /* @__PURE__ */ jsxs16(Text17, { color: PALETTE.muted, children: [
|
|
10950
10763
|
"Elapsed: ",
|
|
10951
10764
|
elapsed
|
|
10952
10765
|
] }) })
|
|
@@ -19545,8 +19358,8 @@ var init_composite_closure = __esm({
|
|
|
19545
19358
|
});
|
|
19546
19359
|
|
|
19547
19360
|
// packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/Sidebar.tsx
|
|
19548
|
-
import { Box as
|
|
19549
|
-
import { jsx as
|
|
19361
|
+
import { Box as Box17, Text as Text18 } from "ink";
|
|
19362
|
+
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
19550
19363
|
function previewBadge(annotation) {
|
|
19551
19364
|
switch (annotation) {
|
|
19552
19365
|
case "new":
|
|
@@ -19565,7 +19378,7 @@ function PreviewBadge({
|
|
|
19565
19378
|
badge,
|
|
19566
19379
|
highlighted = false
|
|
19567
19380
|
}) {
|
|
19568
|
-
return badge ? /* @__PURE__ */
|
|
19381
|
+
return badge ? /* @__PURE__ */ jsx22(Text18, { color: !highlighted && badge.dim ? PALETTE.muted : badge.color, bold: badge.bold, children: badge.char }) : /* @__PURE__ */ jsx22(Text18, { children: " " });
|
|
19569
19382
|
}
|
|
19570
19383
|
var init_Sidebar = __esm({
|
|
19571
19384
|
"packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/Sidebar.tsx"() {
|
|
@@ -19576,8 +19389,8 @@ var init_Sidebar = __esm({
|
|
|
19576
19389
|
|
|
19577
19390
|
// packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/GroupedSidebar.tsx
|
|
19578
19391
|
import figures from "figures";
|
|
19579
|
-
import { Box as
|
|
19580
|
-
import { jsx as
|
|
19392
|
+
import { Box as Box18, Text as Text19 } from "ink";
|
|
19393
|
+
import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
19581
19394
|
function isEmpty(entry) {
|
|
19582
19395
|
return Object.keys(entry.$properties ?? {}).length === 0 && Object.keys(entry.$slots ?? {}).length === 0;
|
|
19583
19396
|
}
|
|
@@ -20001,8 +19814,8 @@ function GroupedSidebar(props) {
|
|
|
20001
19814
|
const start = windowed ? Math.max(0, scrollOffset ?? 0) : 0;
|
|
20002
19815
|
const end = windowed ? start + (visibleCount ?? allRows.length) : allRows.length;
|
|
20003
19816
|
const rows = windowed ? allRows.slice(start, end) : allRows;
|
|
20004
|
-
return /* @__PURE__ */
|
|
20005
|
-
windowed && /* @__PURE__ */
|
|
19817
|
+
return /* @__PURE__ */ jsxs18(WindowedPanel, { width, height: props.height, title, focused, children: [
|
|
19818
|
+
windowed && /* @__PURE__ */ jsx23(WindowIndicator, { direction: "up", count: start }),
|
|
20006
19819
|
rows.map((row, i) => {
|
|
20007
19820
|
const absoluteRowIdx = start + i;
|
|
20008
19821
|
const isSelected = selectedRowIdx !== void 0 ? absoluteRowIdx === selectedRowIdx && row.itemIdx >= 0 : row.itemIdx >= 0 && row.itemIdx === selectedIdx;
|
|
@@ -20029,13 +19842,13 @@ function GroupedSidebar(props) {
|
|
|
20029
19842
|
isOwn: rs?.isOwn ?? false,
|
|
20030
19843
|
isCursor
|
|
20031
19844
|
});
|
|
20032
|
-
return /* @__PURE__ */
|
|
20033
|
-
isCursor ? /* @__PURE__ */
|
|
20034
|
-
/* @__PURE__ */
|
|
20035
|
-
selectionStateByKey !== void 0 && (selGlyph && !isSynthetic ? /* @__PURE__ */
|
|
20036
|
-
aiFlaggedByKey !== void 0 && (aiFlagged ? /* @__PURE__ */
|
|
20037
|
-
/* @__PURE__ */
|
|
20038
|
-
|
|
19845
|
+
return /* @__PURE__ */ jsxs18(Box18, { children: [
|
|
19846
|
+
isCursor ? /* @__PURE__ */ jsx23(Text19, { color: PALETTE.info, bold: true, children: figures.pointer }) : /* @__PURE__ */ jsx23(Text19, { children: " " }),
|
|
19847
|
+
/* @__PURE__ */ jsx23(PreviewBadge, { badge, highlighted: isSelected }),
|
|
19848
|
+
selectionStateByKey !== void 0 && (selGlyph && !isSynthetic ? /* @__PURE__ */ jsx23(Text19, { color: !isSelected && selDim ? PALETTE.muted : selColor, bold: selBold, children: " " + selGlyph }) : /* @__PURE__ */ jsx23(Text19, { children: " " })),
|
|
19849
|
+
aiFlaggedByKey !== void 0 && (aiFlagged ? /* @__PURE__ */ jsx23(Text19, { color: PALETTE.warning, bold: true, children: " [\xD7]" }) : /* @__PURE__ */ jsx23(Text19, { children: " " })),
|
|
19850
|
+
/* @__PURE__ */ jsxs18(
|
|
19851
|
+
Text19,
|
|
20039
19852
|
{
|
|
20040
19853
|
color: isSelected ? PALETTE.info : labelStyle.dim ? PALETTE.muted : labelStyle.color,
|
|
20041
19854
|
bold: isSelected || labelStyle.bold,
|
|
@@ -20048,10 +19861,10 @@ function GroupedSidebar(props) {
|
|
|
20048
19861
|
]
|
|
20049
19862
|
}
|
|
20050
19863
|
),
|
|
20051
|
-
inheritanceStyle.glyph && /* @__PURE__ */
|
|
19864
|
+
inheritanceStyle.glyph && /* @__PURE__ */ jsx23(Text19, { color: inheritanceStyle.dim ? PALETTE.muted : inheritanceStyle.color, bold: inheritanceStyle.bold, children: " " + inheritanceStyle.glyph })
|
|
20052
19865
|
] }, row.key);
|
|
20053
19866
|
}),
|
|
20054
|
-
windowed && /* @__PURE__ */
|
|
19867
|
+
windowed && /* @__PURE__ */ jsx23(WindowIndicator, { direction: "down", count: allRows.length - end })
|
|
20055
19868
|
] });
|
|
20056
19869
|
}
|
|
20057
19870
|
var GLYPH_EXPAND_COLLAPSED, GLYPH_EXPAND_EXPANDED, GLYPH_TREE_MID, GLYPH_TREE_LAST, GLYPH_WARN, GLYPH_ERROR;
|
|
@@ -20280,15 +20093,15 @@ var init_sidebar_navigation = __esm({
|
|
|
20280
20093
|
});
|
|
20281
20094
|
|
|
20282
20095
|
// packages/experience-design-system-cli-legacy/src/import/tui/hooks/sidebar-search-state.ts
|
|
20283
|
-
import { useState as
|
|
20096
|
+
import { useState as useState8 } from "react";
|
|
20284
20097
|
function useSidebarSearchState() {
|
|
20285
|
-
const [searchOpen, setSearchOpen] =
|
|
20286
|
-
const [searchQuery, setSearchQuery] =
|
|
20287
|
-
const [autocompleteCandidates, setAutocompleteCandidates] =
|
|
20288
|
-
const [jumpFilterTarget, setJumpFilterTarget] =
|
|
20289
|
-
const [columnOneView, setColumnOneView] =
|
|
20290
|
-
const [activeFilters, setActiveFilters] =
|
|
20291
|
-
const [showHelp, setShowHelp] =
|
|
20098
|
+
const [searchOpen, setSearchOpen] = useState8(false);
|
|
20099
|
+
const [searchQuery, setSearchQuery] = useState8("");
|
|
20100
|
+
const [autocompleteCandidates, setAutocompleteCandidates] = useState8([]);
|
|
20101
|
+
const [jumpFilterTarget, setJumpFilterTarget] = useState8(null);
|
|
20102
|
+
const [columnOneView, setColumnOneView] = useState8("grouped");
|
|
20103
|
+
const [activeFilters, setActiveFilters] = useState8(/* @__PURE__ */ new Set());
|
|
20104
|
+
const [showHelp, setShowHelp] = useState8(false);
|
|
20292
20105
|
return {
|
|
20293
20106
|
searchOpen,
|
|
20294
20107
|
setSearchOpen,
|
|
@@ -20313,8 +20126,8 @@ var init_sidebar_search_state = __esm({
|
|
|
20313
20126
|
});
|
|
20314
20127
|
|
|
20315
20128
|
// packages/experience-design-system-cli-legacy/src/import/tui/components/SearchMatchSummary.tsx
|
|
20316
|
-
import { Box as
|
|
20317
|
-
import { Fragment as
|
|
20129
|
+
import { Box as Box19, Text as Text20 } from "ink";
|
|
20130
|
+
import { Fragment as Fragment7, jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
20318
20131
|
function SearchMatchSummary({
|
|
20319
20132
|
open,
|
|
20320
20133
|
query,
|
|
@@ -20325,17 +20138,17 @@ function SearchMatchSummary({
|
|
|
20325
20138
|
marginTop
|
|
20326
20139
|
}) {
|
|
20327
20140
|
if (hidden) return null;
|
|
20328
|
-
return /* @__PURE__ */
|
|
20329
|
-
open && /* @__PURE__ */
|
|
20330
|
-
/* @__PURE__ */
|
|
20141
|
+
return /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
20142
|
+
open && /* @__PURE__ */ jsxs19(Box19, { marginTop, flexDirection: "column", children: [
|
|
20143
|
+
/* @__PURE__ */ jsxs19(Text20, { children: [
|
|
20331
20144
|
`/${query}`,
|
|
20332
|
-
/* @__PURE__ */
|
|
20333
|
-
query && /* @__PURE__ */
|
|
20334
|
-
/* @__PURE__ */
|
|
20145
|
+
/* @__PURE__ */ jsx24(Text20, { color: PALETTE.info, children: "\u258E" }),
|
|
20146
|
+
query && /* @__PURE__ */ jsx24(Text20, { color: PALETTE.muted, children: formatSearchMatchSummary(matches, total) }),
|
|
20147
|
+
/* @__PURE__ */ jsx24(Text20, { children: " \xB7 [Esc] leave" })
|
|
20335
20148
|
] }),
|
|
20336
|
-
autocompleteCandidates.length > 1 && /* @__PURE__ */
|
|
20149
|
+
autocompleteCandidates.length > 1 && /* @__PURE__ */ jsx24(Text20, { color: PALETTE.muted, children: ` possibilities: ${autocompleteCandidates.join(" \xB7 ").slice(0, 120)}` })
|
|
20337
20150
|
] }),
|
|
20338
|
-
!open && query && /* @__PURE__ */
|
|
20151
|
+
!open && query && /* @__PURE__ */ jsx24(Box19, { marginTop, children: /* @__PURE__ */ jsx24(Text20, { children: `/${query}${formatSearchMatchSummary(matches, total)} \xB7 [Esc] clear` }) })
|
|
20339
20152
|
] });
|
|
20340
20153
|
}
|
|
20341
20154
|
var init_SearchMatchSummary = __esm({
|
|
@@ -20347,10 +20160,10 @@ var init_SearchMatchSummary = __esm({
|
|
|
20347
20160
|
});
|
|
20348
20161
|
|
|
20349
20162
|
// packages/experience-design-system-cli-legacy/src/import/tui/hooks/useOverlayPanel.ts
|
|
20350
|
-
import { useCallback as useCallback3, useState as
|
|
20163
|
+
import { useCallback as useCallback3, useState as useState9 } from "react";
|
|
20351
20164
|
function useOverlayPanel(opts) {
|
|
20352
20165
|
const { toggleKey, onClose } = opts;
|
|
20353
|
-
const [isOpen, setIsOpen] =
|
|
20166
|
+
const [isOpen, setIsOpen] = useState9(false);
|
|
20354
20167
|
const open = useCallback3(() => {
|
|
20355
20168
|
setIsOpen(true);
|
|
20356
20169
|
}, []);
|
|
@@ -20423,8 +20236,8 @@ var init_lineage_layout = __esm({
|
|
|
20423
20236
|
|
|
20424
20237
|
// packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/GotoBanner.tsx
|
|
20425
20238
|
import figures2 from "figures";
|
|
20426
|
-
import { Box as
|
|
20427
|
-
import { jsx as
|
|
20239
|
+
import { Box as Box20, Text as Text21 } from "ink";
|
|
20240
|
+
import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
20428
20241
|
function windowStart(rowCount, highlightIndex, maxRows) {
|
|
20429
20242
|
if (rowCount <= maxRows) return 0;
|
|
20430
20243
|
const maxStart = rowCount - maxRows;
|
|
@@ -20434,9 +20247,9 @@ function windowStart(rowCount, highlightIndex, maxRows) {
|
|
|
20434
20247
|
return start;
|
|
20435
20248
|
}
|
|
20436
20249
|
function defaultRenderRow(row, index, isCursor) {
|
|
20437
|
-
return /* @__PURE__ */
|
|
20438
|
-
isCursor ? /* @__PURE__ */
|
|
20439
|
-
/* @__PURE__ */
|
|
20250
|
+
return /* @__PURE__ */ jsxs20(Text21, { children: [
|
|
20251
|
+
isCursor ? /* @__PURE__ */ jsx25(Text21, { color: PALETTE.info, bold: true, children: figures2.pointer }) : /* @__PURE__ */ jsx25(Text21, { children: " " }),
|
|
20252
|
+
/* @__PURE__ */ jsx25(Text21, { inverse: isCursor, children: " " + row.label })
|
|
20440
20253
|
] }, index);
|
|
20441
20254
|
}
|
|
20442
20255
|
function GotoBanner({
|
|
@@ -20455,8 +20268,8 @@ function GotoBanner({
|
|
|
20455
20268
|
const visible = rows.slice(start, end);
|
|
20456
20269
|
const moreAbove = start;
|
|
20457
20270
|
const moreBelow = rows.length - end;
|
|
20458
|
-
return /* @__PURE__ */
|
|
20459
|
-
|
|
20271
|
+
return /* @__PURE__ */ jsxs20(
|
|
20272
|
+
Box20,
|
|
20460
20273
|
{
|
|
20461
20274
|
flexDirection: "column",
|
|
20462
20275
|
borderStyle: "single",
|
|
@@ -20466,14 +20279,14 @@ function GotoBanner({
|
|
|
20466
20279
|
width,
|
|
20467
20280
|
flexShrink: 0,
|
|
20468
20281
|
children: [
|
|
20469
|
-
/* @__PURE__ */
|
|
20470
|
-
moreAbove > 0 && /* @__PURE__ */
|
|
20282
|
+
/* @__PURE__ */ jsx25(Text21, { bold: true, children: title }),
|
|
20283
|
+
moreAbove > 0 && /* @__PURE__ */ jsx25(Text21, { color: PALETTE.muted, children: ` \u25B2 ${moreAbove} more` }),
|
|
20471
20284
|
visible.map((row, vi) => {
|
|
20472
20285
|
const i = start + vi;
|
|
20473
20286
|
return renderRow(row, i, i === highlightIndex);
|
|
20474
20287
|
}),
|
|
20475
|
-
moreBelow > 0 && /* @__PURE__ */
|
|
20476
|
-
footerHint !== void 0 && /* @__PURE__ */
|
|
20288
|
+
moreBelow > 0 && /* @__PURE__ */ jsx25(Text21, { color: PALETTE.muted, children: ` \u25BC ${moreBelow} more` }),
|
|
20289
|
+
footerHint !== void 0 && /* @__PURE__ */ jsx25(Text21, { color: PALETTE.muted, children: footerHint })
|
|
20477
20290
|
]
|
|
20478
20291
|
}
|
|
20479
20292
|
);
|
|
@@ -20488,9 +20301,9 @@ var init_GotoBanner = __esm({
|
|
|
20488
20301
|
});
|
|
20489
20302
|
|
|
20490
20303
|
// packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/HelpOverlay.tsx
|
|
20491
|
-
import
|
|
20492
|
-
import { Box as
|
|
20493
|
-
import { Fragment as
|
|
20304
|
+
import React8 from "react";
|
|
20305
|
+
import { Box as Box21, Text as Text22 } from "ink";
|
|
20306
|
+
import { Fragment as Fragment8, jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
20494
20307
|
function HelpOverlay(props) {
|
|
20495
20308
|
const { onClose } = props;
|
|
20496
20309
|
const { columns: terminalColumns, rows: terminalRows } = useTerminalSize();
|
|
@@ -20501,8 +20314,8 @@ function HelpOverlay(props) {
|
|
|
20501
20314
|
if (input === "h" || key.escape) onClose();
|
|
20502
20315
|
}, props.handleInput !== false);
|
|
20503
20316
|
if (props.sections) {
|
|
20504
|
-
return /* @__PURE__ */
|
|
20505
|
-
|
|
20317
|
+
return /* @__PURE__ */ jsxs21(
|
|
20318
|
+
Box21,
|
|
20506
20319
|
{
|
|
20507
20320
|
flexDirection: "column",
|
|
20508
20321
|
borderStyle: "round",
|
|
@@ -20511,19 +20324,19 @@ function HelpOverlay(props) {
|
|
|
20511
20324
|
height: panelHeight,
|
|
20512
20325
|
overflowY: "hidden",
|
|
20513
20326
|
children: [
|
|
20514
|
-
/* @__PURE__ */
|
|
20515
|
-
props.sections.map((section2) => /* @__PURE__ */
|
|
20516
|
-
/* @__PURE__ */
|
|
20517
|
-
/* @__PURE__ */
|
|
20518
|
-
section2.entries.map((entry) => /* @__PURE__ */
|
|
20327
|
+
/* @__PURE__ */ jsx26(Text22, { bold: true, children: "\u2500".repeat(titleRule) + " Help " + "\u2500".repeat(titleRule) }),
|
|
20328
|
+
props.sections.map((section2) => /* @__PURE__ */ jsxs21(React8.Fragment, { children: [
|
|
20329
|
+
/* @__PURE__ */ jsx26(Text22, { children: " " }),
|
|
20330
|
+
/* @__PURE__ */ jsx26(Text22, { bold: true, children: section2.title }),
|
|
20331
|
+
section2.entries.map((entry) => /* @__PURE__ */ jsx26(Text22, { children: entry.keys ? " " + entry.keys.padEnd(16) + " " + entry.label : " " + entry.label }, entry.keys + entry.label))
|
|
20519
20332
|
] }, section2.title))
|
|
20520
20333
|
]
|
|
20521
20334
|
}
|
|
20522
20335
|
);
|
|
20523
20336
|
}
|
|
20524
20337
|
const mode = props.mode;
|
|
20525
|
-
return /* @__PURE__ */
|
|
20526
|
-
|
|
20338
|
+
return /* @__PURE__ */ jsxs21(
|
|
20339
|
+
Box21,
|
|
20527
20340
|
{
|
|
20528
20341
|
flexDirection: "column",
|
|
20529
20342
|
borderStyle: "round",
|
|
@@ -20532,31 +20345,31 @@ function HelpOverlay(props) {
|
|
|
20532
20345
|
height: panelHeight,
|
|
20533
20346
|
overflowY: "hidden",
|
|
20534
20347
|
children: [
|
|
20535
|
-
/* @__PURE__ */
|
|
20536
|
-
/* @__PURE__ */
|
|
20537
|
-
/* @__PURE__ */
|
|
20538
|
-
/* @__PURE__ */
|
|
20539
|
-
/* @__PURE__ */
|
|
20540
|
-
/* @__PURE__ */
|
|
20541
|
-
/* @__PURE__ */
|
|
20542
|
-
mode === "review" && /* @__PURE__ */
|
|
20543
|
-
/* @__PURE__ */
|
|
20544
|
-
/* @__PURE__ */
|
|
20545
|
-
/* @__PURE__ */
|
|
20546
|
-
/* @__PURE__ */
|
|
20547
|
-
/* @__PURE__ */
|
|
20548
|
-
/* @__PURE__ */
|
|
20549
|
-
/* @__PURE__ */
|
|
20550
|
-
/* @__PURE__ */
|
|
20551
|
-
/* @__PURE__ */
|
|
20552
|
-
/* @__PURE__ */
|
|
20553
|
-
/* @__PURE__ */
|
|
20554
|
-
/* @__PURE__ */
|
|
20555
|
-
/* @__PURE__ */
|
|
20348
|
+
/* @__PURE__ */ jsx26(Text22, { bold: true, children: "\u2500".repeat(titleRule) + " Help " + "\u2500".repeat(titleRule) }),
|
|
20349
|
+
/* @__PURE__ */ jsx26(Text22, { children: " " }),
|
|
20350
|
+
/* @__PURE__ */ jsx26(Text22, { bold: true, children: "Navigation" }),
|
|
20351
|
+
/* @__PURE__ */ jsx26(Text22, { children: " \u2191 / k / PgUp Scroll up" }),
|
|
20352
|
+
/* @__PURE__ */ jsx26(Text22, { children: " \u2193 / j / PgDn Scroll down" }),
|
|
20353
|
+
/* @__PURE__ */ jsx26(Text22, { children: " g / Home Jump to top" }),
|
|
20354
|
+
/* @__PURE__ */ jsx26(Text22, { children: " G / End Jump to bottom" }),
|
|
20355
|
+
mode === "review" && /* @__PURE__ */ jsxs21(Fragment8, { children: [
|
|
20356
|
+
/* @__PURE__ */ jsx26(Text22, { children: " " }),
|
|
20357
|
+
/* @__PURE__ */ jsx26(Text22, { bold: true, children: "[Review mode only]" }),
|
|
20358
|
+
/* @__PURE__ */ jsx26(Text22, { children: " Tab Toggle sidebar/detail" }),
|
|
20359
|
+
/* @__PURE__ */ jsx26(Text22, { children: " a Accept component" }),
|
|
20360
|
+
/* @__PURE__ */ jsx26(Text22, { children: " r Reject component" }),
|
|
20361
|
+
/* @__PURE__ */ jsx26(Text22, { children: " e Edit proposal" }),
|
|
20362
|
+
/* @__PURE__ */ jsx26(Text22, { children: " s Toggle source code" }),
|
|
20363
|
+
/* @__PURE__ */ jsx26(Text22, { children: " A Approve all" }),
|
|
20364
|
+
/* @__PURE__ */ jsx26(Text22, { children: " F Open finalize dialog" }),
|
|
20365
|
+
/* @__PURE__ */ jsx26(Text22, { children: " Ctrl+S Save draft" }),
|
|
20366
|
+
/* @__PURE__ */ jsx26(Text22, { children: " Ctrl+Z Undo" }),
|
|
20367
|
+
/* @__PURE__ */ jsx26(Text22, { children: " Ctrl+Y Redo" }),
|
|
20368
|
+
/* @__PURE__ */ jsx26(Text22, { children: " Esc Exit edit / close" })
|
|
20556
20369
|
] }),
|
|
20557
|
-
/* @__PURE__ */
|
|
20558
|
-
/* @__PURE__ */
|
|
20559
|
-
/* @__PURE__ */
|
|
20370
|
+
/* @__PURE__ */ jsx26(Text22, { children: " " }),
|
|
20371
|
+
/* @__PURE__ */ jsx26(Text22, { children: " h Close help" }),
|
|
20372
|
+
/* @__PURE__ */ jsx26(Text22, { children: " q Quit" })
|
|
20560
20373
|
]
|
|
20561
20374
|
}
|
|
20562
20375
|
);
|
|
@@ -20571,12 +20384,12 @@ var init_HelpOverlay = __esm({
|
|
|
20571
20384
|
});
|
|
20572
20385
|
|
|
20573
20386
|
// packages/experience-design-system-cli-legacy/src/import/tui/components/LegendEntry.tsx
|
|
20574
|
-
import { Text as
|
|
20575
|
-
import { jsx as
|
|
20387
|
+
import { Text as Text23 } from "ink";
|
|
20388
|
+
import { jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
20576
20389
|
function legendEntry(keyBracket, label, active = false) {
|
|
20577
|
-
return /* @__PURE__ */
|
|
20578
|
-
/* @__PURE__ */
|
|
20579
|
-
/* @__PURE__ */
|
|
20390
|
+
return /* @__PURE__ */ jsxs22(Text23, { children: [
|
|
20391
|
+
/* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.warning : PALETTE.info, inverse: active, children: keyBracket }),
|
|
20392
|
+
/* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.warning : void 0, inverse: active, children: " " + label })
|
|
20580
20393
|
] }, keyBracket + label);
|
|
20581
20394
|
}
|
|
20582
20395
|
var init_LegendEntry = __esm({
|
|
@@ -20587,10 +20400,10 @@ var init_LegendEntry = __esm({
|
|
|
20587
20400
|
});
|
|
20588
20401
|
|
|
20589
20402
|
// packages/experience-design-system-cli-legacy/src/import/tui/components/CompactControlBar.tsx
|
|
20590
|
-
import { Box as
|
|
20591
|
-
import { jsxs as
|
|
20403
|
+
import { Box as Box22 } from "ink";
|
|
20404
|
+
import { jsxs as jsxs23 } from "react/jsx-runtime";
|
|
20592
20405
|
function CompactControlBar({ hasGroupRoots, searchActive }) {
|
|
20593
|
-
return /* @__PURE__ */
|
|
20406
|
+
return /* @__PURE__ */ jsxs23(Box22, { borderStyle: "single", borderColor: PALETTE.border, paddingX: 1, flexWrap: "wrap", columnGap: 2, children: [
|
|
20594
20407
|
legendEntry("[\u2191/\u2193]", "move"),
|
|
20595
20408
|
legendEntry("[a/r]", "accept/reject"),
|
|
20596
20409
|
legendEntry("[f]", "continue/finalize"),
|
|
@@ -20609,8 +20422,8 @@ var init_CompactControlBar = __esm({
|
|
|
20609
20422
|
});
|
|
20610
20423
|
|
|
20611
20424
|
// packages/experience-design-system-cli-legacy/src/import/tui/components/CounterStrip.tsx
|
|
20612
|
-
import { Box as
|
|
20613
|
-
import { jsx as
|
|
20425
|
+
import { Box as Box23, Text as Text24 } from "ink";
|
|
20426
|
+
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
20614
20427
|
function CounterStrip(props) {
|
|
20615
20428
|
const { counters, totalWidth } = props;
|
|
20616
20429
|
const condensed = totalWidth < 60;
|
|
@@ -20618,25 +20431,25 @@ function CounterStrip(props) {
|
|
|
20618
20431
|
const labelRej = condensed ? "Rej" : "Rejected";
|
|
20619
20432
|
const labelUnd = condensed ? "Und" : "Undecided";
|
|
20620
20433
|
const sep = condensed ? " | " : " ";
|
|
20621
|
-
return /* @__PURE__ */
|
|
20622
|
-
/* @__PURE__ */
|
|
20434
|
+
return /* @__PURE__ */ jsx28(Box23, { children: /* @__PURE__ */ jsxs24(Text24, { children: [
|
|
20435
|
+
/* @__PURE__ */ jsxs24(Text24, { color: PALETTE.muted, children: [
|
|
20623
20436
|
labelGrp,
|
|
20624
20437
|
" "
|
|
20625
20438
|
] }),
|
|
20626
|
-
/* @__PURE__ */
|
|
20627
|
-
/* @__PURE__ */
|
|
20628
|
-
/* @__PURE__ */
|
|
20439
|
+
/* @__PURE__ */ jsx28(Text24, { bold: true, children: counters.groups }),
|
|
20440
|
+
/* @__PURE__ */ jsx28(Text24, { color: PALETTE.muted, children: sep }),
|
|
20441
|
+
/* @__PURE__ */ jsxs24(Text24, { color: PALETTE.muted, children: [
|
|
20629
20442
|
labelRej,
|
|
20630
20443
|
" "
|
|
20631
20444
|
] }),
|
|
20632
|
-
/* @__PURE__ */
|
|
20633
|
-
/* @__PURE__ */
|
|
20634
|
-
/* @__PURE__ */
|
|
20445
|
+
/* @__PURE__ */ jsx28(Text24, { bold: true, children: counters.rejected }),
|
|
20446
|
+
/* @__PURE__ */ jsx28(Text24, { color: PALETTE.muted, children: sep }),
|
|
20447
|
+
/* @__PURE__ */ jsxs24(Text24, { color: PALETTE.muted, children: [
|
|
20635
20448
|
labelUnd,
|
|
20636
20449
|
" "
|
|
20637
20450
|
] }),
|
|
20638
|
-
/* @__PURE__ */
|
|
20639
|
-
/* @__PURE__ */
|
|
20451
|
+
/* @__PURE__ */ jsx28(Text24, { bold: true, children: counters.undecided }),
|
|
20452
|
+
/* @__PURE__ */ jsx28(Text24, { color: PALETTE.muted, children: sep })
|
|
20640
20453
|
] }) });
|
|
20641
20454
|
}
|
|
20642
20455
|
var init_CounterStrip = __esm({
|
|
@@ -20987,10 +20800,10 @@ var init_scope_gate_columns = __esm({
|
|
|
20987
20800
|
});
|
|
20988
20801
|
|
|
20989
20802
|
// packages/experience-design-system-cli-legacy/src/import/tui/steps/ScopeGateStep.tsx
|
|
20990
|
-
import { Box as
|
|
20991
|
-
import
|
|
20803
|
+
import { Box as Box24, Text as Text25 } from "ink";
|
|
20804
|
+
import React9, { useEffect as useEffect6, useMemo as useMemo2, useRef as useRef3, useState as useState10 } from "react";
|
|
20992
20805
|
import figures3 from "figures";
|
|
20993
|
-
import { Fragment as
|
|
20806
|
+
import { Fragment as Fragment9, jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
20994
20807
|
function toSidebarEntry(c2) {
|
|
20995
20808
|
const $slots = {};
|
|
20996
20809
|
if (c2.slots) {
|
|
@@ -21007,9 +20820,9 @@ function toSidebarEntry(c2) {
|
|
|
21007
20820
|
}
|
|
21008
20821
|
function ScopeGateStep(props) {
|
|
21009
20822
|
if (props.components.length === 0) {
|
|
21010
|
-
return /* @__PURE__ */
|
|
20823
|
+
return /* @__PURE__ */ jsx29(Box24, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx29(Text25, { color: PALETTE.error, children: "Error: no components found for this session \u2014 please re-run analyze extract." }) });
|
|
21011
20824
|
}
|
|
21012
|
-
return /* @__PURE__ */
|
|
20825
|
+
return /* @__PURE__ */ jsx29(ScopeGateStepView, { ...props, components: [...props.components] });
|
|
21013
20826
|
}
|
|
21014
20827
|
function ScopeGateStepView({
|
|
21015
20828
|
components,
|
|
@@ -21019,18 +20832,18 @@ function ScopeGateStepView({
|
|
|
21019
20832
|
const { columns: totalWidth, rows: terminalRows } = useTerminalSize();
|
|
21020
20833
|
const columnPlan = useMemo2(() => computeColumnWidths(totalWidth), [totalWidth]);
|
|
21021
20834
|
const sidebarWidth = columnPlan.main;
|
|
21022
|
-
const [userDecisions, setUserDecisions] =
|
|
21023
|
-
const [nav, setNav] =
|
|
21024
|
-
const [focusedColumn, setFocusedColumn] =
|
|
21025
|
-
const [addedComponentsCursor, setAddedComponentsCursor] =
|
|
21026
|
-
const [showDependencies, setShowDependencies] =
|
|
20835
|
+
const [userDecisions, setUserDecisions] = useState10(/* @__PURE__ */ new Map());
|
|
20836
|
+
const [nav, setNav] = useState10({ cursor: 0, scrollOffset: 0 });
|
|
20837
|
+
const [focusedColumn, setFocusedColumn] = useState10("main");
|
|
20838
|
+
const [addedComponentsCursor, setAddedComponentsCursor] = useState10(0);
|
|
20839
|
+
const [showDependencies, setShowDependencies] = useState10(false);
|
|
21027
20840
|
const cursor = nav.cursor;
|
|
21028
20841
|
const scrollOffset = nav.scrollOffset;
|
|
21029
|
-
const [cyclesPanelOpen, setCyclesPanelOpen] =
|
|
21030
|
-
const [cyclesCursor, setCyclesCursor] =
|
|
20842
|
+
const [cyclesPanelOpen, setCyclesPanelOpen] = useState10(false);
|
|
20843
|
+
const [cyclesCursor, setCyclesCursor] = useState10(0);
|
|
21031
20844
|
const aiRationalePanel = useOverlayPanel({ toggleKey: "x" });
|
|
21032
|
-
const [aiCursor, setAiCursor] =
|
|
21033
|
-
const [pendingRejectCascade, setPendingRejectCascade] =
|
|
20845
|
+
const [aiCursor, setAiCursor] = useState10(0);
|
|
20846
|
+
const [pendingRejectCascade, setPendingRejectCascade] = useState10(null);
|
|
21034
20847
|
const {
|
|
21035
20848
|
searchOpen,
|
|
21036
20849
|
setSearchOpen,
|
|
@@ -21089,12 +20902,12 @@ function ScopeGateStepView({
|
|
|
21089
20902
|
);
|
|
21090
20903
|
const hasCycles = slotCycles.length > 0;
|
|
21091
20904
|
const closures = useMemo2(() => computeAllClosures(graph), [graph]);
|
|
21092
|
-
const [expandedGroups, setExpandedGroups] =
|
|
20905
|
+
const [expandedGroups, setExpandedGroups] = useState10(() => {
|
|
21093
20906
|
const seed = new Set(closures.keys());
|
|
21094
20907
|
for (const p of cycleParticipants) seed.add(p);
|
|
21095
20908
|
return seed;
|
|
21096
20909
|
});
|
|
21097
|
-
const seededGroupsRef =
|
|
20910
|
+
const seededGroupsRef = useRef3(closures.size > 0 || cycleParticipants.size > 0);
|
|
21098
20911
|
useEffect6(() => {
|
|
21099
20912
|
if (seededGroupsRef.current) return;
|
|
21100
20913
|
if (closures.size === 0 && cycleParticipants.size === 0) return;
|
|
@@ -21592,19 +21405,19 @@ function ScopeGateStepView({
|
|
|
21592
21405
|
);
|
|
21593
21406
|
const safeAddedComponentsCursor = Math.min(addedComponentsCursor, Math.max(0, addedComponents.length - 1));
|
|
21594
21407
|
if (showHelp) {
|
|
21595
|
-
return /* @__PURE__ */
|
|
21408
|
+
return /* @__PURE__ */ jsx29(HelpOverlay, { sections: HELP_SECTIONS, handleInput: false, onClose: () => setShowHelp(false) });
|
|
21596
21409
|
}
|
|
21597
|
-
return /* @__PURE__ */
|
|
21598
|
-
/* @__PURE__ */
|
|
21599
|
-
/* @__PURE__ */
|
|
21600
|
-
hasAnyAi && /* @__PURE__ */
|
|
21410
|
+
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", paddingX: 2, children: [
|
|
21411
|
+
/* @__PURE__ */ jsxs25(Box24, { flexDirection: "row", flexWrap: "wrap", children: [
|
|
21412
|
+
/* @__PURE__ */ jsx29(CounterStrip, { counters, totalWidth }),
|
|
21413
|
+
hasAnyAi && /* @__PURE__ */ jsxs25(Text25, { color: PALETTE.muted, children: [
|
|
21601
21414
|
`${aiExcludedCount} component${aiExcludedCount === 1 ? "" : "s"} flagged by AI`,
|
|
21602
|
-
aiRows.length > 0 && /* @__PURE__ */
|
|
21415
|
+
aiRows.length > 0 && /* @__PURE__ */ jsx29(Text25, { color: PALETTE.info, children: " \u2014 press [x] to see why" })
|
|
21603
21416
|
] })
|
|
21604
21417
|
] }),
|
|
21605
|
-
hasCycles && /* @__PURE__ */
|
|
21606
|
-
/* @__PURE__ */
|
|
21607
|
-
aiRationalePanel.isOpen ? /* @__PURE__ */
|
|
21418
|
+
hasCycles && /* @__PURE__ */ jsx29(Box24, { marginTop: 1, children: /* @__PURE__ */ jsx29(Text25, { color: PALETTE.muted, children: "If you must have components with cycles, select them together into the generate step and then use the editor to fix them." }) }),
|
|
21419
|
+
/* @__PURE__ */ jsxs25(Box24, { flexDirection: "row", alignItems: "stretch", children: [
|
|
21420
|
+
aiRationalePanel.isOpen ? /* @__PURE__ */ jsx29(
|
|
21608
21421
|
GotoBanner,
|
|
21609
21422
|
{
|
|
21610
21423
|
title: `Review flags (${aiExcludedCount})`,
|
|
@@ -21614,7 +21427,7 @@ function ScopeGateStepView({
|
|
|
21614
21427
|
width: sidebarWidth,
|
|
21615
21428
|
footerHint: "[\u2191/\u2193] move \xB7 [Enter] jump \xB7 [x/Esc] close"
|
|
21616
21429
|
}
|
|
21617
|
-
) : /* @__PURE__ */
|
|
21430
|
+
) : /* @__PURE__ */ jsx29(
|
|
21618
21431
|
GroupedSidebar,
|
|
21619
21432
|
{
|
|
21620
21433
|
items: groupedItems,
|
|
@@ -21641,9 +21454,9 @@ function ScopeGateStepView({
|
|
|
21641
21454
|
graph
|
|
21642
21455
|
}
|
|
21643
21456
|
),
|
|
21644
|
-
columnPlan.layout === "two-column" && /* @__PURE__ */
|
|
21645
|
-
/* @__PURE__ */
|
|
21646
|
-
/* @__PURE__ */
|
|
21457
|
+
columnPlan.layout === "two-column" && /* @__PURE__ */ jsxs25(Fragment9, { children: [
|
|
21458
|
+
/* @__PURE__ */ jsx29(Box24, { width: 2, flexShrink: 0 }),
|
|
21459
|
+
/* @__PURE__ */ jsx29(
|
|
21647
21460
|
AddedComponentsColumn,
|
|
21648
21461
|
{
|
|
21649
21462
|
width: columnPlan.added,
|
|
@@ -21658,9 +21471,9 @@ function ScopeGateStepView({
|
|
|
21658
21471
|
)
|
|
21659
21472
|
] })
|
|
21660
21473
|
] }),
|
|
21661
|
-
cyclesPanelOpen && /* @__PURE__ */
|
|
21662
|
-
/* @__PURE__ */
|
|
21663
|
-
/* @__PURE__ */
|
|
21474
|
+
cyclesPanelOpen && /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.warning, paddingX: 1, marginTop: 1, children: [
|
|
21475
|
+
/* @__PURE__ */ jsx29(Text25, { bold: true, color: PALETTE.warning, children: `Cycles detected (${slotCycles.length}):` }),
|
|
21476
|
+
/* @__PURE__ */ jsx29(Text25, { children: " " }),
|
|
21664
21477
|
slotCycles.map((cycle, i) => {
|
|
21665
21478
|
const isCursor = i === cyclesCursor;
|
|
21666
21479
|
const parts = [];
|
|
@@ -21670,20 +21483,20 @@ function ScopeGateStepView({
|
|
|
21670
21483
|
}
|
|
21671
21484
|
parts.push(cycle.path[cycle.path.length - 1]);
|
|
21672
21485
|
const label = `Cycle ${i + 1}: ${parts.join(" \u2192 ")}`;
|
|
21673
|
-
return /* @__PURE__ */
|
|
21674
|
-
isCursor ? /* @__PURE__ */
|
|
21675
|
-
/* @__PURE__ */
|
|
21486
|
+
return /* @__PURE__ */ jsxs25(Text25, { children: [
|
|
21487
|
+
isCursor ? /* @__PURE__ */ jsx29(Text25, { color: PALETTE.info, bold: true, children: figures3.pointer }) : /* @__PURE__ */ jsx29(Text25, { children: " " }),
|
|
21488
|
+
/* @__PURE__ */ jsx29(Text25, { color: PALETTE.warning, inverse: isCursor, children: " " + label })
|
|
21676
21489
|
] }, i);
|
|
21677
21490
|
}),
|
|
21678
|
-
/* @__PURE__ */
|
|
21491
|
+
/* @__PURE__ */ jsx29(Text25, { children: "[\u2191/\u2193] move \xB7 [Enter] jump \xB7 [c/Esc] close" })
|
|
21679
21492
|
] }),
|
|
21680
|
-
pendingRejectCascade && /* @__PURE__ */
|
|
21681
|
-
/* @__PURE__ */
|
|
21682
|
-
pendingRejectCascade.ancestors.length > 0 && /* @__PURE__ */
|
|
21683
|
-
pendingRejectCascade.descendants.length > 0 && /* @__PURE__ */
|
|
21684
|
-
/* @__PURE__ */
|
|
21493
|
+
pendingRejectCascade && /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.warning, paddingX: 1, marginTop: 1, children: [
|
|
21494
|
+
/* @__PURE__ */ jsx29(Text25, { bold: true, color: PALETTE.warning, children: `Rejecting ${pendingRejectCascade.target} will:` }),
|
|
21495
|
+
pendingRejectCascade.ancestors.length > 0 && /* @__PURE__ */ jsx29(Text25, { children: `- Reject ancestors: ${pendingRejectCascade.ancestors.join(", ")}` }),
|
|
21496
|
+
pendingRejectCascade.descendants.length > 0 && /* @__PURE__ */ jsx29(Text25, { children: `- Deselect descendants: ${pendingRejectCascade.descendants.join(", ")}` }),
|
|
21497
|
+
/* @__PURE__ */ jsx29(Text25, { children: "[y] confirm \xB7 [n]/[Esc] cancel" })
|
|
21685
21498
|
] }),
|
|
21686
|
-
/* @__PURE__ */
|
|
21499
|
+
/* @__PURE__ */ jsx29(
|
|
21687
21500
|
SearchMatchSummary,
|
|
21688
21501
|
{
|
|
21689
21502
|
open: searchOpen,
|
|
@@ -21694,7 +21507,7 @@ function ScopeGateStepView({
|
|
|
21694
21507
|
marginTop: 1
|
|
21695
21508
|
}
|
|
21696
21509
|
),
|
|
21697
|
-
/* @__PURE__ */
|
|
21510
|
+
/* @__PURE__ */ jsx29(CompactControlBar, { hasGroupRoots, searchActive: searchOpen || searchQuery.length > 0 })
|
|
21698
21511
|
] });
|
|
21699
21512
|
}
|
|
21700
21513
|
function sideColumnLabelStyle(input) {
|
|
@@ -21748,9 +21561,9 @@ function AddedColumn(props) {
|
|
|
21748
21561
|
const reserveAiBadge = entries.some((e) => aiFlaggedByKey?.get(e.name) === true);
|
|
21749
21562
|
const firstNonCycleIdx = entries.findIndex((e) => !e.isCycle);
|
|
21750
21563
|
const window = computeColumnWindow(entries.length, cursor, Math.max(1, visibleCount));
|
|
21751
|
-
return /* @__PURE__ */
|
|
21752
|
-
/* @__PURE__ */
|
|
21753
|
-
entries.length === 0 ? /* @__PURE__ */
|
|
21564
|
+
return /* @__PURE__ */ jsxs25(WindowedPanel, { width, height, title, focused, children: [
|
|
21565
|
+
/* @__PURE__ */ jsx29(WindowIndicator, { direction: "up", count: window.above }),
|
|
21566
|
+
entries.length === 0 ? /* @__PURE__ */ jsx29(Text25, { color: PALETTE.muted, children: "(none)" }) : entries.slice(window.start, window.end).map((entry, vi) => {
|
|
21754
21567
|
const i = window.start + vi;
|
|
21755
21568
|
const isSelected = i === cursor;
|
|
21756
21569
|
const isCursor = focused && isSelected;
|
|
@@ -21761,13 +21574,13 @@ function AddedColumn(props) {
|
|
|
21761
21574
|
isSelected,
|
|
21762
21575
|
focused
|
|
21763
21576
|
});
|
|
21764
|
-
return /* @__PURE__ */
|
|
21765
|
-
showSeparator && /* @__PURE__ */
|
|
21766
|
-
/* @__PURE__ */
|
|
21767
|
-
isCursor ? /* @__PURE__ */
|
|
21768
|
-
reserveAiBadge && (aiFlagged ? /* @__PURE__ */
|
|
21769
|
-
entry.isCycle && /* @__PURE__ */
|
|
21770
|
-
|
|
21577
|
+
return /* @__PURE__ */ jsxs25(React9.Fragment, { children: [
|
|
21578
|
+
showSeparator && /* @__PURE__ */ jsx29(Text25, { dimColor: true, children: "\u2500".repeat(Math.max(0, width - 2)) }),
|
|
21579
|
+
/* @__PURE__ */ jsxs25(Box24, { children: [
|
|
21580
|
+
isCursor ? /* @__PURE__ */ jsx29(Text25, { color: PALETTE.info, bold: true, children: figures3.pointer }) : /* @__PURE__ */ jsx29(Text25, { children: " " }),
|
|
21581
|
+
reserveAiBadge && (aiFlagged ? /* @__PURE__ */ jsx29(Text25, { color: PALETTE.warning, bold: true, children: " [\xD7]" }) : /* @__PURE__ */ jsx29(Text25, { children: " " })),
|
|
21582
|
+
entry.isCycle && /* @__PURE__ */ jsx29(
|
|
21583
|
+
Text25,
|
|
21771
21584
|
{
|
|
21772
21585
|
color: isCursor ? PALETTE.info : PALETTE.warning,
|
|
21773
21586
|
bold: true,
|
|
@@ -21776,8 +21589,8 @@ function AddedColumn(props) {
|
|
|
21776
21589
|
children: " \u26A0"
|
|
21777
21590
|
}
|
|
21778
21591
|
),
|
|
21779
|
-
/* @__PURE__ */
|
|
21780
|
-
|
|
21592
|
+
/* @__PURE__ */ jsx29(
|
|
21593
|
+
Text25,
|
|
21781
21594
|
{
|
|
21782
21595
|
color: style.nameColor,
|
|
21783
21596
|
bold: style.nameBold,
|
|
@@ -21791,11 +21604,11 @@ function AddedColumn(props) {
|
|
|
21791
21604
|
] })
|
|
21792
21605
|
] }, entry.name);
|
|
21793
21606
|
}),
|
|
21794
|
-
/* @__PURE__ */
|
|
21607
|
+
/* @__PURE__ */ jsx29(WindowIndicator, { direction: "down", count: window.below })
|
|
21795
21608
|
] });
|
|
21796
21609
|
}
|
|
21797
21610
|
function AddedComponentsColumn(props) {
|
|
21798
|
-
return /* @__PURE__ */
|
|
21611
|
+
return /* @__PURE__ */ jsx29(AddedColumn, { ...props });
|
|
21799
21612
|
}
|
|
21800
21613
|
var HELP_SECTIONS;
|
|
21801
21614
|
var init_ScopeGateStep = __esm({
|
|
@@ -22219,15 +22032,15 @@ var init_scroll_offset = __esm({
|
|
|
22219
22032
|
});
|
|
22220
22033
|
|
|
22221
22034
|
// packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/FieldEditor.tsx
|
|
22222
|
-
import
|
|
22035
|
+
import React10, { useEffect as useEffect7, useLayoutEffect as useLayoutEffect2, useState as useState11 } from "react";
|
|
22223
22036
|
import figures4 from "figures";
|
|
22224
|
-
import { Box as
|
|
22037
|
+
import { Box as Box25, measureElement, Text as Text26 } from "ink";
|
|
22225
22038
|
import {
|
|
22226
22039
|
CDF_PROPERTY_TYPES,
|
|
22227
22040
|
CDF_PROPERTY_CATEGORIES,
|
|
22228
22041
|
DESIGN_TOKEN_TYPES as DESIGN_TOKEN_TYPES2
|
|
22229
22042
|
} from "@contentful/experience-design-system-types";
|
|
22230
|
-
import { Fragment as
|
|
22043
|
+
import { Fragment as Fragment10, jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
22231
22044
|
function createCommonRowProps(selected, focusLevel, editingField, textCursor, valueCursor, cursorVisible, editingValue, valueText, width) {
|
|
22232
22045
|
return {
|
|
22233
22046
|
selected,
|
|
@@ -22365,14 +22178,14 @@ function serializeState(state, originalJson) {
|
|
|
22365
22178
|
return JSON.stringify(entry, null, 2);
|
|
22366
22179
|
}
|
|
22367
22180
|
function Picker({ value, active }) {
|
|
22368
|
-
return /* @__PURE__ */
|
|
22369
|
-
active && /* @__PURE__ */
|
|
22370
|
-
/* @__PURE__ */
|
|
22371
|
-
active && /* @__PURE__ */
|
|
22181
|
+
return /* @__PURE__ */ jsxs26(Box25, { children: [
|
|
22182
|
+
active && /* @__PURE__ */ jsx30(Text26, { color: PALETTE.warning, children: "\u2039" }),
|
|
22183
|
+
/* @__PURE__ */ jsx30(Text26, { color: active ? PALETTE.warning : void 0, bold: active, children: value }),
|
|
22184
|
+
active && /* @__PURE__ */ jsx30(Text26, { color: PALETTE.warning, children: "\u203A" })
|
|
22372
22185
|
] });
|
|
22373
22186
|
}
|
|
22374
22187
|
function Toggle({ value, active }) {
|
|
22375
|
-
return /* @__PURE__ */
|
|
22188
|
+
return /* @__PURE__ */ jsx30(Box25, { children: /* @__PURE__ */ jsx30(Text26, { color: active ? PALETTE.warning : value ? PALETTE.success : PALETTE.border, children: value ? "[\u2713]" : "[ ]" }) });
|
|
22376
22189
|
}
|
|
22377
22190
|
function InlinePropField({
|
|
22378
22191
|
label,
|
|
@@ -22381,8 +22194,8 @@ function InlinePropField({
|
|
|
22381
22194
|
flexible = false,
|
|
22382
22195
|
width
|
|
22383
22196
|
}) {
|
|
22384
|
-
return /* @__PURE__ */
|
|
22385
|
-
/* @__PURE__ */
|
|
22197
|
+
return /* @__PURE__ */ jsxs26(Box25, { width, gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, flexWrap: "wrap", children: [
|
|
22198
|
+
/* @__PURE__ */ jsxs26(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, wrap: "truncate-end", children: [
|
|
22386
22199
|
focused ? "\u203A " : " ",
|
|
22387
22200
|
label
|
|
22388
22201
|
] }),
|
|
@@ -22395,19 +22208,19 @@ function RequiredField({
|
|
|
22395
22208
|
editingField,
|
|
22396
22209
|
activeField
|
|
22397
22210
|
}) {
|
|
22398
|
-
return /* @__PURE__ */
|
|
22211
|
+
return /* @__PURE__ */ jsx30(InlinePropField, { label: "req:", focused, children: /* @__PURE__ */ jsx30(Toggle, { value, active: editingField && activeField === "required" }) });
|
|
22399
22212
|
}
|
|
22400
22213
|
function DefaultValueRow({
|
|
22401
22214
|
display,
|
|
22402
22215
|
active,
|
|
22403
22216
|
focused
|
|
22404
22217
|
}) {
|
|
22405
|
-
return /* @__PURE__ */
|
|
22406
|
-
/* @__PURE__ */
|
|
22218
|
+
return /* @__PURE__ */ jsxs26(Box25, { gap: 1, flexWrap: "wrap", flexShrink: 0, children: [
|
|
22219
|
+
/* @__PURE__ */ jsxs26(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22407
22220
|
focused ? "\u203A " : " ",
|
|
22408
22221
|
"default:"
|
|
22409
22222
|
] }),
|
|
22410
|
-
active ? /* @__PURE__ */
|
|
22223
|
+
active ? /* @__PURE__ */ jsx30(Picker, { value: display, active: true }) : /* @__PURE__ */ jsx30(Text26, { wrap: "wrap", children: display })
|
|
22411
22224
|
] });
|
|
22412
22225
|
}
|
|
22413
22226
|
function RowLabel({
|
|
@@ -22415,8 +22228,8 @@ function RowLabel({
|
|
|
22415
22228
|
selected,
|
|
22416
22229
|
trailing = true
|
|
22417
22230
|
}) {
|
|
22418
|
-
return /* @__PURE__ */
|
|
22419
|
-
|
|
22231
|
+
return /* @__PURE__ */ jsxs26(
|
|
22232
|
+
Text26,
|
|
22420
22233
|
{
|
|
22421
22234
|
color: selected ? PALETTE.inverse : PALETTE.info,
|
|
22422
22235
|
bold: selected,
|
|
@@ -22435,10 +22248,10 @@ function ValueInputRow({
|
|
|
22435
22248
|
valueText,
|
|
22436
22249
|
cursorVisible
|
|
22437
22250
|
}) {
|
|
22438
|
-
return /* @__PURE__ */
|
|
22439
|
-
/* @__PURE__ */
|
|
22440
|
-
/* @__PURE__ */
|
|
22441
|
-
/* @__PURE__ */
|
|
22251
|
+
return /* @__PURE__ */ jsxs26(Box25, { paddingLeft: 2, children: [
|
|
22252
|
+
/* @__PURE__ */ jsx30(Text26, { color: PALETTE.info, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
22253
|
+
/* @__PURE__ */ jsx30(Text26, { children: valueText }),
|
|
22254
|
+
/* @__PURE__ */ jsx30(Text26, { inverse: cursorVisible, children: " " })
|
|
22442
22255
|
] });
|
|
22443
22256
|
}
|
|
22444
22257
|
function EditableListItem({
|
|
@@ -22451,9 +22264,9 @@ function EditableListItem({
|
|
|
22451
22264
|
}) {
|
|
22452
22265
|
const isBeingEdited = editingValue?.mode === "edit" && editingValue.index === index;
|
|
22453
22266
|
if (isBeingEdited) {
|
|
22454
|
-
return /* @__PURE__ */
|
|
22267
|
+
return /* @__PURE__ */ jsx30(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
22455
22268
|
}
|
|
22456
|
-
return /* @__PURE__ */
|
|
22269
|
+
return /* @__PURE__ */ jsx30(Box25, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx30(Text26, { color: active ? PALETTE.info : void 0, children: active ? `${figures4.pointer} ${value}` : ` ${value}` }) });
|
|
22457
22270
|
}
|
|
22458
22271
|
function EditableValueList({
|
|
22459
22272
|
values,
|
|
@@ -22466,9 +22279,9 @@ function EditableValueList({
|
|
|
22466
22279
|
emptyPaddingLeft,
|
|
22467
22280
|
showAddInput
|
|
22468
22281
|
}) {
|
|
22469
|
-
return /* @__PURE__ */
|
|
22470
|
-
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */
|
|
22471
|
-
values.map((value, index) => /* @__PURE__ */
|
|
22282
|
+
return /* @__PURE__ */ jsxs26(Fragment10, { children: [
|
|
22283
|
+
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: emptyMessage }) : /* @__PURE__ */ jsx30(Box25, { paddingLeft: emptyPaddingLeft, children: /* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: emptyMessage }) })),
|
|
22284
|
+
values.map((value, index) => /* @__PURE__ */ jsx30(
|
|
22472
22285
|
EditableListItem,
|
|
22473
22286
|
{
|
|
22474
22287
|
value,
|
|
@@ -22480,7 +22293,7 @@ function EditableValueList({
|
|
|
22480
22293
|
},
|
|
22481
22294
|
index
|
|
22482
22295
|
)),
|
|
22483
|
-
showAddInput && editingValue?.mode === "add" && /* @__PURE__ */
|
|
22296
|
+
showAddInput && editingValue?.mode === "add" && /* @__PURE__ */ jsx30(ValueInputRow, { mode: "add", valueText, cursorVisible })
|
|
22484
22297
|
] });
|
|
22485
22298
|
}
|
|
22486
22299
|
function DefaultSubRow({
|
|
@@ -22492,51 +22305,51 @@ function DefaultSubRow({
|
|
|
22492
22305
|
}) {
|
|
22493
22306
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
22494
22307
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
22495
|
-
return /* @__PURE__ */
|
|
22496
|
-
/* @__PURE__ */
|
|
22308
|
+
return /* @__PURE__ */ jsxs26(Box25, { gap: 1, flexShrink: 0, children: [
|
|
22309
|
+
/* @__PURE__ */ jsxs26(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22497
22310
|
focused ? "\u203A " : " ",
|
|
22498
22311
|
"default:"
|
|
22499
22312
|
] }),
|
|
22500
|
-
/* @__PURE__ */
|
|
22313
|
+
/* @__PURE__ */ jsx30(Text26, { color: focused ? void 0 : PALETTE.muted, children: "(not applicable)" })
|
|
22501
22314
|
] });
|
|
22502
22315
|
}
|
|
22503
22316
|
if (prop.type === "boolean") {
|
|
22504
22317
|
const display = prop.default === true ? "true" : prop.default === false ? "false" : "(unset)";
|
|
22505
|
-
return /* @__PURE__ */
|
|
22318
|
+
return /* @__PURE__ */ jsx30(DefaultValueRow, { display, active, focused });
|
|
22506
22319
|
}
|
|
22507
22320
|
if (prop.type === "enum") {
|
|
22508
22321
|
if (prop.values.length === 0) {
|
|
22509
|
-
return /* @__PURE__ */
|
|
22510
|
-
/* @__PURE__ */
|
|
22322
|
+
return /* @__PURE__ */ jsxs26(Box25, { gap: 1, flexShrink: 0, children: [
|
|
22323
|
+
/* @__PURE__ */ jsxs26(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22511
22324
|
focused ? "\u203A " : " ",
|
|
22512
22325
|
"default:"
|
|
22513
22326
|
] }),
|
|
22514
|
-
/* @__PURE__ */
|
|
22327
|
+
/* @__PURE__ */ jsx30(Text26, { color: focused ? void 0 : PALETTE.muted, children: "(no values defined)" })
|
|
22515
22328
|
] });
|
|
22516
22329
|
}
|
|
22517
22330
|
const display = typeof prop.default === "string" && prop.default !== "" ? prop.default : "(unset)";
|
|
22518
|
-
return /* @__PURE__ */
|
|
22331
|
+
return /* @__PURE__ */ jsx30(DefaultValueRow, { display, active, focused });
|
|
22519
22332
|
}
|
|
22520
22333
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
22521
22334
|
if (active) {
|
|
22522
|
-
return /* @__PURE__ */
|
|
22523
|
-
/* @__PURE__ */
|
|
22335
|
+
return /* @__PURE__ */ jsxs26(Box25, { flexDirection: "row", flexShrink: 0, children: [
|
|
22336
|
+
/* @__PURE__ */ jsxs26(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22524
22337
|
focused ? "\u203A " : " ",
|
|
22525
22338
|
"default:"
|
|
22526
22339
|
] }),
|
|
22527
|
-
/* @__PURE__ */
|
|
22528
|
-
/* @__PURE__ */
|
|
22529
|
-
/* @__PURE__ */
|
|
22530
|
-
/* @__PURE__ */
|
|
22340
|
+
/* @__PURE__ */ jsxs26(Box25, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
22341
|
+
/* @__PURE__ */ jsx30(Text26, { children: value.slice(0, textCursor) }),
|
|
22342
|
+
/* @__PURE__ */ jsx30(Text26, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
22343
|
+
/* @__PURE__ */ jsx30(Text26, { children: value.slice(textCursor + 1) })
|
|
22531
22344
|
] })
|
|
22532
22345
|
] });
|
|
22533
22346
|
}
|
|
22534
|
-
return /* @__PURE__ */
|
|
22535
|
-
/* @__PURE__ */
|
|
22347
|
+
return /* @__PURE__ */ jsxs26(Box25, { gap: 1, flexShrink: 0, children: [
|
|
22348
|
+
/* @__PURE__ */ jsxs26(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22536
22349
|
focused ? "\u203A " : " ",
|
|
22537
22350
|
"default:"
|
|
22538
22351
|
] }),
|
|
22539
|
-
/* @__PURE__ */
|
|
22352
|
+
/* @__PURE__ */ jsx30(Text26, { color: focused || value ? void 0 : PALETTE.muted, children: value || "(none)" })
|
|
22540
22353
|
] });
|
|
22541
22354
|
}
|
|
22542
22355
|
function DescriptionField({
|
|
@@ -22551,20 +22364,20 @@ function DescriptionField({
|
|
|
22551
22364
|
paddingLeft = 2
|
|
22552
22365
|
}) {
|
|
22553
22366
|
if (compact) {
|
|
22554
|
-
return /* @__PURE__ */
|
|
22555
|
-
/* @__PURE__ */
|
|
22367
|
+
return /* @__PURE__ */ jsxs26(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22368
|
+
/* @__PURE__ */ jsxs26(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22556
22369
|
focused ? "\u203A " : " ",
|
|
22557
22370
|
label
|
|
22558
22371
|
] }),
|
|
22559
|
-
/* @__PURE__ */
|
|
22372
|
+
/* @__PURE__ */ jsx30(Text26, { wrap: "truncate-end", color: value ? void 0 : PALETTE.muted, children: value || "\u2014" })
|
|
22560
22373
|
] });
|
|
22561
22374
|
}
|
|
22562
|
-
return /* @__PURE__ */
|
|
22563
|
-
/* @__PURE__ */
|
|
22375
|
+
return /* @__PURE__ */ jsxs26(Box25, { paddingLeft, flexDirection: "column", width, flexShrink: 0, children: [
|
|
22376
|
+
/* @__PURE__ */ jsxs26(Text26, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
22564
22377
|
focused ? "\u203A " : " ",
|
|
22565
22378
|
label
|
|
22566
22379
|
] }),
|
|
22567
|
-
editing ? /* @__PURE__ */
|
|
22380
|
+
editing ? /* @__PURE__ */ jsx30(EditableDescription, { cursorVisible, value, textCursor }) : /* @__PURE__ */ jsx30(Text26, { wrap: "wrap", children: value || "\u2014" })
|
|
22568
22381
|
] });
|
|
22569
22382
|
}
|
|
22570
22383
|
function EditableDescription({
|
|
@@ -22572,9 +22385,9 @@ function EditableDescription({
|
|
|
22572
22385
|
value,
|
|
22573
22386
|
textCursor
|
|
22574
22387
|
}) {
|
|
22575
|
-
return /* @__PURE__ */
|
|
22388
|
+
return /* @__PURE__ */ jsxs26(Text26, { wrap: "wrap", children: [
|
|
22576
22389
|
value.slice(0, textCursor),
|
|
22577
|
-
/* @__PURE__ */
|
|
22390
|
+
/* @__PURE__ */ jsx30(Text26, { inverse: cursorVisible, children: value[textCursor] ?? " " }),
|
|
22578
22391
|
value.slice(textCursor + 1)
|
|
22579
22392
|
] });
|
|
22580
22393
|
}
|
|
@@ -22595,9 +22408,9 @@ function PropRow({
|
|
|
22595
22408
|
}) {
|
|
22596
22409
|
const descFocused = activeField === "description";
|
|
22597
22410
|
const descActive = editingField && descFocused;
|
|
22598
|
-
return /* @__PURE__ */
|
|
22599
|
-
/* @__PURE__ */
|
|
22600
|
-
/* @__PURE__ */
|
|
22411
|
+
return /* @__PURE__ */ jsxs26(Box25, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
22412
|
+
/* @__PURE__ */ jsx30(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx30(RowLabel, { name: prop.name, selected }) }),
|
|
22413
|
+
/* @__PURE__ */ jsx30(
|
|
22601
22414
|
DescriptionField,
|
|
22602
22415
|
{
|
|
22603
22416
|
value: prop.description,
|
|
@@ -22610,8 +22423,8 @@ function PropRow({
|
|
|
22610
22423
|
paddingLeft: 0
|
|
22611
22424
|
}
|
|
22612
22425
|
),
|
|
22613
|
-
/* @__PURE__ */
|
|
22614
|
-
/* @__PURE__ */
|
|
22426
|
+
/* @__PURE__ */ jsxs26(Box25, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
22427
|
+
/* @__PURE__ */ jsx30(
|
|
22615
22428
|
RequiredField,
|
|
22616
22429
|
{
|
|
22617
22430
|
value: prop.required,
|
|
@@ -22620,21 +22433,21 @@ function PropRow({
|
|
|
22620
22433
|
activeField
|
|
22621
22434
|
}
|
|
22622
22435
|
),
|
|
22623
|
-
/* @__PURE__ */
|
|
22436
|
+
/* @__PURE__ */ jsx30(InlinePropField, { label: "type:", focused: activeField === "type", children: editingField && activeField === "type" ? /* @__PURE__ */ jsx30(Picker, { value: prop.type, active: true }) : /* @__PURE__ */ jsx30(Text26, { children: prop.type }) })
|
|
22624
22437
|
] }),
|
|
22625
|
-
prop.type === "token" && /* @__PURE__ */
|
|
22626
|
-
prop.type === "enum" && /* @__PURE__ */
|
|
22627
|
-
/* @__PURE__ */
|
|
22438
|
+
prop.type === "token" && /* @__PURE__ */ jsx30(InlinePropField, { label: "kind:", focused: activeField === "tokenKind", width, children: editingField && activeField === "tokenKind" ? /* @__PURE__ */ jsx30(Picker, { value: prop.tokenKind || DESIGN_TOKEN_TYPES2[0], active: true }) : /* @__PURE__ */ jsx30(Text26, { wrap: "wrap", children: prop.tokenKind || "\u2014" }) }),
|
|
22439
|
+
prop.type === "enum" && /* @__PURE__ */ jsxs26(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22440
|
+
/* @__PURE__ */ jsxs26(Text26, { color: activeField === "values" ? PALETTE.warning : PALETTE.muted, bold: activeField === "values", children: [
|
|
22628
22441
|
activeField === "values" ? "\u203A " : " ",
|
|
22629
22442
|
"values:"
|
|
22630
22443
|
] }),
|
|
22631
|
-
/* @__PURE__ */
|
|
22444
|
+
/* @__PURE__ */ jsxs26(Text26, { wrap: "wrap", children: [
|
|
22632
22445
|
"[",
|
|
22633
22446
|
prop.values.join(", "),
|
|
22634
22447
|
"]"
|
|
22635
22448
|
] })
|
|
22636
22449
|
] }),
|
|
22637
|
-
/* @__PURE__ */
|
|
22450
|
+
/* @__PURE__ */ jsx30(
|
|
22638
22451
|
DefaultSubRow,
|
|
22639
22452
|
{
|
|
22640
22453
|
prop,
|
|
@@ -22644,13 +22457,13 @@ function PropRow({
|
|
|
22644
22457
|
cursorVisible
|
|
22645
22458
|
}
|
|
22646
22459
|
),
|
|
22647
|
-
prop.type === "token" && prop.category === "design" && /* @__PURE__ */
|
|
22648
|
-
/* @__PURE__ */
|
|
22460
|
+
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs26(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22461
|
+
/* @__PURE__ */ jsxs26(Text26, { color: activeField === "allowed" ? PALETTE.warning : PALETTE.muted, bold: activeField === "allowed", children: [
|
|
22649
22462
|
activeField === "allowed" ? "\u203A " : " ",
|
|
22650
22463
|
"allowed:"
|
|
22651
22464
|
] }),
|
|
22652
|
-
editingField && activeField === "allowed" ? /* @__PURE__ */
|
|
22653
|
-
|
|
22465
|
+
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx30(Box25, { width: Math.max(1, width - 4), borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: /* @__PURE__ */ jsx30(Text26, { children: "press [t] to edit allowed tokens" }) }) : /* @__PURE__ */ jsx30(
|
|
22466
|
+
Text26,
|
|
22654
22467
|
{
|
|
22655
22468
|
color: activeField !== "allowed" && prop.allowed.length === 0 ? PALETTE.muted : void 0,
|
|
22656
22469
|
wrap: "wrap",
|
|
@@ -22658,17 +22471,17 @@ function PropRow({
|
|
|
22658
22471
|
}
|
|
22659
22472
|
)
|
|
22660
22473
|
] }),
|
|
22661
|
-
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */
|
|
22474
|
+
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx30(Box25, { paddingLeft: 2, children: /* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: (() => {
|
|
22662
22475
|
const max = Math.max(8, width - 8);
|
|
22663
22476
|
const text = `~ ${rationale}`;
|
|
22664
22477
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
22665
22478
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
22666
|
-
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */
|
|
22667
|
-
/* @__PURE__ */
|
|
22668
|
-
/* @__PURE__ */
|
|
22669
|
-
activeField === "values" && /* @__PURE__ */
|
|
22479
|
+
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs26(Box25, { paddingLeft: 2, flexDirection: "column", children: [
|
|
22480
|
+
/* @__PURE__ */ jsxs26(Box25, { children: [
|
|
22481
|
+
/* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: "values:" }),
|
|
22482
|
+
activeField === "values" && /* @__PURE__ */ jsx30(Text26, { children: " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
22670
22483
|
] }),
|
|
22671
|
-
/* @__PURE__ */
|
|
22484
|
+
/* @__PURE__ */ jsx30(
|
|
22672
22485
|
EditableValueList,
|
|
22673
22486
|
{
|
|
22674
22487
|
values: prop.values,
|
|
@@ -22698,9 +22511,9 @@ function SlotRow({
|
|
|
22698
22511
|
pickerCandidates,
|
|
22699
22512
|
pickerCursor
|
|
22700
22513
|
}) {
|
|
22701
|
-
return /* @__PURE__ */
|
|
22702
|
-
/* @__PURE__ */
|
|
22703
|
-
/* @__PURE__ */
|
|
22514
|
+
return /* @__PURE__ */ jsxs26(Box25, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
22515
|
+
/* @__PURE__ */ jsx30(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx30(RowLabel, { name: slot.name, selected, trailing: false }) }),
|
|
22516
|
+
/* @__PURE__ */ jsx30(
|
|
22704
22517
|
DescriptionField,
|
|
22705
22518
|
{
|
|
22706
22519
|
value: slot.description,
|
|
@@ -22713,7 +22526,7 @@ function SlotRow({
|
|
|
22713
22526
|
paddingLeft: 0
|
|
22714
22527
|
}
|
|
22715
22528
|
),
|
|
22716
|
-
/* @__PURE__ */
|
|
22529
|
+
/* @__PURE__ */ jsx30(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: /* @__PURE__ */ jsx30(
|
|
22717
22530
|
RequiredField,
|
|
22718
22531
|
{
|
|
22719
22532
|
value: slot.required,
|
|
@@ -22722,9 +22535,9 @@ function SlotRow({
|
|
|
22722
22535
|
activeField
|
|
22723
22536
|
}
|
|
22724
22537
|
) }),
|
|
22725
|
-
!(selected && editingField && activeField === "allowedComponents") && /* @__PURE__ */
|
|
22726
|
-
/* @__PURE__ */
|
|
22727
|
-
|
|
22538
|
+
!(selected && editingField && activeField === "allowedComponents") && /* @__PURE__ */ jsxs26(Box25, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22539
|
+
/* @__PURE__ */ jsxs26(
|
|
22540
|
+
Text26,
|
|
22728
22541
|
{
|
|
22729
22542
|
color: activeField === "allowedComponents" ? PALETTE.warning : PALETTE.muted,
|
|
22730
22543
|
bold: activeField === "allowedComponents",
|
|
@@ -22734,12 +22547,12 @@ function SlotRow({
|
|
|
22734
22547
|
]
|
|
22735
22548
|
}
|
|
22736
22549
|
),
|
|
22737
|
-
slot.allowedComponents.length === 0 ? /* @__PURE__ */
|
|
22550
|
+
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: "(any)" }) : /* @__PURE__ */ jsx30(Text26, { wrap: "wrap", children: slot.allowedComponents.join(", ") })
|
|
22738
22551
|
] }),
|
|
22739
|
-
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */
|
|
22740
|
-
/* @__PURE__ */
|
|
22741
|
-
/* @__PURE__ */
|
|
22742
|
-
|
|
22552
|
+
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs26(Box25, { flexDirection: "column", children: [
|
|
22553
|
+
/* @__PURE__ */ jsxs26(Box25, { children: [
|
|
22554
|
+
/* @__PURE__ */ jsxs26(
|
|
22555
|
+
Text26,
|
|
22743
22556
|
{
|
|
22744
22557
|
color: activeField === "allowedComponents" ? PALETTE.warning : PALETTE.muted,
|
|
22745
22558
|
bold: activeField === "allowedComponents",
|
|
@@ -22749,9 +22562,9 @@ function SlotRow({
|
|
|
22749
22562
|
]
|
|
22750
22563
|
}
|
|
22751
22564
|
),
|
|
22752
|
-
editingField && activeField === "allowedComponents" && /* @__PURE__ */
|
|
22565
|
+
editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: slot.allowedComponents.length > 0 ? " [a] add [e] edit [r] remove [\u2190\u2192] cycle [\u2191\u2193] navigate [K/J] reorder" : " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
22753
22566
|
] }),
|
|
22754
|
-
/* @__PURE__ */
|
|
22567
|
+
/* @__PURE__ */ jsx30(
|
|
22755
22568
|
EditableValueList,
|
|
22756
22569
|
{
|
|
22757
22570
|
values: slot.allowedComponents,
|
|
@@ -22765,21 +22578,21 @@ function SlotRow({
|
|
|
22765
22578
|
showAddInput: editingField && activeField === "allowedComponents"
|
|
22766
22579
|
}
|
|
22767
22580
|
),
|
|
22768
|
-
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */
|
|
22581
|
+
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx30(Box25, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: "(no valid components to add \u2014 all remaining candidates would create cycles)" }) : (() => {
|
|
22769
22582
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
22770
22583
|
if (filtered.length === 0) {
|
|
22771
|
-
return /* @__PURE__ */
|
|
22584
|
+
return /* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
22772
22585
|
}
|
|
22773
22586
|
const cursor = pickerCursor % filtered.length;
|
|
22774
22587
|
const MAX_VISIBLE = 5;
|
|
22775
22588
|
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor - 2));
|
|
22776
22589
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
22777
|
-
return /* @__PURE__ */
|
|
22778
|
-
/* @__PURE__ */
|
|
22590
|
+
return /* @__PURE__ */ jsxs26(Box25, { flexDirection: "column", children: [
|
|
22591
|
+
/* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
22779
22592
|
slice.map((name, i) => {
|
|
22780
22593
|
const absIdx = start + i;
|
|
22781
22594
|
const isCursor = absIdx === cursor;
|
|
22782
|
-
return /* @__PURE__ */
|
|
22595
|
+
return /* @__PURE__ */ jsx30(Text26, { color: isCursor ? PALETTE.info : PALETTE.muted, children: isCursor ? ` ${figures4.pointer} ${name}` : ` ${name}` }, name);
|
|
22783
22596
|
})
|
|
22784
22597
|
] });
|
|
22785
22598
|
})() })
|
|
@@ -22901,12 +22714,12 @@ function FieldEditor({
|
|
|
22901
22714
|
headerHeight = 2
|
|
22902
22715
|
}) {
|
|
22903
22716
|
const { state: initialState, error: parseError } = parseToState(value);
|
|
22904
|
-
const [editorState, setEditorState] =
|
|
22905
|
-
const [parseErr] =
|
|
22906
|
-
const [listScrollStart, setListScrollStart] =
|
|
22907
|
-
const initialFocusScrollApplied =
|
|
22908
|
-
const [rowHeights, setRowHeights] =
|
|
22909
|
-
const rowMeasureRefs =
|
|
22717
|
+
const [editorState, setEditorState] = useState11(initialState);
|
|
22718
|
+
const [parseErr] = useState11(parseError);
|
|
22719
|
+
const [listScrollStart, setListScrollStart] = useState11(0);
|
|
22720
|
+
const initialFocusScrollApplied = React10.useRef(false);
|
|
22721
|
+
const [rowHeights, setRowHeights] = useState11({});
|
|
22722
|
+
const rowMeasureRefs = React10.useRef(/* @__PURE__ */ new Map());
|
|
22910
22723
|
const initialFocus = (() => {
|
|
22911
22724
|
if (initialFocusTarget?.kind === "description") {
|
|
22912
22725
|
return {
|
|
@@ -22973,43 +22786,43 @@ function FieldEditor({
|
|
|
22973
22786
|
textCursor: 0
|
|
22974
22787
|
};
|
|
22975
22788
|
})();
|
|
22976
|
-
const [focusLevel, setFocusLevel] =
|
|
22977
|
-
const [propIdx, setPropIdx] =
|
|
22978
|
-
const [slotIdx, setSlotIdx] =
|
|
22979
|
-
const [inSlots, setInSlots] =
|
|
22980
|
-
const [inComponentDesc, setInComponentDesc] =
|
|
22981
|
-
const [activeField, setActiveField] =
|
|
22982
|
-
const [editingField, setEditingField] =
|
|
22983
|
-
const [textCursor, setTextCursor] =
|
|
22984
|
-
const [valueCursor, setValueCursor] =
|
|
22985
|
-
const [editingValue, setEditingValue] =
|
|
22986
|
-
const [valueText, setValueText] =
|
|
22987
|
-
const [pickerCursor, setPickerCursor] =
|
|
22988
|
-
const [validationError, setValidationError] =
|
|
22989
|
-
const [cursorVisible] =
|
|
22990
|
-
const [sourceOpen, setSourceOpen] =
|
|
22991
|
-
const [rationaleOpen, setRationaleOpen] =
|
|
22992
|
-
const [rationaleScrollOffset, setRationaleScrollOffset] =
|
|
22993
|
-
const [showHelp, setShowHelp] =
|
|
22789
|
+
const [focusLevel, setFocusLevel] = useState11(initialFocus.focusLevel);
|
|
22790
|
+
const [propIdx, setPropIdx] = useState11(initialFocus.propIdx);
|
|
22791
|
+
const [slotIdx, setSlotIdx] = useState11(initialFocus.slotIdx);
|
|
22792
|
+
const [inSlots, setInSlots] = useState11(initialFocus.inSlots);
|
|
22793
|
+
const [inComponentDesc, setInComponentDesc] = useState11(initialFocus.focusLevel === "componentDescription");
|
|
22794
|
+
const [activeField, setActiveField] = useState11(initialFocus.activeField);
|
|
22795
|
+
const [editingField, setEditingField] = useState11(false);
|
|
22796
|
+
const [textCursor, setTextCursor] = useState11(initialFocus.textCursor);
|
|
22797
|
+
const [valueCursor, setValueCursor] = useState11(0);
|
|
22798
|
+
const [editingValue, setEditingValue] = useState11(null);
|
|
22799
|
+
const [valueText, setValueText] = useState11("");
|
|
22800
|
+
const [pickerCursor, setPickerCursor] = useState11(0);
|
|
22801
|
+
const [validationError, setValidationError] = useState11(null);
|
|
22802
|
+
const [cursorVisible] = useState11(true);
|
|
22803
|
+
const [sourceOpen, setSourceOpen] = useState11(false);
|
|
22804
|
+
const [rationaleOpen, setRationaleOpen] = useState11(false);
|
|
22805
|
+
const [rationaleScrollOffset, setRationaleScrollOffset] = useState11(0);
|
|
22806
|
+
const [showHelp, setShowHelp] = useState11(false);
|
|
22994
22807
|
const props = editorState.props;
|
|
22995
22808
|
const slots = editorState.slots;
|
|
22996
|
-
const contentPropIndexes =
|
|
22809
|
+
const contentPropIndexes = React10.useMemo(
|
|
22997
22810
|
() => props.flatMap((prop, index) => prop.category === "content" ? [index] : []),
|
|
22998
22811
|
[props]
|
|
22999
22812
|
);
|
|
23000
|
-
const designPropIndexes =
|
|
22813
|
+
const designPropIndexes = React10.useMemo(
|
|
23001
22814
|
() => props.flatMap((prop, index) => prop.category === "design" ? [index] : []),
|
|
23002
22815
|
[props]
|
|
23003
22816
|
);
|
|
23004
|
-
const hiddenPropIndexes =
|
|
22817
|
+
const hiddenPropIndexes = React10.useMemo(
|
|
23005
22818
|
() => showHiddenProps ? props.flatMap((prop, index) => prop.category === "state" || prop.category === "unattached" ? [index] : []) : [],
|
|
23006
22819
|
[props, showHiddenProps]
|
|
23007
22820
|
);
|
|
23008
|
-
const visiblePropIndexes =
|
|
22821
|
+
const visiblePropIndexes = React10.useMemo(
|
|
23009
22822
|
() => [...contentPropIndexes, ...designPropIndexes, ...hiddenPropIndexes],
|
|
23010
22823
|
[contentPropIndexes, designPropIndexes, hiddenPropIndexes]
|
|
23011
22824
|
);
|
|
23012
|
-
const propGroups =
|
|
22825
|
+
const propGroups = React10.useMemo(
|
|
23013
22826
|
() => [
|
|
23014
22827
|
{
|
|
23015
22828
|
kind: "content",
|
|
@@ -23029,7 +22842,7 @@ function FieldEditor({
|
|
|
23029
22842
|
],
|
|
23030
22843
|
[contentPropIndexes, designPropIndexes, hiddenPropIndexes]
|
|
23031
22844
|
);
|
|
23032
|
-
const selectableRows =
|
|
22845
|
+
const selectableRows = React10.useMemo(
|
|
23033
22846
|
() => [
|
|
23034
22847
|
...contentPropIndexes.map((idx) => ({ kind: "prop", idx })),
|
|
23035
22848
|
...designPropIndexes.map((idx) => ({ kind: "prop", idx })),
|
|
@@ -23039,7 +22852,7 @@ function FieldEditor({
|
|
|
23039
22852
|
[contentPropIndexes, designPropIndexes, hiddenPropIndexes, slots]
|
|
23040
22853
|
);
|
|
23041
22854
|
const visiblePropPosition = visiblePropIndexes.indexOf(propIdx);
|
|
23042
|
-
const selectedSelectableIndex =
|
|
22855
|
+
const selectedSelectableIndex = React10.useMemo(
|
|
23043
22856
|
() => selectableRows.findIndex(
|
|
23044
22857
|
(row) => inSlots ? row.kind === "slot" && row.idx === slotIdx : row.kind === "prop" && row.idx === propIdx
|
|
23045
22858
|
),
|
|
@@ -23058,12 +22871,12 @@ function FieldEditor({
|
|
|
23058
22871
|
}
|
|
23059
22872
|
};
|
|
23060
22873
|
const textEntryActive = focusLevel === "field" && editingField && activeField === "description" || focusLevel === "field" && editingField && activeField === "default" && (editorState.props[propIdx]?.type === "string" || editorState.props[propIdx]?.type === "token") || editingValue != null;
|
|
23061
|
-
|
|
22874
|
+
React10.useEffect(() => {
|
|
23062
22875
|
onTextEntryActiveChange?.(textEntryActive);
|
|
23063
22876
|
}, [textEntryActive, onTextEntryActiveChange]);
|
|
23064
22877
|
const currentProp = props[propIdx] ?? null;
|
|
23065
22878
|
const currentSlot = slots[slotIdx] ?? null;
|
|
23066
|
-
|
|
22879
|
+
React10.useEffect(() => {
|
|
23067
22880
|
if (showHiddenProps || inSlots || inComponentDesc || visiblePropPosition >= 0) return;
|
|
23068
22881
|
if (visiblePropIndexes.length > 0) {
|
|
23069
22882
|
setPropIdx(visiblePropIndexes[0]);
|
|
@@ -23082,22 +22895,22 @@ function FieldEditor({
|
|
|
23082
22895
|
setEditorState(next);
|
|
23083
22896
|
onChange(serializeState(next, value));
|
|
23084
22897
|
};
|
|
23085
|
-
const canonicalize =
|
|
22898
|
+
const canonicalize = React10.useCallback((json) => {
|
|
23086
22899
|
try {
|
|
23087
22900
|
return JSON.stringify(JSON.parse(json));
|
|
23088
22901
|
} catch {
|
|
23089
22902
|
return `__unparseable__:${json}`;
|
|
23090
22903
|
}
|
|
23091
22904
|
}, []);
|
|
23092
|
-
const initialStateRef =
|
|
22905
|
+
const initialStateRef = React10.useRef(initialState);
|
|
23093
22906
|
const baselineCanonical = canonicalize(serializeState(initialStateRef.current, value));
|
|
23094
22907
|
const currentCanonical = canonicalize(serializeState(editorState, value));
|
|
23095
22908
|
const isDirty = currentCanonical !== baselineCanonical;
|
|
23096
|
-
|
|
22909
|
+
React10.useEffect(() => {
|
|
23097
22910
|
onDirtyChange?.(isDirty);
|
|
23098
22911
|
}, [isDirty, onDirtyChange]);
|
|
23099
|
-
const lastDiscardTriggerRef =
|
|
23100
|
-
|
|
22912
|
+
const lastDiscardTriggerRef = React10.useRef(discardTrigger);
|
|
22913
|
+
React10.useEffect(() => {
|
|
23101
22914
|
if (discardTrigger === void 0) return;
|
|
23102
22915
|
if (discardTrigger === lastDiscardTriggerRef.current) return;
|
|
23103
22916
|
lastDiscardTriggerRef.current = discardTrigger;
|
|
@@ -23607,18 +23420,18 @@ function FieldEditor({
|
|
|
23607
23420
|
});
|
|
23608
23421
|
const innerWidth = Math.max(1, width - 2);
|
|
23609
23422
|
if (parseErr) {
|
|
23610
|
-
return /* @__PURE__ */
|
|
23611
|
-
/* @__PURE__ */
|
|
23612
|
-
/* @__PURE__ */
|
|
23613
|
-
/* @__PURE__ */
|
|
23423
|
+
return /* @__PURE__ */ jsxs26(Box25, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.error, children: [
|
|
23424
|
+
/* @__PURE__ */ jsx30(Text26, { bold: true, color: PALETTE.error, children: "FIELD EDITOR \u2014 parse error" }),
|
|
23425
|
+
/* @__PURE__ */ jsx30(Text26, { color: PALETTE.error, children: parseErr }),
|
|
23426
|
+
/* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: "Cannot display structured editor. Fix the JSON first." })
|
|
23614
23427
|
] });
|
|
23615
23428
|
}
|
|
23616
23429
|
if (props.length === 0 && slots.length === 0) {
|
|
23617
|
-
return /* @__PURE__ */
|
|
23618
|
-
/* @__PURE__ */
|
|
23619
|
-
/* @__PURE__ */
|
|
23620
|
-
/* @__PURE__ */
|
|
23621
|
-
/* @__PURE__ */
|
|
23430
|
+
return /* @__PURE__ */ jsxs26(Box25, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.warning, children: [
|
|
23431
|
+
/* @__PURE__ */ jsx30(Text26, { bold: true, color: PALETTE.warning, children: "FIELD EDITOR \u2014 no fields" }),
|
|
23432
|
+
/* @__PURE__ */ jsx30(Text26, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
|
|
23433
|
+
/* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: "You can add fields manually below or reject this component." }),
|
|
23434
|
+
/* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: "Enter to save \xB7 Esc to discard" })
|
|
23622
23435
|
] });
|
|
23623
23436
|
}
|
|
23624
23437
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
@@ -23747,12 +23560,12 @@ function FieldEditor({
|
|
|
23747
23560
|
const renderRow = (row, index) => {
|
|
23748
23561
|
const key = rowKey(row, index);
|
|
23749
23562
|
if (row.kind === "header") {
|
|
23750
|
-
return /* @__PURE__ */
|
|
23563
|
+
return /* @__PURE__ */ jsx30(Box25, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx30(Text26, { bold: true, color: PALETTE.success, children: row.label }) }, key);
|
|
23751
23564
|
}
|
|
23752
23565
|
if (row.kind === "component-description") {
|
|
23753
23566
|
const isSelected2 = inComponentDesc && active;
|
|
23754
23567
|
const isEditing = isSelected2 && focusLevel === "field" && editingField && activeField === "description";
|
|
23755
|
-
return /* @__PURE__ */
|
|
23568
|
+
return /* @__PURE__ */ jsx30(
|
|
23756
23569
|
DescriptionField,
|
|
23757
23570
|
{
|
|
23758
23571
|
value: editorState.componentDescription,
|
|
@@ -23783,7 +23596,7 @@ function FieldEditor({
|
|
|
23783
23596
|
valueText,
|
|
23784
23597
|
innerWidth
|
|
23785
23598
|
);
|
|
23786
|
-
return /* @__PURE__ */
|
|
23599
|
+
return /* @__PURE__ */ jsx30(
|
|
23787
23600
|
PropRow,
|
|
23788
23601
|
{
|
|
23789
23602
|
prop: p,
|
|
@@ -23810,7 +23623,7 @@ function FieldEditor({
|
|
|
23810
23623
|
valueText,
|
|
23811
23624
|
innerWidth
|
|
23812
23625
|
);
|
|
23813
|
-
return /* @__PURE__ */
|
|
23626
|
+
return /* @__PURE__ */ jsx30(
|
|
23814
23627
|
SlotRow,
|
|
23815
23628
|
{
|
|
23816
23629
|
slot: s,
|
|
@@ -23822,7 +23635,7 @@ function FieldEditor({
|
|
|
23822
23635
|
key
|
|
23823
23636
|
);
|
|
23824
23637
|
};
|
|
23825
|
-
return /* @__PURE__ */
|
|
23638
|
+
return /* @__PURE__ */ jsxs26(
|
|
23826
23639
|
FixedPanel,
|
|
23827
23640
|
{
|
|
23828
23641
|
width,
|
|
@@ -23831,9 +23644,9 @@ function FieldEditor({
|
|
|
23831
23644
|
borderStyle: "single",
|
|
23832
23645
|
borderColor: hasEmptyProperties ? PALETTE.warning : active ? PALETTE.info : PALETTE.border,
|
|
23833
23646
|
children: [
|
|
23834
|
-
hasEmptyProperties && /* @__PURE__ */
|
|
23647
|
+
hasEmptyProperties && /* @__PURE__ */ jsx30(Text26, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify. Reject this component or add fields manually." }),
|
|
23835
23648
|
header,
|
|
23836
|
-
/* @__PURE__ */
|
|
23649
|
+
/* @__PURE__ */ jsx30(Box25, { flexDirection: "column", width: innerWidth, flexShrink: 0, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx30(
|
|
23837
23650
|
PropRow,
|
|
23838
23651
|
{
|
|
23839
23652
|
prop: currentProp,
|
|
@@ -23849,7 +23662,7 @@ function FieldEditor({
|
|
|
23849
23662
|
rationale: metadata?.props?.[currentProp.name]?.rationale ?? null,
|
|
23850
23663
|
showRationale: showInlineRationales
|
|
23851
23664
|
}
|
|
23852
|
-
) : focusLevel === "field" && inSlots && currentSlot ? /* @__PURE__ */
|
|
23665
|
+
) : focusLevel === "field" && inSlots && currentSlot ? /* @__PURE__ */ jsx30(
|
|
23853
23666
|
SlotRow,
|
|
23854
23667
|
{
|
|
23855
23668
|
slot: currentSlot,
|
|
@@ -23868,8 +23681,8 @@ function FieldEditor({
|
|
|
23868
23681
|
) : visibleRowSlice.map((row, index) => {
|
|
23869
23682
|
const absoluteIndex = scrollStart + index;
|
|
23870
23683
|
const key = rowKey(row, absoluteIndex);
|
|
23871
|
-
return /* @__PURE__ */
|
|
23872
|
-
|
|
23684
|
+
return /* @__PURE__ */ jsx30(
|
|
23685
|
+
Box25,
|
|
23873
23686
|
{
|
|
23874
23687
|
ref: (node) => {
|
|
23875
23688
|
if (node) rowMeasureRefs.current.set(key, node);
|
|
@@ -23882,7 +23695,7 @@ function FieldEditor({
|
|
|
23882
23695
|
`visible-${key}`
|
|
23883
23696
|
);
|
|
23884
23697
|
}) }),
|
|
23885
|
-
categoryBelow && /* @__PURE__ */
|
|
23698
|
+
categoryBelow && /* @__PURE__ */ jsx30(Text26, { color: PALETTE.success, bold: true, children: `(${categoryBelow} below)` }),
|
|
23886
23699
|
sourceOpen && !onToggleSourceExternal && (() => {
|
|
23887
23700
|
const propMeta = !inSlots && !inComponentDesc && currentProp ? metadata?.props?.[currentProp.name] : void 0;
|
|
23888
23701
|
const start = propMeta?.sourceStartLine ?? null;
|
|
@@ -23891,49 +23704,49 @@ function FieldEditor({
|
|
|
23891
23704
|
const src = metadata?.componentSource ?? null;
|
|
23892
23705
|
const headerPath = path ?? "<unknown source path>";
|
|
23893
23706
|
if (!start || !end2 || !src) {
|
|
23894
|
-
return /* @__PURE__ */
|
|
23895
|
-
/* @__PURE__ */
|
|
23896
|
-
/* @__PURE__ */
|
|
23897
|
-
/* @__PURE__ */
|
|
23707
|
+
return /* @__PURE__ */ jsxs26(Box25, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
23708
|
+
/* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, bold: true, children: `source: ${headerPath}` }),
|
|
23709
|
+
/* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: "(no source location captured for this prop)" }),
|
|
23710
|
+
/* @__PURE__ */ jsx30(Text26, { children: "[s] close" })
|
|
23898
23711
|
] });
|
|
23899
23712
|
}
|
|
23900
23713
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end2);
|
|
23901
|
-
return /* @__PURE__ */
|
|
23902
|
-
/* @__PURE__ */
|
|
23903
|
-
lines.map((ln, i) => /* @__PURE__ */
|
|
23904
|
-
/* @__PURE__ */
|
|
23714
|
+
return /* @__PURE__ */ jsxs26(Box25, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
23715
|
+
/* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, bold: true, children: `${headerPath}: lines ${start}\u2013${end2}` }),
|
|
23716
|
+
lines.map((ln, i) => /* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: ln }, `source-line-${i}`)),
|
|
23717
|
+
/* @__PURE__ */ jsx30(Text26, { children: "[s] close \xB7 [Esc] close" })
|
|
23905
23718
|
] });
|
|
23906
23719
|
})(),
|
|
23907
|
-
showHelp && /* @__PURE__ */
|
|
23908
|
-
/* @__PURE__ */
|
|
23909
|
-
/* @__PURE__ */
|
|
23910
|
-
/* @__PURE__ */
|
|
23911
|
-
/* @__PURE__ */
|
|
23912
|
-
/* @__PURE__ */
|
|
23913
|
-
/* @__PURE__ */
|
|
23914
|
-
/* @__PURE__ */
|
|
23915
|
-
/* @__PURE__ */
|
|
23916
|
-
/* @__PURE__ */
|
|
23917
|
-
/* @__PURE__ */
|
|
23918
|
-
/* @__PURE__ */
|
|
23919
|
-
/* @__PURE__ */
|
|
23920
|
-
/* @__PURE__ */
|
|
23921
|
-
/* @__PURE__ */
|
|
23922
|
-
/* @__PURE__ */
|
|
23923
|
-
/* @__PURE__ */
|
|
23924
|
-
/* @__PURE__ */
|
|
23925
|
-
/* @__PURE__ */
|
|
23926
|
-
/* @__PURE__ */
|
|
23927
|
-
/* @__PURE__ */
|
|
23928
|
-
/* @__PURE__ */
|
|
23929
|
-
/* @__PURE__ */
|
|
23930
|
-
/* @__PURE__ */
|
|
23931
|
-
/* @__PURE__ */
|
|
23932
|
-
/* @__PURE__ */
|
|
23933
|
-
/* @__PURE__ */
|
|
23720
|
+
showHelp && /* @__PURE__ */ jsxs26(Box25, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
|
|
23721
|
+
/* @__PURE__ */ jsx30(Text26, { bold: true, color: PALETTE.info, children: "Keybindings" }),
|
|
23722
|
+
/* @__PURE__ */ jsx30(Text26, { children: " " }),
|
|
23723
|
+
/* @__PURE__ */ jsx30(Text26, { bold: true, children: "Row navigation" }),
|
|
23724
|
+
/* @__PURE__ */ jsx30(Text26, { children: " \u2191/\u2193 move between rows" }),
|
|
23725
|
+
/* @__PURE__ */ jsx30(Text26, { children: " Enter edit fields on the current row" }),
|
|
23726
|
+
/* @__PURE__ */ jsx30(Text26, { children: " Esc exit the panel" }),
|
|
23727
|
+
/* @__PURE__ */ jsx30(Text26, { children: " " }),
|
|
23728
|
+
/* @__PURE__ */ jsx30(Text26, { bold: true, children: "Field editing" }),
|
|
23729
|
+
/* @__PURE__ */ jsx30(Text26, { children: " \u2191/\u2193/\u2190\u2192 cycle through fields" }),
|
|
23730
|
+
/* @__PURE__ */ jsx30(Text26, { children: " \u2190/\u2192 cycle picker values \xB7 move cursor in text inputs" }),
|
|
23731
|
+
/* @__PURE__ */ jsx30(Text26, { children: " Space/Enter toggle required" }),
|
|
23732
|
+
/* @__PURE__ */ jsx30(Text26, { children: " Type edit description / string default" }),
|
|
23733
|
+
/* @__PURE__ */ jsx30(Text26, { children: " Esc exit field-edit back to the row" }),
|
|
23734
|
+
/* @__PURE__ */ jsx30(Text26, { children: " " }),
|
|
23735
|
+
/* @__PURE__ */ jsx30(Text26, { bold: true, children: "Values / allowedComponents" }),
|
|
23736
|
+
/* @__PURE__ */ jsx30(Text26, { children: " a / e / r add \xB7 edit \xB7 remove" }),
|
|
23737
|
+
/* @__PURE__ */ jsx30(Text26, { children: " \u2191\u2193 navigate the list" }),
|
|
23738
|
+
/* @__PURE__ */ jsx30(Text26, { children: " K / J reorder up \xB7 down" }),
|
|
23739
|
+
/* @__PURE__ */ jsx30(Text26, { children: " " }),
|
|
23740
|
+
/* @__PURE__ */ jsx30(Text26, { bold: true, children: "Panels" }),
|
|
23741
|
+
/* @__PURE__ */ jsx30(Text26, { children: " s toggle source-view for the current prop" }),
|
|
23742
|
+
/* @__PURE__ */ jsx30(Text26, { children: " " + propRationaleKey.padEnd(16) + " toggle prop rationale panel" }),
|
|
23743
|
+
/* @__PURE__ */ jsx30(Text26, { children: " " + componentRationaleKey.padEnd(16) + " toggle component rationale panel" }),
|
|
23744
|
+
/* @__PURE__ */ jsx30(Text26, { children: " ? toggle this overlay" }),
|
|
23745
|
+
/* @__PURE__ */ jsx30(Text26, { children: " " }),
|
|
23746
|
+
/* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: "press ? or Esc to close" })
|
|
23934
23747
|
] }),
|
|
23935
|
-
validationError && /* @__PURE__ */
|
|
23936
|
-
/* @__PURE__ */
|
|
23748
|
+
validationError && /* @__PURE__ */ jsx30(Text26, { color: PALETTE.error, children: "\u2717 " + validationError }),
|
|
23749
|
+
/* @__PURE__ */ jsx30(Box25, { paddingTop: 1, children: /* @__PURE__ */ jsx30(Text26, { color: PALETTE.muted, children: modeLabel }) })
|
|
23937
23750
|
]
|
|
23938
23751
|
}
|
|
23939
23752
|
);
|
|
@@ -23989,23 +23802,23 @@ var init_wrap_text = __esm({
|
|
|
23989
23802
|
});
|
|
23990
23803
|
|
|
23991
23804
|
// packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/RationaleLine.tsx
|
|
23992
|
-
import { Box as
|
|
23993
|
-
import { jsx as
|
|
23805
|
+
import { Box as Box26, Text as Text27 } from "ink";
|
|
23806
|
+
import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
23994
23807
|
function RationaleLine({ line, active }) {
|
|
23995
23808
|
if (line.kind === "blank") {
|
|
23996
|
-
return /* @__PURE__ */
|
|
23809
|
+
return /* @__PURE__ */ jsx31(Box26, { children: /* @__PURE__ */ jsx31(Text27, { children: " " }) });
|
|
23997
23810
|
}
|
|
23998
23811
|
if (line.kind === "heading") {
|
|
23999
|
-
return /* @__PURE__ */
|
|
23812
|
+
return /* @__PURE__ */ jsx31(Box26, { children: /* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? PALETTE.info : PALETTE.muted, children: line.text }) });
|
|
24000
23813
|
}
|
|
24001
23814
|
if (line.kind === "label") {
|
|
24002
|
-
return /* @__PURE__ */
|
|
24003
|
-
line.prefix && /* @__PURE__ */
|
|
24004
|
-
/* @__PURE__ */
|
|
24005
|
-
line.suffix && /* @__PURE__ */
|
|
23815
|
+
return /* @__PURE__ */ jsxs27(Box26, { children: [
|
|
23816
|
+
line.prefix && /* @__PURE__ */ jsx31(Text27, { children: line.prefix }),
|
|
23817
|
+
/* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? line.color : PALETTE.muted, children: line.text }),
|
|
23818
|
+
line.suffix && /* @__PURE__ */ jsx31(Text27, { color: PALETTE.muted, children: line.suffix })
|
|
24006
23819
|
] });
|
|
24007
23820
|
}
|
|
24008
|
-
return /* @__PURE__ */
|
|
23821
|
+
return /* @__PURE__ */ jsx31(Box26, { children: /* @__PURE__ */ jsx31(Text27, { color: !active || line.dim ? PALETTE.muted : void 0, children: line.text }) });
|
|
24009
23822
|
}
|
|
24010
23823
|
var init_RationaleLine = __esm({
|
|
24011
23824
|
"packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/RationaleLine.tsx"() {
|
|
@@ -24015,8 +23828,8 @@ var init_RationaleLine = __esm({
|
|
|
24015
23828
|
});
|
|
24016
23829
|
|
|
24017
23830
|
// packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/ComponentRationalePanel.tsx
|
|
24018
|
-
import { Box as
|
|
24019
|
-
import { jsx as
|
|
23831
|
+
import { Box as Box27, Text as Text28 } from "ink";
|
|
23832
|
+
import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
24020
23833
|
function renderComponentRationaleLines(data, innerWidth) {
|
|
24021
23834
|
const out = [];
|
|
24022
23835
|
const pushSection = (heading, body) => {
|
|
@@ -24083,8 +23896,8 @@ function ComponentRationalePanel({
|
|
|
24083
23896
|
const overflowed = totalLines > contentHeight;
|
|
24084
23897
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
24085
23898
|
const visibleEnd = Math.min(totalLines, scrollOffset + contentHeight);
|
|
24086
|
-
return /* @__PURE__ */
|
|
24087
|
-
|
|
23899
|
+
return /* @__PURE__ */ jsxs28(
|
|
23900
|
+
Box27,
|
|
24088
23901
|
{
|
|
24089
23902
|
flexDirection: "column",
|
|
24090
23903
|
width,
|
|
@@ -24092,9 +23905,9 @@ function ComponentRationalePanel({
|
|
|
24092
23905
|
borderStyle: "single",
|
|
24093
23906
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
24094
23907
|
children: [
|
|
24095
|
-
/* @__PURE__ */
|
|
24096
|
-
visible.map((line, i) => /* @__PURE__ */
|
|
24097
|
-
/* @__PURE__ */
|
|
23908
|
+
/* @__PURE__ */ jsx32(Box27, { children: /* @__PURE__ */ jsx32(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, children: `Component rationale: ${data.name}` }) }),
|
|
23909
|
+
visible.map((line, i) => /* @__PURE__ */ jsx32(RationaleLine, { line, active }, i)),
|
|
23910
|
+
/* @__PURE__ */ jsx32(Box27, { children: overflowed ? /* @__PURE__ */ jsx32(Text28, { children: `${visibleStart}-${visibleEnd}/${totalLines} [\u2191\u2193] scroll [I/Esc] close` }) : /* @__PURE__ */ jsx32(Text28, { children: "[I/Esc] close" }) })
|
|
24098
23911
|
]
|
|
24099
23912
|
}
|
|
24100
23913
|
);
|
|
@@ -24111,10 +23924,10 @@ var init_ComponentRationalePanel = __esm({
|
|
|
24111
23924
|
});
|
|
24112
23925
|
|
|
24113
23926
|
// packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/HighlightedLine.tsx
|
|
24114
|
-
import { Text as
|
|
24115
|
-
import { Fragment as
|
|
23927
|
+
import { Text as Text29 } from "ink";
|
|
23928
|
+
import { Fragment as Fragment11, jsx as jsx33 } from "react/jsx-runtime";
|
|
24116
23929
|
function HighlightedLine({ parts }) {
|
|
24117
|
-
return /* @__PURE__ */
|
|
23930
|
+
return /* @__PURE__ */ jsx33(Fragment11, { children: parts.map((part, i) => /* @__PURE__ */ jsx33(Text29, { color: part.dim ? PALETTE.muted : part.color, children: part.text }, i)) });
|
|
24118
23931
|
}
|
|
24119
23932
|
var init_HighlightedLine = __esm({
|
|
24120
23933
|
"packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/HighlightedLine.tsx"() {
|
|
@@ -24124,8 +23937,8 @@ var init_HighlightedLine = __esm({
|
|
|
24124
23937
|
});
|
|
24125
23938
|
|
|
24126
23939
|
// packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/ScrollablePanel.tsx
|
|
24127
|
-
import { Box as
|
|
24128
|
-
import { Fragment as
|
|
23940
|
+
import { Box as Box28, Text as Text30 } from "ink";
|
|
23941
|
+
import { Fragment as Fragment12, jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
24129
23942
|
function ScrollablePanel({
|
|
24130
23943
|
title,
|
|
24131
23944
|
width,
|
|
@@ -24138,12 +23951,12 @@ function ScrollablePanel({
|
|
|
24138
23951
|
children
|
|
24139
23952
|
}) {
|
|
24140
23953
|
const overflowed = totalLines > height;
|
|
24141
|
-
return /* @__PURE__ */
|
|
24142
|
-
/* @__PURE__ */
|
|
24143
|
-
/* @__PURE__ */
|
|
24144
|
-
overflowed && /* @__PURE__ */
|
|
24145
|
-
/* @__PURE__ */
|
|
24146
|
-
/* @__PURE__ */
|
|
23954
|
+
return /* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
|
|
23955
|
+
/* @__PURE__ */ jsxs29(Box28, { children: [
|
|
23956
|
+
/* @__PURE__ */ jsx34(Text30, { bold: true, color: active ? void 0 : PALETTE.muted, children: title }),
|
|
23957
|
+
overflowed && /* @__PURE__ */ jsxs29(Fragment12, { children: [
|
|
23958
|
+
/* @__PURE__ */ jsx34(Box28, { flexGrow: 1 }),
|
|
23959
|
+
/* @__PURE__ */ jsx34(Text30, { color: active ? void 0 : PALETTE.muted, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
|
|
24147
23960
|
] })
|
|
24148
23961
|
] }),
|
|
24149
23962
|
children
|
|
@@ -24157,8 +23970,8 @@ var init_ScrollablePanel = __esm({
|
|
|
24157
23970
|
});
|
|
24158
23971
|
|
|
24159
23972
|
// packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/JsonPanel.tsx
|
|
24160
|
-
import { Box as
|
|
24161
|
-
import { jsx as
|
|
23973
|
+
import { Box as Box29 } from "ink";
|
|
23974
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
24162
23975
|
function highlightJson(line) {
|
|
24163
23976
|
const parts = [];
|
|
24164
23977
|
let remaining = line;
|
|
@@ -24196,7 +24009,7 @@ function highlightJson(line) {
|
|
|
24196
24009
|
parts.push({ text: remaining[0] });
|
|
24197
24010
|
remaining = remaining.slice(1);
|
|
24198
24011
|
}
|
|
24199
|
-
return /* @__PURE__ */
|
|
24012
|
+
return /* @__PURE__ */ jsx35(HighlightedLine, { parts });
|
|
24200
24013
|
}
|
|
24201
24014
|
function truncateLine(line, maxWidth) {
|
|
24202
24015
|
if (line.length <= maxWidth) return line;
|
|
@@ -24209,7 +24022,7 @@ function JsonPanel({ label, value, scrollOffset, width, height, active }) {
|
|
|
24209
24022
|
const totalLines = allLines.length;
|
|
24210
24023
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
24211
24024
|
const visibleEnd = Math.min(totalLines, scrollOffset + height);
|
|
24212
|
-
return /* @__PURE__ */
|
|
24025
|
+
return /* @__PURE__ */ jsx35(
|
|
24213
24026
|
ScrollablePanel,
|
|
24214
24027
|
{
|
|
24215
24028
|
title: label,
|
|
@@ -24222,7 +24035,7 @@ function JsonPanel({ label, value, scrollOffset, width, height, active }) {
|
|
|
24222
24035
|
borderColor: active ? "white" : void 0,
|
|
24223
24036
|
children: visibleLines.map((line, i) => {
|
|
24224
24037
|
const truncated = truncateLine(line, innerWidth);
|
|
24225
|
-
return /* @__PURE__ */
|
|
24038
|
+
return /* @__PURE__ */ jsx35(Box29, { children: highlightJson(truncated) }, i);
|
|
24226
24039
|
})
|
|
24227
24040
|
}
|
|
24228
24041
|
);
|
|
@@ -24236,7 +24049,7 @@ var init_JsonPanel = __esm({
|
|
|
24236
24049
|
});
|
|
24237
24050
|
|
|
24238
24051
|
// packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/RationalePanel.tsx
|
|
24239
|
-
import { jsx as
|
|
24052
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
24240
24053
|
function renderRationaleLines(rows, innerWidth) {
|
|
24241
24054
|
const out = [];
|
|
24242
24055
|
rows.forEach((row, idx) => {
|
|
@@ -24269,7 +24082,7 @@ function RationalePanel({
|
|
|
24269
24082
|
const visible = allLines.slice(scrollOffset, scrollOffset + height);
|
|
24270
24083
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
24271
24084
|
const visibleEnd = Math.min(totalLines, scrollOffset + height);
|
|
24272
|
-
return /* @__PURE__ */
|
|
24085
|
+
return /* @__PURE__ */ jsx36(
|
|
24273
24086
|
ScrollablePanel,
|
|
24274
24087
|
{
|
|
24275
24088
|
title: `RATIONALE \u2014 ${componentName}`,
|
|
@@ -24280,7 +24093,7 @@ function RationalePanel({
|
|
|
24280
24093
|
visibleStart,
|
|
24281
24094
|
visibleEnd,
|
|
24282
24095
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
24283
|
-
children: visible.map((line, i) => /* @__PURE__ */
|
|
24096
|
+
children: visible.map((line, i) => /* @__PURE__ */ jsx36(RationaleLine, { line, active }, i))
|
|
24284
24097
|
}
|
|
24285
24098
|
);
|
|
24286
24099
|
}
|
|
@@ -24296,8 +24109,8 @@ var init_RationalePanel = __esm({
|
|
|
24296
24109
|
|
|
24297
24110
|
// packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/TokenReviewPanel.tsx
|
|
24298
24111
|
import figures5 from "figures";
|
|
24299
|
-
import { Box as
|
|
24300
|
-
import { jsx as
|
|
24112
|
+
import { Box as Box30, Text as Text31 } from "ink";
|
|
24113
|
+
import { jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
24301
24114
|
function collectTokenSuggestions(entry, availableTokens = []) {
|
|
24302
24115
|
return Object.entries(entry.$properties).filter(([, def]) => {
|
|
24303
24116
|
const rawKind = def["$token.kind"];
|
|
@@ -24331,8 +24144,8 @@ function TokenReviewPanel({
|
|
|
24331
24144
|
const scrollStart = Math.max(0, Math.min(editCursor - Math.floor(visibleCount / 2), maxStart));
|
|
24332
24145
|
const visiblePaths = current.paths.slice(scrollStart, scrollStart + visibleCount);
|
|
24333
24146
|
const rangeLabel = current.paths.length === 0 ? "no compatible tokens" : `${scrollStart + 1}-${scrollStart + visiblePaths.length} of ${current.paths.length}`;
|
|
24334
|
-
return /* @__PURE__ */
|
|
24335
|
-
|
|
24147
|
+
return /* @__PURE__ */ jsxs30(
|
|
24148
|
+
Box30,
|
|
24336
24149
|
{
|
|
24337
24150
|
flexDirection: "column",
|
|
24338
24151
|
width,
|
|
@@ -24340,25 +24153,25 @@ function TokenReviewPanel({
|
|
|
24340
24153
|
borderStyle: "single",
|
|
24341
24154
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
24342
24155
|
children: [
|
|
24343
|
-
/* @__PURE__ */
|
|
24344
|
-
/* @__PURE__ */
|
|
24345
|
-
/* @__PURE__ */
|
|
24346
|
-
current.paths.length === 0 && /* @__PURE__ */
|
|
24156
|
+
/* @__PURE__ */ jsx37(Text31, { bold: true, color: active ? void 0 : PALETTE.muted, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
|
|
24157
|
+
/* @__PURE__ */ jsx37(Text31, { color: PALETTE.muted, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
|
|
24158
|
+
/* @__PURE__ */ jsx37(Text31, { children: " " }),
|
|
24159
|
+
current.paths.length === 0 && /* @__PURE__ */ jsx37(Text31, { color: PALETTE.muted, children: "(no compatible tokens found for this token kind)" }),
|
|
24347
24160
|
visiblePaths.map((path, i) => {
|
|
24348
24161
|
const pathIndex = scrollStart + i;
|
|
24349
24162
|
const checked = editSelection.has(path);
|
|
24350
24163
|
const focused = pathIndex === editCursor;
|
|
24351
|
-
return /* @__PURE__ */
|
|
24164
|
+
return /* @__PURE__ */ jsx37(Box30, { children: /* @__PURE__ */ jsx37(Text31, { color: focused ? PALETTE.info : active ? void 0 : PALETTE.muted, bold: focused, wrap: "truncate", children: ` [${checked ? "x" : " "}] ${path}` }) }, path);
|
|
24352
24165
|
}),
|
|
24353
|
-
/* @__PURE__ */
|
|
24354
|
-
/* @__PURE__ */
|
|
24355
|
-
/* @__PURE__ */
|
|
24166
|
+
/* @__PURE__ */ jsx37(Text31, { children: " " }),
|
|
24167
|
+
/* @__PURE__ */ jsx37(Text31, { color: PALETTE.muted, wrap: "truncate", children: "[\u2191/\u2193] move [Space] toggle" }),
|
|
24168
|
+
/* @__PURE__ */ jsx37(Text31, { color: PALETTE.muted, wrap: "truncate", children: "[Ctrl+S] save [Esc] cancel" })
|
|
24356
24169
|
]
|
|
24357
24170
|
}
|
|
24358
24171
|
);
|
|
24359
24172
|
}
|
|
24360
|
-
return /* @__PURE__ */
|
|
24361
|
-
|
|
24173
|
+
return /* @__PURE__ */ jsxs30(
|
|
24174
|
+
Box30,
|
|
24362
24175
|
{
|
|
24363
24176
|
flexDirection: "column",
|
|
24364
24177
|
width,
|
|
@@ -24366,18 +24179,18 @@ function TokenReviewPanel({
|
|
|
24366
24179
|
borderStyle: "single",
|
|
24367
24180
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
24368
24181
|
children: [
|
|
24369
|
-
/* @__PURE__ */
|
|
24370
|
-
suggestions.length === 0 && /* @__PURE__ */
|
|
24182
|
+
/* @__PURE__ */ jsx37(Text31, { bold: true, color: active ? void 0 : PALETTE.muted, children: `TOKEN REVIEW \u2014 ${componentName}` }),
|
|
24183
|
+
suggestions.length === 0 && /* @__PURE__ */ jsx37(Text31, { color: PALETTE.muted, children: "(no token suggestions for this component)" }),
|
|
24371
24184
|
suggestions.map((s, i) => {
|
|
24372
24185
|
const focused = i === selectedRow;
|
|
24373
|
-
return /* @__PURE__ */
|
|
24374
|
-
/* @__PURE__ */
|
|
24375
|
-
/* @__PURE__ */
|
|
24376
|
-
/* @__PURE__ */
|
|
24186
|
+
return /* @__PURE__ */ jsxs30(Box30, { flexDirection: "column", children: [
|
|
24187
|
+
/* @__PURE__ */ jsx37(Box30, { children: /* @__PURE__ */ jsx37(Text31, { color: focused ? PALETTE.info : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures5.pointer : " "} ${s.propName}` }) }),
|
|
24188
|
+
/* @__PURE__ */ jsx37(Text31, { color: PALETTE.muted, children: ` suggested: ${s.suggested.join(", ")}` }),
|
|
24189
|
+
/* @__PURE__ */ jsx37(Text31, { color: PALETTE.muted, children: ` allowed: ${s.allowed.join(", ")}` })
|
|
24377
24190
|
] }, s.propName);
|
|
24378
24191
|
}),
|
|
24379
|
-
/* @__PURE__ */
|
|
24380
|
-
/* @__PURE__ */
|
|
24192
|
+
/* @__PURE__ */ jsx37(Text31, { children: " " }),
|
|
24193
|
+
/* @__PURE__ */ jsx37(Text31, { children: "[\u2191/\u2193] move [Enter] edit allowed [Esc] close" })
|
|
24381
24194
|
]
|
|
24382
24195
|
}
|
|
24383
24196
|
);
|
|
@@ -24390,8 +24203,8 @@ var init_TokenReviewPanel = __esm({
|
|
|
24390
24203
|
});
|
|
24391
24204
|
|
|
24392
24205
|
// packages/experience-design-system-cli-legacy/src/import/tui/steps/review-details-panel.tsx
|
|
24393
|
-
import { Text as
|
|
24394
|
-
import { Fragment as
|
|
24206
|
+
import { Text as Text32 } from "ink";
|
|
24207
|
+
import { Fragment as Fragment13, jsx as jsx38, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
24395
24208
|
function ReviewDetailsPanel({
|
|
24396
24209
|
selectedKey,
|
|
24397
24210
|
panelOpen,
|
|
@@ -24426,7 +24239,7 @@ function ReviewDetailsPanel({
|
|
|
24426
24239
|
rationale: s.rationale ?? ""
|
|
24427
24240
|
}))
|
|
24428
24241
|
];
|
|
24429
|
-
return /* @__PURE__ */
|
|
24242
|
+
return /* @__PURE__ */ jsx38(
|
|
24430
24243
|
RationalePanel,
|
|
24431
24244
|
{
|
|
24432
24245
|
componentName: componentRationale?.name ?? selectedKey,
|
|
@@ -24439,7 +24252,7 @@ function ReviewDetailsPanel({
|
|
|
24439
24252
|
);
|
|
24440
24253
|
}
|
|
24441
24254
|
if (panelOpen === "component-rationale") {
|
|
24442
|
-
return /* @__PURE__ */
|
|
24255
|
+
return /* @__PURE__ */ jsx38(
|
|
24443
24256
|
ComponentRationalePanel,
|
|
24444
24257
|
{
|
|
24445
24258
|
data: componentRationale ?? {
|
|
@@ -24464,14 +24277,14 @@ function ReviewDetailsPanel({
|
|
|
24464
24277
|
const headerPath = path ?? "<unknown source path>";
|
|
24465
24278
|
const sourceLineCount = Math.max(1, height - 4);
|
|
24466
24279
|
const lines = source ? source.split("\n").slice(panelScrollOffset, panelScrollOffset + sourceLineCount) : [];
|
|
24467
|
-
return /* @__PURE__ */
|
|
24468
|
-
/* @__PURE__ */
|
|
24469
|
-
source ? lines.map((line, index) => /* @__PURE__ */
|
|
24470
|
-
/* @__PURE__ */
|
|
24280
|
+
return /* @__PURE__ */ jsxs31(FixedPanel, { width, height, borderStyle: "single", borderColor: sourceBorderColor, paddingLeft: 1, children: [
|
|
24281
|
+
/* @__PURE__ */ jsx38(Text32, { color: PALETTE.muted, bold: true, wrap: "truncate-end", children: `source: ${headerPath}` }),
|
|
24282
|
+
source ? lines.map((line, index) => /* @__PURE__ */ jsx38(Text32, { color: PALETTE.muted, wrap: "truncate-end", children: line }, `source-line-${index}`)) : /* @__PURE__ */ jsx38(Text32, { color: PALETTE.muted, children: "(no source captured)" }),
|
|
24283
|
+
/* @__PURE__ */ jsx38(Text32, { color: PALETTE.muted, wrap: "truncate-end", children: "[s/Esc] close" })
|
|
24471
24284
|
] });
|
|
24472
24285
|
}
|
|
24473
24286
|
if (panelOpen === "token-review") {
|
|
24474
|
-
return /* @__PURE__ */
|
|
24287
|
+
return /* @__PURE__ */ jsx38(
|
|
24475
24288
|
TokenReviewPanel,
|
|
24476
24289
|
{
|
|
24477
24290
|
componentName: selectedKey,
|
|
@@ -24487,7 +24300,7 @@ function ReviewDetailsPanel({
|
|
|
24487
24300
|
);
|
|
24488
24301
|
}
|
|
24489
24302
|
if (showJson) {
|
|
24490
|
-
return /* @__PURE__ */
|
|
24303
|
+
return /* @__PURE__ */ jsx38(
|
|
24491
24304
|
JsonPanel,
|
|
24492
24305
|
{
|
|
24493
24306
|
label: "GENERATED DEFINITION (read-only)",
|
|
@@ -24499,7 +24312,7 @@ function ReviewDetailsPanel({
|
|
|
24499
24312
|
}
|
|
24500
24313
|
);
|
|
24501
24314
|
}
|
|
24502
|
-
return /* @__PURE__ */
|
|
24315
|
+
return /* @__PURE__ */ jsx38(Fragment13, { children: editor });
|
|
24503
24316
|
}
|
|
24504
24317
|
var init_review_details_panel = __esm({
|
|
24505
24318
|
"packages/experience-design-system-cli-legacy/src/import/tui/steps/review-details-panel.tsx"() {
|
|
@@ -24514,7 +24327,7 @@ var init_review_details_panel = __esm({
|
|
|
24514
24327
|
});
|
|
24515
24328
|
|
|
24516
24329
|
// packages/experience-design-system-cli-legacy/src/import/tui/components/ReviewDetailsEditor.tsx
|
|
24517
|
-
import { jsx as
|
|
24330
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
24518
24331
|
import { createElement as createElement5 } from "react";
|
|
24519
24332
|
function toFieldEditorMetadata(reviewMetadata) {
|
|
24520
24333
|
if (!reviewMetadata) return void 0;
|
|
@@ -24548,7 +24361,7 @@ function ReviewDetailsEditor({
|
|
|
24548
24361
|
jsonScrollOffset,
|
|
24549
24362
|
currentTokenSuggestions
|
|
24550
24363
|
} = reviewEditor;
|
|
24551
|
-
return /* @__PURE__ */
|
|
24364
|
+
return /* @__PURE__ */ jsx39(
|
|
24552
24365
|
ReviewDetailsPanel,
|
|
24553
24366
|
{
|
|
24554
24367
|
selectedKey,
|
|
@@ -24595,8 +24408,8 @@ var init_ReviewDetailsEditor = __esm({
|
|
|
24595
24408
|
});
|
|
24596
24409
|
|
|
24597
24410
|
// packages/experience-design-system-cli-legacy/src/import/tui/components/ReviewComponentPanel.tsx
|
|
24598
|
-
import { Box as
|
|
24599
|
-
import { Fragment as
|
|
24411
|
+
import { Box as Box31, Text as Text33 } from "ink";
|
|
24412
|
+
import { Fragment as Fragment14, jsx as jsx40, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
24600
24413
|
function buildReviewFieldEditor(reviewEditor, selectedJson, onExit, overrides = {}) {
|
|
24601
24414
|
return {
|
|
24602
24415
|
value: reviewEditor.draftValue || selectedJson,
|
|
@@ -24636,17 +24449,17 @@ function ReviewEmptyComponentsWarning({
|
|
|
24636
24449
|
hidden
|
|
24637
24450
|
}) {
|
|
24638
24451
|
if (hidden || count === 0) return null;
|
|
24639
|
-
return /* @__PURE__ */
|
|
24452
|
+
return /* @__PURE__ */ jsx40(Text33, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
|
|
24640
24453
|
}
|
|
24641
24454
|
function ReviewNoSelection() {
|
|
24642
|
-
return /* @__PURE__ */
|
|
24455
|
+
return /* @__PURE__ */ jsx40(Box31, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx40(Text33, { color: PALETTE.muted, children: "No component selected" }) });
|
|
24643
24456
|
}
|
|
24644
24457
|
function ReviewFinalizeError({
|
|
24645
24458
|
message,
|
|
24646
24459
|
hidden
|
|
24647
24460
|
}) {
|
|
24648
24461
|
if (hidden || !message) return null;
|
|
24649
|
-
return /* @__PURE__ */
|
|
24462
|
+
return /* @__PURE__ */ jsx40(Text33, { color: PALETTE.error, children: `\u26A0 ${message}` });
|
|
24650
24463
|
}
|
|
24651
24464
|
function ReviewPanelFooter({
|
|
24652
24465
|
reviewEditor,
|
|
@@ -24655,10 +24468,10 @@ function ReviewPanelFooter({
|
|
|
24655
24468
|
livePreview,
|
|
24656
24469
|
livePreviewSpinner
|
|
24657
24470
|
}) {
|
|
24658
|
-
return /* @__PURE__ */
|
|
24471
|
+
return /* @__PURE__ */ jsxs32(Fragment14, { children: [
|
|
24659
24472
|
reviewEditor.panelOpen === "token-review" ? " [\u2191/\u2193] move [Enter] edit allowed [Esc] close" : sidebarFocused ? sidebarFooter : reviewEditor.showJson ? " [\u2191\u2193] scroll [Ctrl+u/d] half-page [gg/G] top/bottom [Tab] focus list" : " [Tab] focus list (edit fields)" + (reviewEditor.currentTokenSuggestions().length > 0 ? " [t] token review" : ""),
|
|
24660
|
-
livePreview.status === "running" && /* @__PURE__ */
|
|
24661
|
-
livePreview.disabled && /* @__PURE__ */
|
|
24473
|
+
livePreview.status === "running" && /* @__PURE__ */ jsx40(Text33, { children: ` ${livePreviewSpinner} live preview` }),
|
|
24474
|
+
livePreview.disabled && /* @__PURE__ */ jsx40(Text33, { children: " \xB7 live preview disabled" })
|
|
24662
24475
|
] });
|
|
24663
24476
|
}
|
|
24664
24477
|
function ReviewComponentTitle({
|
|
@@ -24667,10 +24480,10 @@ function ReviewComponentTitle({
|
|
|
24667
24480
|
slotCount,
|
|
24668
24481
|
sidebarFocused
|
|
24669
24482
|
}) {
|
|
24670
|
-
return /* @__PURE__ */
|
|
24671
|
-
/* @__PURE__ */
|
|
24672
|
-
/* @__PURE__ */
|
|
24673
|
-
/* @__PURE__ */
|
|
24483
|
+
return /* @__PURE__ */ jsxs32(Box31, { paddingLeft: 2, paddingBottom: 1, children: [
|
|
24484
|
+
/* @__PURE__ */ jsx40(Text33, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
24485
|
+
/* @__PURE__ */ jsx40(Box31, { flexGrow: 1 }),
|
|
24486
|
+
/* @__PURE__ */ jsxs32(Text33, { color: PALETTE.muted, wrap: "truncate-end", children: [
|
|
24674
24487
|
propCount,
|
|
24675
24488
|
" prop",
|
|
24676
24489
|
propCount !== 1 ? "s" : "",
|
|
@@ -24701,8 +24514,8 @@ function ReviewComponentPanel({
|
|
|
24701
24514
|
const slotCount = selectedEntry.$slots ? Object.keys(selectedEntry.$slots).length : 0;
|
|
24702
24515
|
const contentHeight = Math.max(1, height - 2);
|
|
24703
24516
|
const contentWidth = Math.max(1, width - 1);
|
|
24704
|
-
return /* @__PURE__ */
|
|
24705
|
-
/* @__PURE__ */
|
|
24517
|
+
return /* @__PURE__ */ jsx40(FixedPanel, { width, height, borderStyle: void 0, paddingLeft: 1, children: /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", width: contentWidth, height, flexShrink: 0, overflowY: "hidden", children: [
|
|
24518
|
+
/* @__PURE__ */ jsx40(Box31, { width: contentWidth, height: contentHeight, flexShrink: 0, overflowY: "hidden", children: /* @__PURE__ */ jsx40(
|
|
24706
24519
|
ReviewDetailsEditor,
|
|
24707
24520
|
{
|
|
24708
24521
|
selectedKey,
|
|
@@ -24715,7 +24528,7 @@ function ReviewComponentPanel({
|
|
|
24715
24528
|
jsonValue,
|
|
24716
24529
|
sidebarFocused,
|
|
24717
24530
|
fieldEditor,
|
|
24718
|
-
header: /* @__PURE__ */
|
|
24531
|
+
header: /* @__PURE__ */ jsx40(
|
|
24719
24532
|
ReviewComponentTitle,
|
|
24720
24533
|
{
|
|
24721
24534
|
selectedKey,
|
|
@@ -24726,8 +24539,8 @@ function ReviewComponentPanel({
|
|
|
24726
24539
|
)
|
|
24727
24540
|
}
|
|
24728
24541
|
) }),
|
|
24729
|
-
/* @__PURE__ */
|
|
24730
|
-
/* @__PURE__ */
|
|
24542
|
+
/* @__PURE__ */ jsx40(Box31, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx40(Text33, { color: saveError ? PALETTE.error : void 0, wrap: "truncate-end", children: saveError ? "\u2717 " + saveError : " " }) }),
|
|
24543
|
+
/* @__PURE__ */ jsx40(Box31, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx40(Text33, { color: PALETTE.muted, wrap: "truncate-end", children: /* @__PURE__ */ jsx40(
|
|
24731
24544
|
ReviewPanelFooter,
|
|
24732
24545
|
{
|
|
24733
24546
|
reviewEditor,
|
|
@@ -24750,8 +24563,8 @@ var init_ReviewComponentPanel = __esm({
|
|
|
24750
24563
|
});
|
|
24751
24564
|
|
|
24752
24565
|
// packages/experience-design-system-cli-legacy/src/import/tui/components/ReviewStatus.tsx
|
|
24753
|
-
import { Box as
|
|
24754
|
-
import { jsx as
|
|
24566
|
+
import { Box as Box32, Text as Text34 } from "ink";
|
|
24567
|
+
import { jsx as jsx41, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
24755
24568
|
function countReviewStatuses(entries) {
|
|
24756
24569
|
return entries.reduce(
|
|
24757
24570
|
(counts, entry) => {
|
|
@@ -24764,13 +24577,13 @@ function countReviewStatuses(entries) {
|
|
|
24764
24577
|
);
|
|
24765
24578
|
}
|
|
24766
24579
|
function ReviewLoadingState() {
|
|
24767
|
-
return /* @__PURE__ */
|
|
24580
|
+
return /* @__PURE__ */ jsx41(Box32, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx41(Text34, { color: PALETTE.muted, children: "Loading generated definitions..." }) });
|
|
24768
24581
|
}
|
|
24769
24582
|
function ReviewLoadError({ message }) {
|
|
24770
|
-
return /* @__PURE__ */
|
|
24771
|
-
/* @__PURE__ */
|
|
24772
|
-
/* @__PURE__ */
|
|
24773
|
-
/* @__PURE__ */
|
|
24583
|
+
return /* @__PURE__ */ jsxs33(Box32, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
24584
|
+
/* @__PURE__ */ jsx41(Text34, { color: PALETTE.error, children: message }),
|
|
24585
|
+
/* @__PURE__ */ jsx41(Text34, { children: " " }),
|
|
24586
|
+
/* @__PURE__ */ jsx41(Text34, { children: "[q / Enter / Esc] Quit" })
|
|
24774
24587
|
] });
|
|
24775
24588
|
}
|
|
24776
24589
|
var init_ReviewStatus = __esm({
|
|
@@ -24904,8 +24717,8 @@ var init_runLivePreview = __esm({
|
|
|
24904
24717
|
});
|
|
24905
24718
|
|
|
24906
24719
|
// packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/FinalizeDialog.tsx
|
|
24907
|
-
import { Box as
|
|
24908
|
-
import { Fragment as
|
|
24720
|
+
import { Box as Box33, Text as Text35 } from "ink";
|
|
24721
|
+
import { Fragment as Fragment15, jsx as jsx42, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
24909
24722
|
function FinalizeDialog({
|
|
24910
24723
|
accepted,
|
|
24911
24724
|
rejected,
|
|
@@ -24933,51 +24746,51 @@ function FinalizeDialog({
|
|
|
24933
24746
|
const windowed = removed.slice(offset, offset + FINALIZE_REMOVED_WINDOW);
|
|
24934
24747
|
const hasMoreBelow = offset + FINALIZE_REMOVED_WINDOW < removed.length;
|
|
24935
24748
|
const hasMoreAbove = offset > 0;
|
|
24936
|
-
return /* @__PURE__ */
|
|
24937
|
-
/* @__PURE__ */
|
|
24938
|
-
/* @__PURE__ */
|
|
24939
|
-
/* @__PURE__ */
|
|
24940
|
-
/* @__PURE__ */
|
|
24749
|
+
return /* @__PURE__ */ jsx42(Box33, { width: "100%", justifyContent: "center", children: /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", alignItems: "center", borderStyle: "round", padding: 1, width: 58, children: [
|
|
24750
|
+
/* @__PURE__ */ jsx42(Text35, { bold: true, children: "\u2500".repeat(22) + " Finalize " + "\u2500".repeat(22) }),
|
|
24751
|
+
/* @__PURE__ */ jsx42(Text35, { children: " " }),
|
|
24752
|
+
/* @__PURE__ */ jsxs34(Text35, { children: [
|
|
24753
|
+
/* @__PURE__ */ jsxs34(Text35, { color: PALETTE.success, children: [
|
|
24941
24754
|
accepted,
|
|
24942
24755
|
" accepted"
|
|
24943
24756
|
] }),
|
|
24944
|
-
/* @__PURE__ */
|
|
24945
|
-
/* @__PURE__ */
|
|
24757
|
+
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
24758
|
+
/* @__PURE__ */ jsxs34(Text35, { color: PALETTE.error, children: [
|
|
24946
24759
|
rejected,
|
|
24947
24760
|
" rejected"
|
|
24948
24761
|
] }),
|
|
24949
|
-
/* @__PURE__ */
|
|
24950
|
-
/* @__PURE__ */
|
|
24762
|
+
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
24763
|
+
/* @__PURE__ */ jsxs34(Text35, { color: PALETTE.muted, children: [
|
|
24951
24764
|
needsReview,
|
|
24952
24765
|
" unresolved"
|
|
24953
24766
|
] })
|
|
24954
24767
|
] }),
|
|
24955
|
-
/* @__PURE__ */
|
|
24956
|
-
noneAccepted && /* @__PURE__ */
|
|
24957
|
-
/* @__PURE__ */
|
|
24958
|
-
/* @__PURE__ */
|
|
24959
|
-
/* @__PURE__ */
|
|
24768
|
+
/* @__PURE__ */ jsx42(Text35, { children: " " }),
|
|
24769
|
+
noneAccepted && /* @__PURE__ */ jsxs34(Fragment15, { children: [
|
|
24770
|
+
/* @__PURE__ */ jsx42(Text35, { bold: true, color: PALETTE.warning, children: "\u26A0 No components are accepted \u2014 nothing will be pushed." }),
|
|
24771
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.warning, children: "Accept at least one component ([a] a row, [A] accept all) to push." }),
|
|
24772
|
+
/* @__PURE__ */ jsx42(Text35, { children: " " })
|
|
24960
24773
|
] }),
|
|
24961
|
-
!allResolved && /* @__PURE__ */
|
|
24962
|
-
/* @__PURE__ */
|
|
24963
|
-
/* @__PURE__ */
|
|
24964
|
-
/* @__PURE__ */
|
|
24774
|
+
!allResolved && /* @__PURE__ */ jsxs34(Fragment15, { children: [
|
|
24775
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.warning, children: "\u26A0 " + needsReview + " unresolved component" + (needsReview === 1 ? "" : "s") + " will not be pushed." }),
|
|
24776
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.warning, children: "Only explicitly accepted components ship." }),
|
|
24777
|
+
/* @__PURE__ */ jsx42(Text35, { children: " " })
|
|
24965
24778
|
] }),
|
|
24966
|
-
/* @__PURE__ */
|
|
24967
|
-
previewStatus === "running" ? /* @__PURE__ */
|
|
24968
|
-
/* @__PURE__ */
|
|
24779
|
+
/* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", height: 2, children: [
|
|
24780
|
+
previewStatus === "running" ? /* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: "Previewing deletions against the target space\u2026" }) : previewStatus === "error" ? /* @__PURE__ */ jsx42(Text35, { color: PALETTE.warning, children: "\u26A0 Could not preview deletions (the push will still proceed)." }) : /* @__PURE__ */ jsx42(Text35, { children: " " }),
|
|
24781
|
+
/* @__PURE__ */ jsx42(Text35, { children: " " })
|
|
24969
24782
|
] }),
|
|
24970
|
-
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */
|
|
24971
|
-
/* @__PURE__ */
|
|
24972
|
-
hasMoreAbove && /* @__PURE__ */
|
|
24973
|
-
windowed.map((rc) => /* @__PURE__ */
|
|
24974
|
-
hasMoreBelow && /* @__PURE__ */
|
|
24975
|
-
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */
|
|
24976
|
-
/* @__PURE__ */
|
|
24783
|
+
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs34(Fragment15, { children: [
|
|
24784
|
+
/* @__PURE__ */ jsx42(Text35, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removed.length, false) }),
|
|
24785
|
+
hasMoreAbove && /* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: "\u2191 more above" }),
|
|
24786
|
+
windowed.map((rc) => /* @__PURE__ */ jsx42(Text35, { color: PALETTE.error, children: removedComponentLine(rc) }, rc.id)),
|
|
24787
|
+
hasMoreBelow && /* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: "\u2193 more below" }),
|
|
24788
|
+
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */ jsx42(Text35, { children: "[\u2191\u2193] scroll deletions" }),
|
|
24789
|
+
/* @__PURE__ */ jsx42(Text35, { children: " " })
|
|
24977
24790
|
] }),
|
|
24978
|
-
/* @__PURE__ */
|
|
24979
|
-
/* @__PURE__ */
|
|
24980
|
-
/* @__PURE__ */
|
|
24791
|
+
/* @__PURE__ */ jsx42(Text35, { children: noneAccepted ? "Confirm exit with nothing accepted?" : allResolved ? "Save decisions and exit? All components resolved." : "Save decisions and exit?" }),
|
|
24792
|
+
/* @__PURE__ */ jsx42(Text35, { children: " " }),
|
|
24793
|
+
/* @__PURE__ */ jsx42(Text35, { children: "[y / Enter] Confirm [n / Esc] Cancel" })
|
|
24981
24794
|
] }) });
|
|
24982
24795
|
}
|
|
24983
24796
|
var FINALIZE_REMOVED_WINDOW;
|
|
@@ -24992,7 +24805,7 @@ var init_FinalizeDialog = __esm({
|
|
|
24992
24805
|
});
|
|
24993
24806
|
|
|
24994
24807
|
// packages/experience-design-system-cli-legacy/src/import/tui/useFinalizePreview.ts
|
|
24995
|
-
import { useEffect as useEffect8, useRef as
|
|
24808
|
+
import { useEffect as useEffect8, useRef as useRef4, useState as useState12 } from "react";
|
|
24996
24809
|
function useReviewFinalizePreview({
|
|
24997
24810
|
components,
|
|
24998
24811
|
...options
|
|
@@ -25004,10 +24817,10 @@ function useReviewFinalizePreview({
|
|
|
25004
24817
|
}
|
|
25005
24818
|
function useFinalizePreview(opts) {
|
|
25006
24819
|
const { open, extractSessionId, tokensPath, spaceId, environmentId, cmaToken, host, acceptedKeys } = opts;
|
|
25007
|
-
const [status, setStatus] =
|
|
25008
|
-
const [removed, setRemoved] =
|
|
25009
|
-
const [scrollOffset, setScrollOffset] =
|
|
25010
|
-
const generationRef =
|
|
24820
|
+
const [status, setStatus] = useState12("idle");
|
|
24821
|
+
const [removed, setRemoved] = useState12([]);
|
|
24822
|
+
const [scrollOffset, setScrollOffset] = useState12(0);
|
|
24823
|
+
const generationRef = useRef4(0);
|
|
25011
24824
|
const acceptedKey = [...acceptedKeys].sort().join("\0");
|
|
25012
24825
|
useEffect8(() => {
|
|
25013
24826
|
if (!open) {
|
|
@@ -25061,7 +24874,7 @@ var init_useFinalizePreview = __esm({
|
|
|
25061
24874
|
});
|
|
25062
24875
|
|
|
25063
24876
|
// packages/experience-design-system-cli-legacy/src/import/tui/hooks/useReviewSession.ts
|
|
25064
|
-
import { useCallback as useCallback4, useEffect as useEffect9, useRef as
|
|
24877
|
+
import { useCallback as useCallback4, useEffect as useEffect9, useRef as useRef5, useState as useState13 } from "react";
|
|
25065
24878
|
function loadReviewSessionState({
|
|
25066
24879
|
extractSessionId,
|
|
25067
24880
|
tokenSessionId,
|
|
@@ -25107,10 +24920,10 @@ function useReviewSession({
|
|
|
25107
24920
|
tokensPath,
|
|
25108
24921
|
onExtraLoaded
|
|
25109
24922
|
}) {
|
|
25110
|
-
const [components, setComponents] =
|
|
25111
|
-
const [loading, setLoading] =
|
|
25112
|
-
const [loadError, setLoadError] =
|
|
25113
|
-
const [availableTokens, setAvailableTokens] =
|
|
24923
|
+
const [components, setComponents] = useState13([]);
|
|
24924
|
+
const [loading, setLoading] = useState13(true);
|
|
24925
|
+
const [loadError, setLoadError] = useState13(null);
|
|
24926
|
+
const [availableTokens, setAvailableTokens] = useState13([]);
|
|
25114
24927
|
const loadInitialState = useCallback4(async () => {
|
|
25115
24928
|
const result = loadSession();
|
|
25116
24929
|
if (result.error || !tokensPath) return { result, catalog: result.tokens };
|
|
@@ -25171,8 +24984,8 @@ function useReviewSession({
|
|
|
25171
24984
|
};
|
|
25172
24985
|
}
|
|
25173
24986
|
function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
|
|
25174
|
-
const [reviewMetadata, setReviewMetadata] =
|
|
25175
|
-
const [componentRationale, setComponentRationale] =
|
|
24987
|
+
const [reviewMetadata, setReviewMetadata] = useState13(null);
|
|
24988
|
+
const [componentRationale, setComponentRationale] = useState13(null);
|
|
25176
24989
|
useEffect9(() => {
|
|
25177
24990
|
const current = components[selectedIdx];
|
|
25178
24991
|
if (!current) {
|
|
@@ -25214,8 +25027,8 @@ function createReviewHistorySnapshot(components, options = {}) {
|
|
|
25214
25027
|
};
|
|
25215
25028
|
}
|
|
25216
25029
|
function useReviewHistory({ loading, components, createSnapshot, applySnapshot }) {
|
|
25217
|
-
const historyRef =
|
|
25218
|
-
const historySeededRef =
|
|
25030
|
+
const historyRef = useRef5(null);
|
|
25031
|
+
const historySeededRef = useRef5(false);
|
|
25219
25032
|
useEffect9(() => {
|
|
25220
25033
|
if (loading || historySeededRef.current) return;
|
|
25221
25034
|
historySeededRef.current = true;
|
|
@@ -25305,7 +25118,7 @@ var init_useReviewSession = __esm({
|
|
|
25305
25118
|
});
|
|
25306
25119
|
|
|
25307
25120
|
// packages/experience-design-system-cli-legacy/src/import/tui/hooks/useReviewEditor.ts
|
|
25308
|
-
import { useEffect as useEffect10, useRef as
|
|
25121
|
+
import { useEffect as useEffect10, useRef as useRef6, useState as useState14 } from "react";
|
|
25309
25122
|
function parseReviewEntry(draftValue) {
|
|
25310
25123
|
const parsed = JSON.parse(draftValue);
|
|
25311
25124
|
const keys = Object.keys(parsed);
|
|
@@ -25325,20 +25138,20 @@ function useReviewEditor({
|
|
|
25325
25138
|
onEditSaved,
|
|
25326
25139
|
onTokenSaved
|
|
25327
25140
|
}) {
|
|
25328
|
-
const [panelOpen, setPanelOpen] =
|
|
25329
|
-
const [panelScrollOffset, setPanelScrollOffset] =
|
|
25330
|
-
const [jsonScrollOffset, setJsonScrollOffset] =
|
|
25331
|
-
const [textEntryActive, setTextEntryActive] =
|
|
25332
|
-
const [showJson, setShowJson] =
|
|
25333
|
-
const [showHiddenProps, setShowHiddenProps] =
|
|
25334
|
-
const [draftValue, setDraftValue] =
|
|
25335
|
-
const [saveError, setSaveError] =
|
|
25336
|
-
const [tokenReviewRow, setTokenReviewRow] =
|
|
25337
|
-
const [tokenReviewEditing, setTokenReviewEditing] =
|
|
25338
|
-
const [tokenReviewEditCursor, setTokenReviewEditCursor] =
|
|
25339
|
-
const [tokenReviewEditSelection, setTokenReviewEditSelection] =
|
|
25340
|
-
const tokenReviewSuggestedRef =
|
|
25341
|
-
const pendingGRef =
|
|
25141
|
+
const [panelOpen, setPanelOpen] = useState14("none");
|
|
25142
|
+
const [panelScrollOffset, setPanelScrollOffset] = useState14(0);
|
|
25143
|
+
const [jsonScrollOffset, setJsonScrollOffset] = useState14(0);
|
|
25144
|
+
const [textEntryActive, setTextEntryActive] = useState14(false);
|
|
25145
|
+
const [showJson, setShowJson] = useState14(false);
|
|
25146
|
+
const [showHiddenProps, setShowHiddenProps] = useState14(false);
|
|
25147
|
+
const [draftValue, setDraftValue] = useState14("");
|
|
25148
|
+
const [saveError, setSaveError] = useState14(null);
|
|
25149
|
+
const [tokenReviewRow, setTokenReviewRow] = useState14(0);
|
|
25150
|
+
const [tokenReviewEditing, setTokenReviewEditing] = useState14(false);
|
|
25151
|
+
const [tokenReviewEditCursor, setTokenReviewEditCursor] = useState14(0);
|
|
25152
|
+
const [tokenReviewEditSelection, setTokenReviewEditSelection] = useState14(/* @__PURE__ */ new Set());
|
|
25153
|
+
const tokenReviewSuggestedRef = useRef6(/* @__PURE__ */ new Map());
|
|
25154
|
+
const pendingGRef = useRef6(false);
|
|
25342
25155
|
useEffect10(() => {
|
|
25343
25156
|
setTokenReviewRow(0);
|
|
25344
25157
|
setTokenReviewEditing(false);
|
|
@@ -25459,12 +25272,12 @@ var init_useReviewEditor = __esm({
|
|
|
25459
25272
|
});
|
|
25460
25273
|
|
|
25461
25274
|
// packages/experience-design-system-cli-legacy/src/import/tui/hooks/useReviewSurfaceState.ts
|
|
25462
|
-
import { useState as
|
|
25275
|
+
import { useState as useState15 } from "react";
|
|
25463
25276
|
function useReviewSurfaceState(initialFinalizeError = null) {
|
|
25464
|
-
const [sidebarFocused, setSidebarFocused] =
|
|
25465
|
-
const [showFinalize, setShowFinalize] =
|
|
25466
|
-
const [showQuit, setShowQuit] =
|
|
25467
|
-
const [finalizeError, setFinalizeError] =
|
|
25277
|
+
const [sidebarFocused, setSidebarFocused] = useState15(true);
|
|
25278
|
+
const [showFinalize, setShowFinalize] = useState15(false);
|
|
25279
|
+
const [showQuit, setShowQuit] = useState15(false);
|
|
25280
|
+
const [finalizeError, setFinalizeError] = useState15(initialFinalizeError);
|
|
25468
25281
|
return {
|
|
25469
25282
|
sidebarFocused,
|
|
25470
25283
|
setSidebarFocused,
|
|
@@ -25483,8 +25296,8 @@ var init_useReviewSurfaceState = __esm({
|
|
|
25483
25296
|
});
|
|
25484
25297
|
|
|
25485
25298
|
// packages/experience-design-system-cli-legacy/src/analyze/select/tui/components/QuitDialog.tsx
|
|
25486
|
-
import { Box as
|
|
25487
|
-
import { Fragment as
|
|
25299
|
+
import { Box as Box34, Text as Text36 } from "ink";
|
|
25300
|
+
import { Fragment as Fragment16, jsx as jsx43, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
25488
25301
|
function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
25489
25302
|
useImmediateInput((input, key) => {
|
|
25490
25303
|
if (input === "y" || key.return) {
|
|
@@ -25493,16 +25306,16 @@ function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
|
25493
25306
|
onCancel();
|
|
25494
25307
|
}
|
|
25495
25308
|
});
|
|
25496
|
-
return /* @__PURE__ */
|
|
25497
|
-
/* @__PURE__ */
|
|
25498
|
-
/* @__PURE__ */
|
|
25499
|
-
hasUnsavedDrafts ? /* @__PURE__ */
|
|
25500
|
-
/* @__PURE__ */
|
|
25501
|
-
/* @__PURE__ */
|
|
25502
|
-
/* @__PURE__ */
|
|
25503
|
-
] }) : /* @__PURE__ */
|
|
25504
|
-
/* @__PURE__ */
|
|
25505
|
-
/* @__PURE__ */
|
|
25309
|
+
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", padding: 1, width: 50, children: [
|
|
25310
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, children: "\u2500".repeat(19) + " Quit " + "\u2500".repeat(19) }),
|
|
25311
|
+
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
25312
|
+
hasUnsavedDrafts ? /* @__PURE__ */ jsxs35(Fragment16, { children: [
|
|
25313
|
+
/* @__PURE__ */ jsx43(Text36, { children: "You have unsaved draft edits." }),
|
|
25314
|
+
/* @__PURE__ */ jsx43(Text36, { children: "Session state is preserved \u2014 you can resume" }),
|
|
25315
|
+
/* @__PURE__ */ jsx43(Text36, { children: "by running the same review command again." })
|
|
25316
|
+
] }) : /* @__PURE__ */ jsx43(Text36, { children: "Session is saved. Quit without finalizing?" }),
|
|
25317
|
+
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
25318
|
+
/* @__PURE__ */ jsx43(Text36, { children: " [y / Enter] Quit [n / Esc] Stay" })
|
|
25506
25319
|
] });
|
|
25507
25320
|
}
|
|
25508
25321
|
var init_QuitDialog = __esm({
|
|
@@ -25513,8 +25326,8 @@ var init_QuitDialog = __esm({
|
|
|
25513
25326
|
});
|
|
25514
25327
|
|
|
25515
25328
|
// packages/experience-design-system-cli-legacy/src/import/tui/components/ReviewDialogs.tsx
|
|
25516
|
-
import { Box as
|
|
25517
|
-
import { Fragment as
|
|
25329
|
+
import { Box as Box35, Text as Text37 } from "ink";
|
|
25330
|
+
import { Fragment as Fragment17, jsx as jsx44, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
25518
25331
|
function ReviewFinalizeDialogs({
|
|
25519
25332
|
showFinalize,
|
|
25520
25333
|
showQuit,
|
|
@@ -25528,8 +25341,8 @@ function ReviewFinalizeDialogs({
|
|
|
25528
25341
|
onQuitCancel
|
|
25529
25342
|
}) {
|
|
25530
25343
|
const { accepted, rejected, needsReview } = countReviewStatuses(components);
|
|
25531
|
-
return /* @__PURE__ */
|
|
25532
|
-
showFinalize && /* @__PURE__ */
|
|
25344
|
+
return /* @__PURE__ */ jsxs36(Fragment17, { children: [
|
|
25345
|
+
showFinalize && /* @__PURE__ */ jsx44(
|
|
25533
25346
|
FinalizeDialog,
|
|
25534
25347
|
{
|
|
25535
25348
|
accepted,
|
|
@@ -25542,7 +25355,7 @@ function ReviewFinalizeDialogs({
|
|
|
25542
25355
|
onCancel: onFinalizeCancel
|
|
25543
25356
|
}
|
|
25544
25357
|
),
|
|
25545
|
-
showQuit && /* @__PURE__ */
|
|
25358
|
+
showQuit && /* @__PURE__ */ jsx44(QuitDialog, { hasUnsavedDrafts: false, onConfirm: onQuitConfirm, onCancel: onQuitCancel })
|
|
25546
25359
|
] });
|
|
25547
25360
|
}
|
|
25548
25361
|
function ReviewStepDialogs({
|
|
@@ -25552,7 +25365,7 @@ function ReviewStepDialogs({
|
|
|
25552
25365
|
onFinalize,
|
|
25553
25366
|
onQuit
|
|
25554
25367
|
}) {
|
|
25555
|
-
return /* @__PURE__ */
|
|
25368
|
+
return /* @__PURE__ */ jsx44(
|
|
25556
25369
|
ReviewFinalizeDialogs,
|
|
25557
25370
|
{
|
|
25558
25371
|
showFinalize: surfaceState.showFinalize,
|
|
@@ -25570,12 +25383,12 @@ function ReviewStepDialogs({
|
|
|
25570
25383
|
}
|
|
25571
25384
|
function ReviewReloadDialog({ open }) {
|
|
25572
25385
|
if (!open) return null;
|
|
25573
|
-
return /* @__PURE__ */
|
|
25574
|
-
/* @__PURE__ */
|
|
25575
|
-
/* @__PURE__ */
|
|
25576
|
-
/* @__PURE__ */
|
|
25577
|
-
/* @__PURE__ */
|
|
25578
|
-
/* @__PURE__ */
|
|
25386
|
+
return /* @__PURE__ */ jsxs36(Box35, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
25387
|
+
/* @__PURE__ */ jsx44(Text37, { bold: true, color: PALETTE.warning, children: "Reload from saved state?" }),
|
|
25388
|
+
/* @__PURE__ */ jsx44(Text37, { children: "Unsaved in-memory changes will be lost." }),
|
|
25389
|
+
/* @__PURE__ */ jsx44(Text37, { children: " " }),
|
|
25390
|
+
/* @__PURE__ */ jsx44(Text37, { children: " [Enter] Confirm" }),
|
|
25391
|
+
/* @__PURE__ */ jsx44(Text37, { children: " [Esc] Cancel" })
|
|
25579
25392
|
] });
|
|
25580
25393
|
}
|
|
25581
25394
|
var init_ReviewDialogs = __esm({
|
|
@@ -25812,20 +25625,20 @@ var init_preview_annotations = __esm({
|
|
|
25812
25625
|
});
|
|
25813
25626
|
|
|
25814
25627
|
// packages/experience-design-system-cli-legacy/src/import/tui/useLivePreview.ts
|
|
25815
|
-
import { useCallback as useCallback5, useEffect as useEffect11, useRef as
|
|
25628
|
+
import { useCallback as useCallback5, useEffect as useEffect11, useRef as useRef7, useState as useState16 } from "react";
|
|
25816
25629
|
function useLivePreview(opts) {
|
|
25817
25630
|
const debounceMs = opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
25818
|
-
const [status, setStatus] =
|
|
25819
|
-
const [disabled, setDisabled] =
|
|
25820
|
-
const timerRef =
|
|
25821
|
-
const generationRef =
|
|
25822
|
-
const latestRef =
|
|
25823
|
-
const inflightRef =
|
|
25824
|
-
const optsRef =
|
|
25631
|
+
const [status, setStatus] = useState16("idle");
|
|
25632
|
+
const [disabled, setDisabled] = useState16(false);
|
|
25633
|
+
const timerRef = useRef7(null);
|
|
25634
|
+
const generationRef = useRef7(0);
|
|
25635
|
+
const latestRef = useRef7(0);
|
|
25636
|
+
const inflightRef = useRef7(0);
|
|
25637
|
+
const optsRef = useRef7(opts);
|
|
25825
25638
|
useEffect11(() => {
|
|
25826
25639
|
optsRef.current = opts;
|
|
25827
25640
|
});
|
|
25828
|
-
const disabledRef =
|
|
25641
|
+
const disabledRef = useRef7(disabled);
|
|
25829
25642
|
useEffect11(() => {
|
|
25830
25643
|
disabledRef.current = disabled;
|
|
25831
25644
|
}, [disabled]);
|
|
@@ -25910,7 +25723,7 @@ var init_useLivePreview = __esm({
|
|
|
25910
25723
|
});
|
|
25911
25724
|
|
|
25912
25725
|
// packages/experience-design-system-cli-legacy/src/import/tui/hooks/useReviewPreview.ts
|
|
25913
|
-
import { useCallback as useCallback6, useEffect as useEffect12, useState as
|
|
25726
|
+
import { useCallback as useCallback6, useEffect as useEffect12, useState as useState17 } from "react";
|
|
25914
25727
|
function useReviewPreview({
|
|
25915
25728
|
components,
|
|
25916
25729
|
loading,
|
|
@@ -25924,8 +25737,8 @@ function useReviewPreview({
|
|
|
25924
25737
|
deleteAllComponents,
|
|
25925
25738
|
onResult
|
|
25926
25739
|
}) {
|
|
25927
|
-
const [previewAnnotations, setPreviewAnnotations] =
|
|
25928
|
-
const [removedComponents, setRemovedComponents] =
|
|
25740
|
+
const [previewAnnotations, setPreviewAnnotations] = useState17(/* @__PURE__ */ new Map());
|
|
25741
|
+
const [removedComponents, setRemovedComponents] = useState17([]);
|
|
25929
25742
|
const handleResult = useCallback6(
|
|
25930
25743
|
(response) => {
|
|
25931
25744
|
if (!response) return;
|
|
@@ -25951,7 +25764,7 @@ function useReviewPreview({
|
|
|
25951
25764
|
onResult: handleResult,
|
|
25952
25765
|
deleteAllComponents
|
|
25953
25766
|
});
|
|
25954
|
-
const [spinnerTick, setSpinnerTick] =
|
|
25767
|
+
const [spinnerTick, setSpinnerTick] = useState17(0);
|
|
25955
25768
|
useEffect12(() => {
|
|
25956
25769
|
if (livePreviewHook.status !== "running") return;
|
|
25957
25770
|
const id = setInterval(() => setSpinnerTick((tick2) => tick2 + 1), 80);
|
|
@@ -25977,8 +25790,8 @@ var init_useReviewPreview = __esm({
|
|
|
25977
25790
|
});
|
|
25978
25791
|
|
|
25979
25792
|
// packages/experience-design-system-cli-legacy/src/import/tui/components/LivePreviewSummary.tsx
|
|
25980
|
-
import { Box as
|
|
25981
|
-
import { jsx as
|
|
25793
|
+
import { Box as Box36, Text as Text38 } from "ink";
|
|
25794
|
+
import { jsx as jsx45, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
25982
25795
|
function LivePreviewSummary({
|
|
25983
25796
|
enabled,
|
|
25984
25797
|
previewAnnotations,
|
|
@@ -25992,19 +25805,19 @@ function LivePreviewSummary({
|
|
|
25992
25805
|
const counts = { new: 0, changed: 0, removed: 0, breaking: 0 };
|
|
25993
25806
|
for (const annotation of previewAnnotations.values()) counts[annotation] += 1;
|
|
25994
25807
|
const hasCounts = counts.new + counts.changed + counts.removed + counts.breaking > 0;
|
|
25995
|
-
if (disabled) return /* @__PURE__ */
|
|
25996
|
-
if (status === "running" && !hasCounts) return /* @__PURE__ */
|
|
25808
|
+
if (disabled) return /* @__PURE__ */ jsx45(Text38, { color: PALETTE.muted, children: "Preview: disabled (creds rejected)" });
|
|
25809
|
+
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx45(Text38, { color: PALETTE.muted, children: `Preview: ${spinner} running...` });
|
|
25997
25810
|
if (!hasCounts) return null;
|
|
25998
|
-
return /* @__PURE__ */
|
|
25999
|
-
/* @__PURE__ */
|
|
26000
|
-
/* @__PURE__ */
|
|
26001
|
-
/* @__PURE__ */
|
|
26002
|
-
/* @__PURE__ */
|
|
26003
|
-
/* @__PURE__ */
|
|
26004
|
-
/* @__PURE__ */
|
|
26005
|
-
showRemovedListHint && removedCount > 0 && /* @__PURE__ */
|
|
26006
|
-
/* @__PURE__ */
|
|
26007
|
-
/* @__PURE__ */
|
|
25811
|
+
return /* @__PURE__ */ jsxs37(Box36, { children: [
|
|
25812
|
+
/* @__PURE__ */ jsx45(Text38, { children: "Preview: " }),
|
|
25813
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE.success, children: `${counts.new} new` }),
|
|
25814
|
+
/* @__PURE__ */ jsx45(Text38, { children: " \xB7 " }),
|
|
25815
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE.warning, children: `${counts.changed} changed` }),
|
|
25816
|
+
/* @__PURE__ */ jsx45(Text38, { children: " \xB7 " }),
|
|
25817
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE.muted, children: `${counts.removed} removed` }),
|
|
25818
|
+
showRemovedListHint && removedCount > 0 && /* @__PURE__ */ jsx45(Text38, { children: " ([d] removed list)" }),
|
|
25819
|
+
/* @__PURE__ */ jsx45(Text38, { children: " \xB7 " }),
|
|
25820
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE.error, bold: true, children: `${counts.breaking} breaking` })
|
|
26008
25821
|
] });
|
|
26009
25822
|
}
|
|
26010
25823
|
var init_LivePreviewSummary = __esm({
|
|
@@ -26015,10 +25828,10 @@ var init_LivePreviewSummary = __esm({
|
|
|
26015
25828
|
});
|
|
26016
25829
|
|
|
26017
25830
|
// packages/experience-design-system-cli-legacy/src/import/tui/steps/GenerateReviewStep.tsx
|
|
26018
|
-
import { useCallback as useCallback7, useEffect as useEffect13, useMemo as useMemo3, useRef as
|
|
25831
|
+
import { useCallback as useCallback7, useEffect as useEffect13, useMemo as useMemo3, useRef as useRef8, useState as useState18 } from "react";
|
|
26019
25832
|
import figures6 from "figures";
|
|
26020
|
-
import { Box as
|
|
26021
|
-
import { Fragment as
|
|
25833
|
+
import { Box as Box37, Text as Text39 } from "ink";
|
|
25834
|
+
import { Fragment as Fragment18, jsx as jsx46, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
26022
25835
|
function sortComponentsForSidebar(components, cycleParticipants) {
|
|
26023
25836
|
const isEmpty2 = (entry) => Object.keys(entry.$properties ?? {}).length === 0 && Object.keys(entry.$slots ?? {}).length === 0;
|
|
26024
25837
|
const tier = (c2) => {
|
|
@@ -26059,10 +25872,10 @@ function CyclePathLine({
|
|
|
26059
25872
|
highlightComponents = false,
|
|
26060
25873
|
highlightLine = false
|
|
26061
25874
|
}) {
|
|
26062
|
-
return /* @__PURE__ */
|
|
25875
|
+
return /* @__PURE__ */ jsxs38(Text39, { color: highlightLine ? PALETTE.warning : void 0, children: [
|
|
26063
25876
|
prefix,
|
|
26064
25877
|
segments.map(
|
|
26065
|
-
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */
|
|
25878
|
+
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx46(Text39, { color: PALETTE.info, children: segment.text }, index) : segment.kind === "arrow" ? /* @__PURE__ */ jsx46(Text39, { color: PALETTE.muted, children: segment.text }, index) : /* @__PURE__ */ jsx46(Text39, { color: highlightComponents ? PALETTE.warning : void 0, children: segment.text }, index)
|
|
26066
25879
|
)
|
|
26067
25880
|
] });
|
|
26068
25881
|
}
|
|
@@ -26074,31 +25887,31 @@ function CycleDetailPanel({
|
|
|
26074
25887
|
height
|
|
26075
25888
|
}) {
|
|
26076
25889
|
const lines = [
|
|
26077
|
-
/* @__PURE__ */
|
|
26078
|
-
/* @__PURE__ */
|
|
26079
|
-
/* @__PURE__ */
|
|
26080
|
-
/* @__PURE__ */
|
|
25890
|
+
/* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE.warning, children: `SLOT DEPENDENCY CYCLES (${cycles.length})` }, "cyc-title"),
|
|
25891
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE.muted, children: "push will fail until these are resolved" }, "cyc-sub"),
|
|
25892
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE.muted, children: "Reject a cycle member or remove a slot edge to break the cycle." }, "cyc-guidance"),
|
|
25893
|
+
/* @__PURE__ */ jsx46(Text39, { children: " " }, "cyc-space")
|
|
26081
25894
|
];
|
|
26082
25895
|
cycles.forEach((cycle, index) => {
|
|
26083
25896
|
const nodeCount = new Set(cycle.path).size;
|
|
26084
25897
|
const isCursor = index === cursor;
|
|
26085
25898
|
lines.push(
|
|
26086
|
-
/* @__PURE__ */
|
|
26087
|
-
/* @__PURE__ */
|
|
25899
|
+
/* @__PURE__ */ jsx46(Text39, { bold: true, inverse: isCursor, children: `${isCursor ? figures6.pointer : " "} Cycle ${index + 1} (${nodeCount} component${nodeCount === 1 ? "" : "s"}):` }, `cyc-h-${index}`),
|
|
25900
|
+
/* @__PURE__ */ jsx46(CyclePathLine, { segments: formatCyclePathSegments(cycle, 16), prefix: " " }, `cyc-p-${index}`)
|
|
26088
25901
|
);
|
|
26089
25902
|
if (cycle.suggestedBreak) {
|
|
26090
25903
|
lines.push(
|
|
26091
|
-
/* @__PURE__ */
|
|
25904
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE.muted, children: ` Suggested fix: remove [${cycle.suggestedBreak.slotName}] from ${cycle.suggestedBreak.fromComponent}` }, `cyc-fix-${index}`)
|
|
26092
25905
|
);
|
|
26093
25906
|
}
|
|
26094
|
-
lines.push(/* @__PURE__ */
|
|
25907
|
+
lines.push(/* @__PURE__ */ jsx46(Text39, { children: " " }, `cyc-s-${index}`));
|
|
26095
25908
|
});
|
|
26096
25909
|
const footer = "[\u2191\u2193] move [Enter] fix cycle [c/q/Esc] close";
|
|
26097
25910
|
const viewportHeight = Math.max(1, height - 3);
|
|
26098
25911
|
const visible = lines.slice(scrollOffset, scrollOffset + viewportHeight - 1);
|
|
26099
|
-
return /* @__PURE__ */
|
|
25912
|
+
return /* @__PURE__ */ jsxs38(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
26100
25913
|
visible,
|
|
26101
|
-
/* @__PURE__ */
|
|
25914
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE.muted, children: footer })
|
|
26102
25915
|
] });
|
|
26103
25916
|
}
|
|
26104
25917
|
function BreakCyclePanel({
|
|
@@ -26109,14 +25922,14 @@ function BreakCyclePanel({
|
|
|
26109
25922
|
width,
|
|
26110
25923
|
height
|
|
26111
25924
|
}) {
|
|
26112
|
-
return /* @__PURE__ */
|
|
26113
|
-
/* @__PURE__ */
|
|
26114
|
-
cycle && /* @__PURE__ */
|
|
26115
|
-
/* @__PURE__ */
|
|
26116
|
-
/* @__PURE__ */
|
|
26117
|
-
edges.length > 0 && /* @__PURE__ */
|
|
26118
|
-
edges.map((edge, index) => /* @__PURE__ */
|
|
26119
|
-
confirming ? /* @__PURE__ */
|
|
25925
|
+
return /* @__PURE__ */ jsxs38(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
25926
|
+
/* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE.warning, children: "BREAK CYCLE \u2014 remove a slot edge" }),
|
|
25927
|
+
cycle && /* @__PURE__ */ jsx46(CyclePathLine, { segments: formatCyclePathSegments(cycle), prefix: " ", highlightComponents: true }),
|
|
25928
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE.muted, children: cycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
|
|
25929
|
+
/* @__PURE__ */ jsx46(Text39, { children: " " }),
|
|
25930
|
+
edges.length > 0 && /* @__PURE__ */ jsx46(Text39, { color: PALETTE.muted, children: "remove slot edge:" }),
|
|
25931
|
+
edges.map((edge, index) => /* @__PURE__ */ jsx46(Text39, { inverse: index === cursor, children: `${index === cursor ? figures6.pointer : " "} remove '${edge.toComponent}' from ${edge.fromComponent}.$slots.${edge.slotName}.$allowedComponents` }, `${edge.fromComponent}-${edge.slotName}-${edge.toComponent}`)),
|
|
25932
|
+
confirming ? /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE.warning, children: "Delete this slot edge? [y] confirm [n] cancel" }) : /* @__PURE__ */ jsx46(Text39, { children: "[\u2191\u2193] move [Enter] delete [x/Esc] close" })
|
|
26120
25933
|
] });
|
|
26121
25934
|
}
|
|
26122
25935
|
function buildBreakingRows(breakingChanges) {
|
|
@@ -26162,9 +25975,9 @@ function deriveBreakingChanges(response) {
|
|
|
26162
25975
|
}
|
|
26163
25976
|
function GenerateReviewStep(props) {
|
|
26164
25977
|
if (!props.extractSessionId) {
|
|
26165
|
-
return /* @__PURE__ */
|
|
25978
|
+
return /* @__PURE__ */ jsx46(Box37, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx46(Text39, { color: PALETTE.error, children: "Error: no session ID \u2014 cannot load generated definitions." }) });
|
|
26166
25979
|
}
|
|
26167
|
-
return /* @__PURE__ */
|
|
25980
|
+
return /* @__PURE__ */ jsx46(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
|
|
26168
25981
|
}
|
|
26169
25982
|
function GenerateReviewStepView({
|
|
26170
25983
|
extractSessionId,
|
|
@@ -26180,7 +25993,7 @@ function GenerateReviewStepView({
|
|
|
26180
25993
|
initialFinalizeError = null
|
|
26181
25994
|
}) {
|
|
26182
25995
|
const { columns: terminalWidth, rows: terminalRows } = useTerminalSize();
|
|
26183
|
-
const [slotCycles, setSlotCycles] =
|
|
25996
|
+
const [slotCycles, setSlotCycles] = useState18([]);
|
|
26184
25997
|
const setLoadedSlotCycles = useCallback7((cycles) => {
|
|
26185
25998
|
setSlotCycles(cycles ?? []);
|
|
26186
25999
|
}, []);
|
|
@@ -26212,7 +26025,7 @@ function GenerateReviewStepView({
|
|
|
26212
26025
|
tokensPath,
|
|
26213
26026
|
onExtraLoaded: setLoadedSlotCycles
|
|
26214
26027
|
});
|
|
26215
|
-
const [nav, setNav] =
|
|
26028
|
+
const [nav, setNav] = useState18({
|
|
26216
26029
|
cursorRowIdx: 0,
|
|
26217
26030
|
sidebarScrollOffset: 0
|
|
26218
26031
|
});
|
|
@@ -26228,10 +26041,10 @@ function GenerateReviewStepView({
|
|
|
26228
26041
|
finalizeError,
|
|
26229
26042
|
setFinalizeError
|
|
26230
26043
|
} = reviewSurface;
|
|
26231
|
-
const [removedBannerCollapsed, setRemovedBannerCollapsed] =
|
|
26232
|
-
const removedBannerDefaultedRef =
|
|
26233
|
-
const [cyclePanelScroll, setCyclePanelScroll] =
|
|
26234
|
-
const [cyclesCursor, setCyclesCursor] =
|
|
26044
|
+
const [removedBannerCollapsed, setRemovedBannerCollapsed] = useState18(false);
|
|
26045
|
+
const removedBannerDefaultedRef = useRef8(false);
|
|
26046
|
+
const [cyclePanelScroll, setCyclePanelScroll] = useState18(0);
|
|
26047
|
+
const [cyclesCursor, setCyclesCursor] = useState18(0);
|
|
26235
26048
|
const cyclePanel = useOverlayPanel({
|
|
26236
26049
|
toggleKey: "c",
|
|
26237
26050
|
onClose: () => {
|
|
@@ -26246,10 +26059,10 @@ function GenerateReviewStepView({
|
|
|
26246
26059
|
setBreakConfirm(false);
|
|
26247
26060
|
}
|
|
26248
26061
|
});
|
|
26249
|
-
const [breakCursor, setBreakCursor] =
|
|
26250
|
-
const [breakConfirm, setBreakConfirm] =
|
|
26251
|
-
const [expandedGroups, setExpandedGroups] =
|
|
26252
|
-
const seededGroupsRef =
|
|
26062
|
+
const [breakCursor, setBreakCursor] = useState18(0);
|
|
26063
|
+
const [breakConfirm, setBreakConfirm] = useState18(false);
|
|
26064
|
+
const [expandedGroups, setExpandedGroups] = useState18(/* @__PURE__ */ new Set());
|
|
26065
|
+
const seededGroupsRef = useRef8(false);
|
|
26253
26066
|
const {
|
|
26254
26067
|
searchOpen,
|
|
26255
26068
|
setSearchOpen,
|
|
@@ -26267,14 +26080,14 @@ function GenerateReviewStepView({
|
|
|
26267
26080
|
setShowHelp
|
|
26268
26081
|
} = useSidebarSearchState();
|
|
26269
26082
|
const breakingPanel = useOverlayPanel({ toggleKey: "b", onClose: () => setBreakingDetailOpen(false) });
|
|
26270
|
-
const [breakingChanges, setBreakingChanges] =
|
|
26271
|
-
const [breakingCursor, setBreakingCursor] =
|
|
26272
|
-
const [breakingDetailOpen, setBreakingDetailOpen] =
|
|
26273
|
-
const [pendingEditorFocus, setPendingEditorFocus] =
|
|
26274
|
-
const [autoRejected, setAutoRejected] =
|
|
26275
|
-
const [undoSnapshot, setUndoSnapshot] =
|
|
26276
|
-
const autoRejectFiredRef =
|
|
26277
|
-
const [showReloadDialog, setShowReloadDialog] =
|
|
26083
|
+
const [breakingChanges, setBreakingChanges] = useState18([]);
|
|
26084
|
+
const [breakingCursor, setBreakingCursor] = useState18(0);
|
|
26085
|
+
const [breakingDetailOpen, setBreakingDetailOpen] = useState18(false);
|
|
26086
|
+
const [pendingEditorFocus, setPendingEditorFocus] = useState18(null);
|
|
26087
|
+
const [autoRejected, setAutoRejected] = useState18([]);
|
|
26088
|
+
const [undoSnapshot, setUndoSnapshot] = useState18(null);
|
|
26089
|
+
const autoRejectFiredRef = useRef8(false);
|
|
26090
|
+
const [showReloadDialog, setShowReloadDialog] = useState18(false);
|
|
26278
26091
|
const acceptedCountForPreview = components.filter((c2) => c2.status === "accepted").length;
|
|
26279
26092
|
const { previewAnnotations, removedComponents, livePreviewHook, livePreviewSpinner } = useReviewPreview({
|
|
26280
26093
|
components,
|
|
@@ -26406,7 +26219,7 @@ function GenerateReviewStepView({
|
|
|
26406
26219
|
}),
|
|
26407
26220
|
applySnapshot: applyHistorySnapshot
|
|
26408
26221
|
});
|
|
26409
|
-
const autoRejectPushedRef =
|
|
26222
|
+
const autoRejectPushedRef = useRef8(false);
|
|
26410
26223
|
useEffect13(() => {
|
|
26411
26224
|
if (loading) return;
|
|
26412
26225
|
if (!historySeededRef.current) return;
|
|
@@ -27021,13 +26834,13 @@ function GenerateReviewStepView({
|
|
|
27021
26834
|
}
|
|
27022
26835
|
});
|
|
27023
26836
|
if (loading) {
|
|
27024
|
-
return /* @__PURE__ */
|
|
26837
|
+
return /* @__PURE__ */ jsx46(ReviewLoadingState, {});
|
|
27025
26838
|
}
|
|
27026
26839
|
if (loadError) {
|
|
27027
|
-
return /* @__PURE__ */
|
|
26840
|
+
return /* @__PURE__ */ jsx46(ReviewLoadError, { message: loadError });
|
|
27028
26841
|
}
|
|
27029
26842
|
if (showHelp) {
|
|
27030
|
-
return /* @__PURE__ */
|
|
26843
|
+
return /* @__PURE__ */ jsx46(HelpOverlay, { sections: HELP_SECTIONS2, handleInput: false, onClose: () => setShowHelp(false) });
|
|
27031
26844
|
}
|
|
27032
26845
|
const { selected, selectedJson, visibleJsonPanelValue } = getReviewSelectionState(
|
|
27033
26846
|
components,
|
|
@@ -27067,8 +26880,8 @@ function GenerateReviewStepView({
|
|
|
27067
26880
|
for (const c2 of closures.values()) if (c2.nodes.length > 1) return true;
|
|
27068
26881
|
return false;
|
|
27069
26882
|
})();
|
|
27070
|
-
return /* @__PURE__ */
|
|
27071
|
-
/* @__PURE__ */
|
|
26883
|
+
return /* @__PURE__ */ jsxs38(Box37, { flexDirection: "column", children: [
|
|
26884
|
+
/* @__PURE__ */ jsx46(
|
|
27072
26885
|
ReviewStepDialogs,
|
|
27073
26886
|
{
|
|
27074
26887
|
surfaceState: reviewSurface,
|
|
@@ -27078,16 +26891,16 @@ function GenerateReviewStepView({
|
|
|
27078
26891
|
onQuit
|
|
27079
26892
|
}
|
|
27080
26893
|
),
|
|
27081
|
-
/* @__PURE__ */
|
|
27082
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */
|
|
27083
|
-
/* @__PURE__ */
|
|
27084
|
-
!removedBannerCollapsed && /* @__PURE__ */
|
|
27085
|
-
/* @__PURE__ */
|
|
27086
|
-
removedComponents.map((rc) => /* @__PURE__ */
|
|
26894
|
+
/* @__PURE__ */ jsx46(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
26895
|
+
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs38(Box37, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
26896
|
+
/* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
|
|
26897
|
+
!removedBannerCollapsed && /* @__PURE__ */ jsxs38(Fragment18, { children: [
|
|
26898
|
+
/* @__PURE__ */ jsx46(Text39, { children: " " }),
|
|
26899
|
+
removedComponents.map((rc) => /* @__PURE__ */ jsx46(Text39, { children: removedComponentLine(rc) }, rc.id))
|
|
27087
26900
|
] })
|
|
27088
26901
|
] }),
|
|
27089
|
-
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */
|
|
27090
|
-
|
|
26902
|
+
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx46(Box37, { paddingX: 1, children: /* @__PURE__ */ jsx46(
|
|
26903
|
+
Text39,
|
|
27091
26904
|
{
|
|
27092
26905
|
color: PALETTE.warning,
|
|
27093
26906
|
children: `[b] ${breakingChanges.length} breaking change${breakingChanges.length === 1 ? "" : "s"}`
|
|
@@ -27097,14 +26910,14 @@ function GenerateReviewStepView({
|
|
|
27097
26910
|
const row = breakingRows[breakingCursor];
|
|
27098
26911
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
27099
26912
|
if (!comp) return null;
|
|
27100
|
-
return /* @__PURE__ */
|
|
27101
|
-
/* @__PURE__ */
|
|
27102
|
-
comp.impact && /* @__PURE__ */
|
|
27103
|
-
comp.changes.length === 0 ? /* @__PURE__ */
|
|
27104
|
-
/* @__PURE__ */
|
|
26913
|
+
return /* @__PURE__ */ jsxs38(Box37, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
26914
|
+
/* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
|
|
26915
|
+
comp.impact && /* @__PURE__ */ jsx46(Text39, { color: PALETTE.muted, children: ` affects ${comp.impact.affectedExperiences} experience${comp.impact.affectedExperiences === 1 ? "" : "s"}, ${comp.impact.affectedFragments} fragment${comp.impact.affectedFragments === 1 ? "" : "s"}` }),
|
|
26916
|
+
comp.changes.length === 0 ? /* @__PURE__ */ jsx46(Text39, { color: PALETTE.muted, children: " (no enumerated changes)" }) : comp.changes.map((change, ci) => /* @__PURE__ */ jsx46(Text39, { children: ` \u2022 ${formatBreakingChange(change, comp.current)}` }, `bd-detail-${ci}`)),
|
|
26917
|
+
/* @__PURE__ */ jsx46(Text39, { children: "[D/Esc] close detail" })
|
|
27105
26918
|
] });
|
|
27106
26919
|
})(),
|
|
27107
|
-
!dialogOpen && /* @__PURE__ */
|
|
26920
|
+
!dialogOpen && /* @__PURE__ */ jsx46(
|
|
27108
26921
|
LivePreviewSummary,
|
|
27109
26922
|
{
|
|
27110
26923
|
enabled: livePreview,
|
|
@@ -27123,16 +26936,16 @@ function GenerateReviewStepView({
|
|
|
27123
26936
|
const participantSet = cycleView.structural;
|
|
27124
26937
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
27125
26938
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
27126
|
-
return /* @__PURE__ */
|
|
27127
|
-
/* @__PURE__ */
|
|
27128
|
-
members.length > 0 && /* @__PURE__ */
|
|
27129
|
-
ancestors.length > 0 && /* @__PURE__ */
|
|
27130
|
-
/* @__PURE__ */
|
|
26939
|
+
return /* @__PURE__ */ jsxs38(Box37, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
26940
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE.error, bold: true, children: `Cyclic component graph \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
|
|
26941
|
+
members.length > 0 && /* @__PURE__ */ jsx46(Text39, { color: PALETTE.error, children: ` Cycle members: ${members.join(", ")}` }),
|
|
26942
|
+
ancestors.length > 0 && /* @__PURE__ */ jsx46(Text39, { color: PALETTE.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
|
|
26943
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE.muted, children: undoSnapshot ? " [Ctrl+Z] undo \xB7 [r]/[a] manually toggle \xB7 [F] continue" : " [r]/[a] manually toggle \xB7 [F] continue" })
|
|
27131
26944
|
] });
|
|
27132
26945
|
})(),
|
|
27133
|
-
/* @__PURE__ */
|
|
27134
|
-
/* @__PURE__ */
|
|
27135
|
-
!dialogOpen && breakPanel.isOpen && /* @__PURE__ */
|
|
26946
|
+
/* @__PURE__ */ jsx46(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
|
|
26947
|
+
/* @__PURE__ */ jsx46(ReviewFinalizeError, { message: finalizeError, hidden: dialogOpen }),
|
|
26948
|
+
!dialogOpen && breakPanel.isOpen && /* @__PURE__ */ jsx46(
|
|
27136
26949
|
BreakCyclePanel,
|
|
27137
26950
|
{
|
|
27138
26951
|
cycle: cycleRows[cyclesCursor],
|
|
@@ -27143,7 +26956,7 @@ function GenerateReviewStepView({
|
|
|
27143
26956
|
height: panelHeight
|
|
27144
26957
|
}
|
|
27145
26958
|
),
|
|
27146
|
-
!dialogOpen && cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */
|
|
26959
|
+
!dialogOpen && cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsx46(
|
|
27147
26960
|
CycleDetailPanel,
|
|
27148
26961
|
{
|
|
27149
26962
|
cycles: cycleRows,
|
|
@@ -27153,8 +26966,8 @@ function GenerateReviewStepView({
|
|
|
27153
26966
|
height: panelHeight
|
|
27154
26967
|
}
|
|
27155
26968
|
),
|
|
27156
|
-
!dialogOpen && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */
|
|
27157
|
-
breakingPanel.isOpen ? /* @__PURE__ */
|
|
26969
|
+
!dialogOpen && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs38(Box37, { children: [
|
|
26970
|
+
breakingPanel.isOpen ? /* @__PURE__ */ jsx46(
|
|
27158
26971
|
GotoBanner,
|
|
27159
26972
|
{
|
|
27160
26973
|
title: `Breaking changes \u2014 ${breakingRows[breakingCursor]?.componentName ?? "unknown component"}`,
|
|
@@ -27167,7 +26980,7 @@ function GenerateReviewStepView({
|
|
|
27167
26980
|
width: sidebarWidth,
|
|
27168
26981
|
footerHint: "[\u2191/\u2193] move \xB7 [Enter] jump \xB7 [D] detail \xB7 [Esc] close"
|
|
27169
26982
|
}
|
|
27170
|
-
) : /* @__PURE__ */
|
|
26983
|
+
) : /* @__PURE__ */ jsx46(
|
|
27171
26984
|
GroupedSidebar,
|
|
27172
26985
|
{
|
|
27173
26986
|
items: groupedItems,
|
|
@@ -27207,7 +27020,7 @@ function GenerateReviewStepView({
|
|
|
27207
27020
|
graph: sidebarGraph
|
|
27208
27021
|
}
|
|
27209
27022
|
),
|
|
27210
|
-
selected ? /* @__PURE__ */
|
|
27023
|
+
selected ? /* @__PURE__ */ jsx46(
|
|
27211
27024
|
ReviewComponentPanel,
|
|
27212
27025
|
{
|
|
27213
27026
|
selectedKey: selected.key,
|
|
@@ -27239,12 +27052,12 @@ function GenerateReviewStepView({
|
|
|
27239
27052
|
livePreview: livePreviewHook,
|
|
27240
27053
|
livePreviewSpinner
|
|
27241
27054
|
}
|
|
27242
|
-
) : /* @__PURE__ */
|
|
27055
|
+
) : /* @__PURE__ */ jsx46(ReviewNoSelection, {})
|
|
27243
27056
|
] }),
|
|
27244
|
-
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */
|
|
27245
|
-
/* @__PURE__ */
|
|
27057
|
+
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs38(Box37, { flexDirection: "column", children: [
|
|
27058
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE.warning, children: `\u26A0 ${cycleRows.length} slot dependency cycle${cycleRows.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
27246
27059
|
cycleRows.slice(0, 3).map((cycle, idx) => {
|
|
27247
|
-
return /* @__PURE__ */
|
|
27060
|
+
return /* @__PURE__ */ jsx46(
|
|
27248
27061
|
CyclePathLine,
|
|
27249
27062
|
{
|
|
27250
27063
|
segments: formatCyclePathSegments(cycle),
|
|
@@ -27255,10 +27068,10 @@ function GenerateReviewStepView({
|
|
|
27255
27068
|
`cyc-banner-${idx}`
|
|
27256
27069
|
);
|
|
27257
27070
|
}),
|
|
27258
|
-
cycleRows.length > 3 && /* @__PURE__ */
|
|
27259
|
-
/* @__PURE__ */
|
|
27071
|
+
cycleRows.length > 3 && /* @__PURE__ */ jsx46(Text39, { color: PALETTE.warning, children: ` \u2026${cycleRows.length - 3} more` }),
|
|
27072
|
+
/* @__PURE__ */ jsx46(Text39, { children: " press [c] for detail" })
|
|
27260
27073
|
] }),
|
|
27261
|
-
/* @__PURE__ */
|
|
27074
|
+
/* @__PURE__ */ jsx46(
|
|
27262
27075
|
SearchMatchSummary,
|
|
27263
27076
|
{
|
|
27264
27077
|
open: searchOpen,
|
|
@@ -27269,7 +27082,7 @@ function GenerateReviewStepView({
|
|
|
27269
27082
|
hidden: dialogOpen
|
|
27270
27083
|
}
|
|
27271
27084
|
),
|
|
27272
|
-
!dialogOpen && sidebarFocused && /* @__PURE__ */
|
|
27085
|
+
!dialogOpen && sidebarFocused && /* @__PURE__ */ jsx46(CompactControlBar, { hasGroupRoots, searchActive: searchOpen || searchQuery.length > 0 })
|
|
27273
27086
|
] });
|
|
27274
27087
|
}
|
|
27275
27088
|
var HELP_SECTIONS2;
|
|
@@ -27658,8 +27471,8 @@ __export(WizardApp_exports, {
|
|
|
27658
27471
|
parsePrintTokensCount: () => parsePrintTokensCount,
|
|
27659
27472
|
shouldRunMapTokens: () => shouldRunMapTokens
|
|
27660
27473
|
});
|
|
27661
|
-
import { useEffect as useEffect14, useRef as
|
|
27662
|
-
import { Box as
|
|
27474
|
+
import { useEffect as useEffect14, useRef as useRef9, useState as useState19 } from "react";
|
|
27475
|
+
import { Box as Box38, Text as Text40 } from "ink";
|
|
27663
27476
|
import { join as join20, resolve as resolve18 } from "node:path";
|
|
27664
27477
|
import { appendFileSync as appendFileSync2, writeFileSync } from "node:fs";
|
|
27665
27478
|
import { access as access7, stat as stat5, writeFile as writeFile5 } from "node:fs/promises";
|
|
@@ -27667,7 +27480,7 @@ import { tmpdir } from "node:os";
|
|
|
27667
27480
|
import { execFile as execFile2, spawn as spawn5 } from "node:child_process";
|
|
27668
27481
|
import { mkdir as mkdir4 } from "node:fs/promises";
|
|
27669
27482
|
import { buildCDF as buildCDF3, validateCDF as validateCDF3, validateSlotReferences as validateSlotReferences2 } from "@contentful/experience-design-system-types";
|
|
27670
|
-
import { jsx as
|
|
27483
|
+
import { jsx as jsx47, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
27671
27484
|
function buildGenerateComponentsArgs(opts) {
|
|
27672
27485
|
const args = ["__generate", "components", "--agent", opts.agent, "--session", opts.sessionId];
|
|
27673
27486
|
if (opts.tokensPath) args.push("--tokens", opts.tokensPath);
|
|
@@ -27795,41 +27608,36 @@ function WizardApp({
|
|
|
27795
27608
|
} = {}) {
|
|
27796
27609
|
const defaultConfiguredHost = toConfiguredHost(host || process.env["EDS_HOST"]) ?? DEFAULT_CONFIGURED_HOST;
|
|
27797
27610
|
const resolveWizardHost = (hostValue) => hostValue || defaultConfiguredHost;
|
|
27798
|
-
const credentialKey = (spaceId, environmentId, cmaToken, hostValue) => [spaceId.trim(), environmentId.trim(), cmaToken.trim(), resolveWizardHost(hostValue)].join("\0");
|
|
27799
27611
|
const { columns: terminalWidth } = useTerminalSize();
|
|
27800
27612
|
const clearScreenOnTransition = useScreenTransitionClear();
|
|
27801
|
-
const logInit =
|
|
27802
|
-
const initialAgentAuthRef =
|
|
27613
|
+
const logInit = useRef9(false);
|
|
27614
|
+
const initialAgentAuthRef = useRef9(initialAgentAuth ?? null);
|
|
27803
27615
|
if (!logInit.current) {
|
|
27804
27616
|
writeFileSync(WIZARD_LOG, `--- experiences import session ${(/* @__PURE__ */ new Date()).toISOString()} ---
|
|
27805
27617
|
`);
|
|
27806
27618
|
logInit.current = true;
|
|
27807
27619
|
}
|
|
27808
|
-
const sessionRef =
|
|
27620
|
+
const sessionRef = useRef9({
|
|
27809
27621
|
extractSessionId: null,
|
|
27810
27622
|
tokensPath: ""
|
|
27811
27623
|
});
|
|
27812
|
-
const allowEmptyDeleteAllRef =
|
|
27813
|
-
const
|
|
27814
|
-
const
|
|
27815
|
-
const
|
|
27816
|
-
const
|
|
27817
|
-
const
|
|
27818
|
-
const
|
|
27819
|
-
const
|
|
27820
|
-
const
|
|
27821
|
-
const
|
|
27822
|
-
const
|
|
27823
|
-
const
|
|
27824
|
-
const scopeGateCompletedRef = useRef10(false);
|
|
27825
|
-
const scopeComponentsRef = useRef10(null);
|
|
27826
|
-
const existingEntitiesPromiseRef = useRef10(null);
|
|
27827
|
-
const generatePromiseRef = useRef10(null);
|
|
27624
|
+
const allowEmptyDeleteAllRef = useRef9(false);
|
|
27625
|
+
const generationCachePreflightRef = useRef9(null);
|
|
27626
|
+
const selectionToReviewStartedAtRef = useRef9(null);
|
|
27627
|
+
const tokenGenerationPromiseRef = useRef9(null);
|
|
27628
|
+
const extractPromiseRef = useRef9(null);
|
|
27629
|
+
const extractStartedRef = useRef9(false);
|
|
27630
|
+
const credentialsReadyRef = useRef9(false);
|
|
27631
|
+
const agentAuthVerifiedRef = useRef9(false);
|
|
27632
|
+
const scopeGateCompletedRef = useRef9(false);
|
|
27633
|
+
const scopeComponentsRef = useRef9(null);
|
|
27634
|
+
const existingEntitiesPromiseRef = useRef9(null);
|
|
27635
|
+
const generatePromiseRef = useRef9(null);
|
|
27828
27636
|
const rawTokensEntryReady = !!initialRawTokensPath;
|
|
27829
27637
|
const effectiveNoCache = resolveNoCacheForGenerate({ cliNoCache: noCache });
|
|
27830
27638
|
const initialStepResolved = "credentials";
|
|
27831
27639
|
const initialOutDir = initialProjectPath ? join20(resolve18(initialProjectPath), ".contentful") : "";
|
|
27832
|
-
const [state, setState] =
|
|
27640
|
+
const [state, setState] = useState19({
|
|
27833
27641
|
step: initialStepResolved,
|
|
27834
27642
|
agent: initialAgent ?? "claude",
|
|
27835
27643
|
...initialModel ? { agentModel: initialModel } : {},
|
|
@@ -27876,8 +27684,6 @@ function WizardApp({
|
|
|
27876
27684
|
previewValidationMissingNames: [],
|
|
27877
27685
|
credentialsValidating: false,
|
|
27878
27686
|
credentialsBackgroundValidating: false,
|
|
27879
|
-
generatePrefetchStatus: "idle",
|
|
27880
|
-
generatePrefetchError: null,
|
|
27881
27687
|
mapTokensEligible: null,
|
|
27882
27688
|
credentialsSkipped: false,
|
|
27883
27689
|
existingEntitiesPath: null,
|
|
@@ -28369,23 +28175,6 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
|
|
|
28369
28175
|
extractPromiseRef.current = null;
|
|
28370
28176
|
});
|
|
28371
28177
|
};
|
|
28372
|
-
const cancelGeneratePrefetch = () => {
|
|
28373
|
-
const child = generateChildRef.current;
|
|
28374
|
-
if (child && !child.killed) {
|
|
28375
|
-
try {
|
|
28376
|
-
child.kill("SIGTERM");
|
|
28377
|
-
} catch {
|
|
28378
|
-
}
|
|
28379
|
-
}
|
|
28380
|
-
generateChildRef.current = null;
|
|
28381
|
-
generatePromiseRef.current = null;
|
|
28382
|
-
setState((prev) => ({
|
|
28383
|
-
...prev,
|
|
28384
|
-
generatePrefetchStatus: "idle",
|
|
28385
|
-
generatePrefetchError: null,
|
|
28386
|
-
generateProgress: null
|
|
28387
|
-
}));
|
|
28388
|
-
};
|
|
28389
28178
|
const buildGenerateOptions = (extractSessionId, tokensPath, generatePromptPath2, cachedComponents) => ({
|
|
28390
28179
|
sessionId: extractSessionId,
|
|
28391
28180
|
tokensPath,
|
|
@@ -28516,60 +28305,6 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
|
|
|
28516
28305
|
state.existingEntitiesStatus,
|
|
28517
28306
|
state.existingEntitiesPath
|
|
28518
28307
|
]);
|
|
28519
|
-
const startGeneratePrefetch = (extractSessionId, tokensPath) => {
|
|
28520
|
-
const args = buildGenerateArgs(extractSessionId, tokensPath);
|
|
28521
|
-
let progressCursor = null;
|
|
28522
|
-
const { child, donePromise } = spawnGenerateChild({
|
|
28523
|
-
command: "node",
|
|
28524
|
-
args,
|
|
28525
|
-
onStderr: (chunk) => {
|
|
28526
|
-
const nextProgress = parseGenerateStderrChunk(chunk, progressCursor);
|
|
28527
|
-
if (nextProgress !== progressCursor) {
|
|
28528
|
-
progressCursor = nextProgress;
|
|
28529
|
-
setState((prev) => ({ ...prev, generateProgress: nextProgress }));
|
|
28530
|
-
}
|
|
28531
|
-
}
|
|
28532
|
-
});
|
|
28533
|
-
generateChildRef.current = child;
|
|
28534
|
-
generatePromiseRef.current = donePromise;
|
|
28535
|
-
setState((prev) => ({
|
|
28536
|
-
...prev,
|
|
28537
|
-
generatePrefetchStatus: "running",
|
|
28538
|
-
generatePrefetchError: null
|
|
28539
|
-
}));
|
|
28540
|
-
donePromise.then((result) => {
|
|
28541
|
-
generateChildRef.current = null;
|
|
28542
|
-
if (result.signal === "SIGTERM") {
|
|
28543
|
-
return;
|
|
28544
|
-
}
|
|
28545
|
-
if (result.exitCode !== 0) {
|
|
28546
|
-
const tail = result.stderr.trim().split("\n").slice(-3).join("\n") || `exit ${result.exitCode}`;
|
|
28547
|
-
setState((prev) => ({
|
|
28548
|
-
...prev,
|
|
28549
|
-
generatePrefetchStatus: "failed",
|
|
28550
|
-
generatePrefetchError: tail,
|
|
28551
|
-
generateProgress: null
|
|
28552
|
-
}));
|
|
28553
|
-
return;
|
|
28554
|
-
}
|
|
28555
|
-
const { generateSessionId: generateSessionId2, generatedCount } = parseGenerateResult(result, 0);
|
|
28556
|
-
setState((prev) => ({
|
|
28557
|
-
...prev,
|
|
28558
|
-
generateSessionId: generateSessionId2,
|
|
28559
|
-
generatedCount,
|
|
28560
|
-
generateProgress: null,
|
|
28561
|
-
generatePrefetchStatus: "complete"
|
|
28562
|
-
}));
|
|
28563
|
-
}).catch(() => {
|
|
28564
|
-
generateChildRef.current = null;
|
|
28565
|
-
setState((prev) => ({
|
|
28566
|
-
...prev,
|
|
28567
|
-
generatePrefetchStatus: "failed",
|
|
28568
|
-
generatePrefetchError: "subprocess error"
|
|
28569
|
-
}));
|
|
28570
|
-
});
|
|
28571
|
-
return donePromise;
|
|
28572
|
-
};
|
|
28573
28308
|
const runGenerate = async (extractSessionId, tokensPath, acceptedCount, suppressScreen = false, cachedComponents = []) => {
|
|
28574
28309
|
const timer = startWizardTimer("component-generation", {
|
|
28575
28310
|
sessionId: extractSessionId,
|
|
@@ -28678,136 +28413,7 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
|
|
|
28678
28413
|
const { extractSessionId: sid, tokensPath: tp } = sessionRef.current;
|
|
28679
28414
|
void runPreview(sid, tp, state.spaceId, state.environmentId, state.cmaToken, state.host);
|
|
28680
28415
|
};
|
|
28681
|
-
const
|
|
28682
|
-
const resolvedHost = resolveWizardHost(host2);
|
|
28683
|
-
const key = credentialKey(spaceId, environmentId, cmaToken, resolvedHost);
|
|
28684
|
-
if (validatedCredentialsKeyRef.current === key) {
|
|
28685
|
-
await advanceAfterCredentialsValidated();
|
|
28686
|
-
return;
|
|
28687
|
-
}
|
|
28688
|
-
const pending2 = pendingCredentialValidationRef.current;
|
|
28689
|
-
if (pending2?.key === key) {
|
|
28690
|
-
if (await pending2.promise) await advanceAfterCredentialsValidated();
|
|
28691
|
-
return;
|
|
28692
|
-
}
|
|
28693
|
-
await validateCredentials(spaceId, environmentId, cmaToken, resolvedHost);
|
|
28694
|
-
};
|
|
28695
|
-
const confirmCredentials = async (spaceId, environmentId, cmaToken, host2) => {
|
|
28696
|
-
const resolvedHost = resolveWizardHost(host2);
|
|
28697
|
-
try {
|
|
28698
|
-
const stored = await readExperiencesCredentials();
|
|
28699
|
-
await writeExperiencesCredentials({
|
|
28700
|
-
...stored,
|
|
28701
|
-
spaceId,
|
|
28702
|
-
environmentId,
|
|
28703
|
-
cmaToken,
|
|
28704
|
-
host: resolvedHost
|
|
28705
|
-
});
|
|
28706
|
-
advanceWithCredentials(spaceId, environmentId, cmaToken, resolvedHost);
|
|
28707
|
-
} catch (e) {
|
|
28708
|
-
const message = e instanceof Error ? e.message : "Unable to save credentials";
|
|
28709
|
-
update({
|
|
28710
|
-
spaceId,
|
|
28711
|
-
environmentId,
|
|
28712
|
-
cmaToken,
|
|
28713
|
-
host: resolvedHost,
|
|
28714
|
-
credentialsError: `Failed to save credentials: ${message}`,
|
|
28715
|
-
step: "credentials"
|
|
28716
|
-
});
|
|
28717
|
-
}
|
|
28718
|
-
};
|
|
28719
|
-
const validateCredentials = async (spaceId, environmentId, cmaToken, host2, options = {}) => {
|
|
28720
|
-
const validationId = options.validationId ?? ++credentialsValidationIdRef.current;
|
|
28721
|
-
const isCurrent = () => credentialsValidationIdRef.current === validationId;
|
|
28722
|
-
const key = credentialKey(spaceId, environmentId, cmaToken, host2);
|
|
28723
|
-
update({
|
|
28724
|
-
step: "credentials",
|
|
28725
|
-
credentialsValidating: true,
|
|
28726
|
-
credentialsBackgroundValidating: options.background === true,
|
|
28727
|
-
credentialsError: ""
|
|
28728
|
-
});
|
|
28729
|
-
try {
|
|
28730
|
-
const resolvedHost = resolveWizardHost(host2);
|
|
28731
|
-
const client2 = new ImportApiClient({
|
|
28732
|
-
cmaToken,
|
|
28733
|
-
spaceId,
|
|
28734
|
-
environmentId,
|
|
28735
|
-
host: resolvedHost
|
|
28736
|
-
});
|
|
28737
|
-
await client2.validateToken();
|
|
28738
|
-
if (!isCurrent()) return false;
|
|
28739
|
-
validatedCredentialsKeyRef.current = key;
|
|
28740
|
-
update({
|
|
28741
|
-
spaceId,
|
|
28742
|
-
environmentId,
|
|
28743
|
-
cmaToken,
|
|
28744
|
-
host: resolvedHost,
|
|
28745
|
-
credentialsValidating: false,
|
|
28746
|
-
credentialsBackgroundValidating: false
|
|
28747
|
-
});
|
|
28748
|
-
if (options.background) return true;
|
|
28749
|
-
await advanceAfterCredentialsValidated(validationId);
|
|
28750
|
-
return true;
|
|
28751
|
-
} catch (e) {
|
|
28752
|
-
if (!isCurrent()) return false;
|
|
28753
|
-
if (e instanceof ApiError && (e.status === 401 || e.status === 403 || e.status === 404)) {
|
|
28754
|
-
cancelGeneratePrefetch();
|
|
28755
|
-
update({
|
|
28756
|
-
step: "credentials",
|
|
28757
|
-
credentialsValidating: false,
|
|
28758
|
-
credentialsBackgroundValidating: false,
|
|
28759
|
-
credentialsError: formatApiError(e, process.env["EDSI_VERBOSE_ERRORS"] === "1")
|
|
28760
|
-
});
|
|
28761
|
-
return false;
|
|
28762
|
-
}
|
|
28763
|
-
const msg = e instanceof Error ? e.message : "Credential check failed";
|
|
28764
|
-
cancelGeneratePrefetch();
|
|
28765
|
-
update({
|
|
28766
|
-
step: "error",
|
|
28767
|
-
errorStep: "validating-credentials",
|
|
28768
|
-
errorMessage: msg,
|
|
28769
|
-
errorAllowCredentialRetry: false,
|
|
28770
|
-
credentialsValidating: false,
|
|
28771
|
-
credentialsBackgroundValidating: false
|
|
28772
|
-
});
|
|
28773
|
-
return false;
|
|
28774
|
-
}
|
|
28775
|
-
};
|
|
28776
|
-
const handleCredentialValuesChange = () => {
|
|
28777
|
-
credentialsValidationIdRef.current += 1;
|
|
28778
|
-
pendingCredentialValidationRef.current = null;
|
|
28779
|
-
validatedCredentialsKeyRef.current = null;
|
|
28780
|
-
if (state.credentialsValidating) {
|
|
28781
|
-
update({ credentialsValidating: false, credentialsBackgroundValidating: false, credentialsError: "" });
|
|
28782
|
-
}
|
|
28783
|
-
};
|
|
28784
|
-
useEffect14(() => {
|
|
28785
|
-
if (state.step !== "credentials" || state.credentialsSkipped) return;
|
|
28786
|
-
if (!state.spaceId.trim() || !state.environmentId.trim() || !state.cmaToken.trim()) return;
|
|
28787
|
-
const validationId = ++credentialsValidationIdRef.current;
|
|
28788
|
-
const key = credentialKey(state.spaceId, state.environmentId, state.cmaToken, state.host);
|
|
28789
|
-
const promise = validateCredentials(state.spaceId, state.environmentId, state.cmaToken, state.host, {
|
|
28790
|
-
background: true,
|
|
28791
|
-
validationId
|
|
28792
|
-
});
|
|
28793
|
-
pendingCredentialValidationRef.current = { key, promise };
|
|
28794
|
-
void promise.then(
|
|
28795
|
-
() => {
|
|
28796
|
-
if (pendingCredentialValidationRef.current?.promise === promise) pendingCredentialValidationRef.current = null;
|
|
28797
|
-
},
|
|
28798
|
-
() => {
|
|
28799
|
-
if (pendingCredentialValidationRef.current?.promise === promise) pendingCredentialValidationRef.current = null;
|
|
28800
|
-
}
|
|
28801
|
-
);
|
|
28802
|
-
return () => {
|
|
28803
|
-
credentialsValidationIdRef.current += 1;
|
|
28804
|
-
pendingCredentialValidationRef.current = null;
|
|
28805
|
-
};
|
|
28806
|
-
}, [state.step]);
|
|
28807
|
-
const advanceAfterCredentialsValidated = async (validationId) => {
|
|
28808
|
-
const isCurrent = () => validationId === void 0 || credentialsValidationIdRef.current === validationId;
|
|
28809
|
-
if (!isCurrent()) return;
|
|
28810
|
-
if (!isCurrent()) return;
|
|
28416
|
+
const advanceAfterCredentialsValidated = async () => {
|
|
28811
28417
|
credentialsReadyRef.current = true;
|
|
28812
28418
|
if (!sessionRef.current.extractSessionId && state.projectPath) {
|
|
28813
28419
|
if (extractPromiseRef.current) update({ step: "extracting" });
|
|
@@ -28956,7 +28562,13 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
|
|
|
28956
28562
|
});
|
|
28957
28563
|
return;
|
|
28958
28564
|
}
|
|
28959
|
-
update({
|
|
28565
|
+
update({
|
|
28566
|
+
step: "error",
|
|
28567
|
+
errorStep: "apply preview",
|
|
28568
|
+
errorMessage: `${e.message}
|
|
28569
|
+
|
|
28570
|
+
Re-run the import and enter credentials again.`
|
|
28571
|
+
});
|
|
28960
28572
|
return;
|
|
28961
28573
|
}
|
|
28962
28574
|
if (e.status === 404) {
|
|
@@ -29228,7 +28840,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
29228
28840
|
const runSaveAndPush = async (statePatch = {}) => {
|
|
29229
28841
|
await startSaveFlow({ skipGate: true, andPush: true }, statePatch);
|
|
29230
28842
|
};
|
|
29231
|
-
const pendingSaveOptionsRef =
|
|
28843
|
+
const pendingSaveOptionsRef = useRef9({});
|
|
29232
28844
|
const startSaveFlow = async (opts = {}, statePatch = {}) => {
|
|
29233
28845
|
pendingSaveOptionsRef.current = opts;
|
|
29234
28846
|
update({ ...statePatch, step: "path-prompt" });
|
|
@@ -29291,7 +28903,8 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
29291
28903
|
void runPreview(extractSessionId, tokensPath, state.spaceId, state.environmentId, state.cmaToken, state.host);
|
|
29292
28904
|
}
|
|
29293
28905
|
};
|
|
29294
|
-
const tokenReuseChecked =
|
|
28906
|
+
const tokenReuseChecked = useRef9(false);
|
|
28907
|
+
const [tokenReuseSettled, setTokenReuseSettled] = useState19(!state.rawTokensPath);
|
|
29295
28908
|
useEffect14(() => {
|
|
29296
28909
|
if (state.rawTokensPath) {
|
|
29297
28910
|
if (tokenReuseChecked.current) return;
|
|
@@ -29301,6 +28914,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
29301
28914
|
tokenGenerationPromiseRef.current = runAgentAuthCheck("credentials").then(
|
|
29302
28915
|
(ok2) => ok2 ? runGenerateTokens(state.rawTokensPath, state.outDir) : false
|
|
29303
28916
|
);
|
|
28917
|
+
setTokenReuseSettled(true);
|
|
29304
28918
|
return;
|
|
29305
28919
|
}
|
|
29306
28920
|
(async () => {
|
|
@@ -29320,10 +28934,18 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
29320
28934
|
tokenGenerationPromiseRef.current = runAgentAuthCheck("credentials").then(
|
|
29321
28935
|
(ok2) => ok2 ? runGenerateTokens(state.rawTokensPath, state.outDir) : false
|
|
29322
28936
|
);
|
|
28937
|
+
setTokenReuseSettled(true);
|
|
29323
28938
|
}
|
|
29324
28939
|
})();
|
|
29325
28940
|
}
|
|
29326
28941
|
}, [state.rawTokensPath]);
|
|
28942
|
+
const credentialsHandedOff = useRef9(false);
|
|
28943
|
+
useEffect14(() => {
|
|
28944
|
+
if (state.step !== "credentials" || !tokenReuseSettled || credentialsHandedOff.current) return;
|
|
28945
|
+
credentialsHandedOff.current = true;
|
|
28946
|
+
if (process.env["EDS_IMPORT_SKIP_CREDENTIALS"] === "1") update({ credentialsSkipped: true });
|
|
28947
|
+
void advanceAfterCredentialsValidated();
|
|
28948
|
+
}, [state.step, tokenReuseSettled]);
|
|
29327
28949
|
const noQuitSteps = [
|
|
29328
28950
|
"checking-claude-auth",
|
|
29329
28951
|
"validating-credentials",
|
|
@@ -29342,7 +28964,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
29342
28964
|
const stepContent = (() => {
|
|
29343
28965
|
switch (state.step) {
|
|
29344
28966
|
case "token-reuse-gate":
|
|
29345
|
-
return /* @__PURE__ */
|
|
28967
|
+
return /* @__PURE__ */ jsx47(
|
|
29346
28968
|
GateStep,
|
|
29347
28969
|
{
|
|
29348
28970
|
successMessage: "Existing tokens.json found",
|
|
@@ -29355,13 +28977,17 @@ Tokens Path: ${state.tokensPath}`,
|
|
|
29355
28977
|
continueLabel: "Reuse existing tokens",
|
|
29356
28978
|
skipLabel: "Regenerate tokens",
|
|
29357
28979
|
showSkip: true,
|
|
29358
|
-
onContinue: () =>
|
|
29359
|
-
|
|
29360
|
-
|
|
29361
|
-
|
|
29362
|
-
|
|
28980
|
+
onContinue: () => {
|
|
28981
|
+
setTokenReuseSettled(true);
|
|
28982
|
+
update({
|
|
28983
|
+
step: "credentials",
|
|
28984
|
+
tokenSessionId: null,
|
|
28985
|
+
tokenGenerationStatus: "complete"
|
|
28986
|
+
});
|
|
28987
|
+
},
|
|
29363
28988
|
onSkip: async () => {
|
|
29364
28989
|
update({ tokenSourceChanged: null });
|
|
28990
|
+
setTokenReuseSettled(true);
|
|
29365
28991
|
update({ step: "credentials" });
|
|
29366
28992
|
if (await runAgentAuthCheck("credentials")) {
|
|
29367
28993
|
tokenGenerationPromiseRef.current = runGenerateTokens(state.rawTokensPath, state.outDir, true);
|
|
@@ -29371,7 +28997,7 @@ Tokens Path: ${state.tokensPath}`,
|
|
|
29371
28997
|
}
|
|
29372
28998
|
);
|
|
29373
28999
|
case "checking-claude-auth":
|
|
29374
|
-
return /* @__PURE__ */
|
|
29000
|
+
return /* @__PURE__ */ jsx47(
|
|
29375
29001
|
RunningStep,
|
|
29376
29002
|
{
|
|
29377
29003
|
stepNumber: state.authCheckStepNumber,
|
|
@@ -29398,7 +29024,7 @@ Tokens Path: ${state.tokensPath}`,
|
|
|
29398
29024
|
}
|
|
29399
29025
|
const selectionDetail = state.selectionAgentStatus === "complete" ? "Selection agent complete" : `Filtering component selection via ${state.agent}...`;
|
|
29400
29026
|
const compositionDetail = state.compositionPhase === "cache-hit" ? "Composition mapping (cached)" : compositionComplete ? "Composition mapping complete" : state.compositionPhase?.startsWith("agent:") ? `Mapping composition via ${state.compositionPhase.slice("agent:".length)}...` : `Mapping composition via ${state.agent}...`;
|
|
29401
|
-
return /* @__PURE__ */
|
|
29027
|
+
return /* @__PURE__ */ jsx47(
|
|
29402
29028
|
RunningStep,
|
|
29403
29029
|
{
|
|
29404
29030
|
stepNumber: hasTokenStage ? 2 : 1,
|
|
@@ -29420,7 +29046,7 @@ Tokens Path: ${state.tokensPath}`,
|
|
|
29420
29046
|
}
|
|
29421
29047
|
case "scope-gate": {
|
|
29422
29048
|
if (!state.extractSessionId) {
|
|
29423
|
-
return /* @__PURE__ */
|
|
29049
|
+
return /* @__PURE__ */ jsx47(Box38, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx47(Text40, { color: PALETTE.error, children: "Error: extract session ID missing \u2014 please re-run." }) });
|
|
29424
29050
|
}
|
|
29425
29051
|
const sessionId2 = state.extractSessionId;
|
|
29426
29052
|
const db = openPipelineDb();
|
|
@@ -29436,7 +29062,7 @@ Tokens Path: ${state.tokensPath}`,
|
|
|
29436
29062
|
}
|
|
29437
29063
|
const rememberedForSession = scopeComponentsRef.current?.sessionId === sessionId2 ? scopeComponentsRef.current.components : null;
|
|
29438
29064
|
const components = scopeGateCompletedRef.current && rememberedForSession ? rememberedForSession : loadedComponents.length > 0 ? loadedComponents : rememberedForSession ?? [];
|
|
29439
|
-
return /* @__PURE__ */
|
|
29065
|
+
return /* @__PURE__ */ jsx47(
|
|
29440
29066
|
ScopeGateStep,
|
|
29441
29067
|
{
|
|
29442
29068
|
components,
|
|
@@ -29532,7 +29158,7 @@ Tokens Path: ${state.tokensPath}`,
|
|
|
29532
29158
|
const displayAgent = state.agent.charAt(0).toUpperCase() + state.agent.slice(1);
|
|
29533
29159
|
const progressDetail = p ? `${p.current}` : `Starting up ${displayAgent}...`;
|
|
29534
29160
|
const mapTokensDetail = state.mapTokensStatus === "running" ? skipMapTokens ? "Resolving token defaults..." : `Mapping token restrictions via ${displayAgent}...` : state.mapTokensStatus === "complete" ? skipMapTokens ? "Token defaults ready" : "Token restrictions ready" : void 0;
|
|
29535
|
-
return /* @__PURE__ */
|
|
29161
|
+
return /* @__PURE__ */ jsx47(
|
|
29536
29162
|
RunningStep,
|
|
29537
29163
|
{
|
|
29538
29164
|
stepNumber: stepNum,
|
|
@@ -29549,7 +29175,7 @@ ${displayAgent} is mapping your selected components to Contentful's Component De
|
|
|
29549
29175
|
}
|
|
29550
29176
|
case "mapping-tokens": {
|
|
29551
29177
|
const stepNum = hasTokenStage ? 5 : 4;
|
|
29552
|
-
return /* @__PURE__ */
|
|
29178
|
+
return /* @__PURE__ */ jsx47(
|
|
29553
29179
|
RunningStep,
|
|
29554
29180
|
{
|
|
29555
29181
|
stepNumber: stepNum,
|
|
@@ -29561,7 +29187,7 @@ ${displayAgent} is mapping your selected components to Contentful's Component De
|
|
|
29561
29187
|
);
|
|
29562
29188
|
}
|
|
29563
29189
|
case "final-review": {
|
|
29564
|
-
return /* @__PURE__ */
|
|
29190
|
+
return /* @__PURE__ */ jsx47(
|
|
29565
29191
|
GenerateReviewStep,
|
|
29566
29192
|
{
|
|
29567
29193
|
extractSessionId: state.extractSessionId,
|
|
@@ -29619,42 +29245,17 @@ ${displayAgent} is mapping your selected components to Contentful's Component De
|
|
|
29619
29245
|
);
|
|
29620
29246
|
}
|
|
29621
29247
|
case "credentials":
|
|
29622
|
-
return /* @__PURE__ */
|
|
29623
|
-
|
|
29248
|
+
return /* @__PURE__ */ jsx47(
|
|
29249
|
+
RunningStep,
|
|
29624
29250
|
{
|
|
29625
|
-
|
|
29626
|
-
|
|
29627
|
-
|
|
29628
|
-
|
|
29629
|
-
error: state.credentialsError || void 0,
|
|
29630
|
-
validating: state.credentialsValidating,
|
|
29631
|
-
backgroundValidating: state.credentialsBackgroundValidating,
|
|
29632
|
-
generatePrefetchStatus: state.generatePrefetchStatus,
|
|
29633
|
-
generatePrefetchError: state.generatePrefetchError,
|
|
29634
|
-
onConfirm: (spaceId, environmentId, cmaToken, host2) => {
|
|
29635
|
-
void confirmCredentials(spaceId, environmentId, cmaToken, host2);
|
|
29636
|
-
},
|
|
29637
|
-
onValuesChange: handleCredentialValuesChange,
|
|
29638
|
-
onContinue: (spaceId, environmentId, cmaToken, host2) => {
|
|
29639
|
-
void confirmCredentials(spaceId, environmentId, cmaToken, host2);
|
|
29640
|
-
},
|
|
29641
|
-
onRetryPrefetch: state.generatePrefetchStatus === "failed" && sessionRef.current.extractSessionId ? () => {
|
|
29642
|
-
const sid = sessionRef.current.extractSessionId;
|
|
29643
|
-
void startGeneratePrefetch(sid, state.tokensPath);
|
|
29644
|
-
} : void 0,
|
|
29645
|
-
onSkip: () => {
|
|
29646
|
-
update({ credentialsSkipped: true, credentialsError: "" });
|
|
29647
|
-
credentialsReadyRef.current = true;
|
|
29648
|
-
void advanceAfterCredentialsValidated();
|
|
29649
|
-
},
|
|
29650
|
-
onQuit: () => {
|
|
29651
|
-
cancelGeneratePrefetch();
|
|
29652
|
-
process.exit(0);
|
|
29653
|
-
}
|
|
29251
|
+
stepNumber: 1,
|
|
29252
|
+
totalSteps,
|
|
29253
|
+
title: "Starting import",
|
|
29254
|
+
description: "Using the credentials you just confirmed..."
|
|
29654
29255
|
}
|
|
29655
29256
|
);
|
|
29656
29257
|
case "previewing":
|
|
29657
|
-
return /* @__PURE__ */
|
|
29258
|
+
return /* @__PURE__ */ jsx47(
|
|
29658
29259
|
RunningStep,
|
|
29659
29260
|
{
|
|
29660
29261
|
stepNumber: totalSteps,
|
|
@@ -29665,7 +29266,7 @@ ${displayAgent} is mapping your selected components to Contentful's Component De
|
|
|
29665
29266
|
);
|
|
29666
29267
|
case "preview-gate": {
|
|
29667
29268
|
const editableComponentCount = extractComponents(state.cdf).length;
|
|
29668
|
-
return /* @__PURE__ */
|
|
29269
|
+
return /* @__PURE__ */ jsx47(
|
|
29669
29270
|
WizardPreviewStep,
|
|
29670
29271
|
{
|
|
29671
29272
|
preview: state.serverPreview,
|
|
@@ -29690,9 +29291,9 @@ ${displayAgent} is mapping your selected components to Contentful's Component De
|
|
|
29690
29291
|
);
|
|
29691
29292
|
}
|
|
29692
29293
|
case "pushing":
|
|
29693
|
-
return /* @__PURE__ */
|
|
29294
|
+
return /* @__PURE__ */ jsx47(PushingStep, { stepNumber: totalSteps, totalSteps, progress: state.pushProgress });
|
|
29694
29295
|
case "path-prompt":
|
|
29695
|
-
return /* @__PURE__ */
|
|
29296
|
+
return /* @__PURE__ */ jsx47(
|
|
29696
29297
|
PathPrompt,
|
|
29697
29298
|
{
|
|
29698
29299
|
defaultPath: state.outDir,
|
|
@@ -29713,7 +29314,7 @@ ${displayAgent} is mapping your selected components to Contentful's Component De
|
|
|
29713
29314
|
}
|
|
29714
29315
|
);
|
|
29715
29316
|
case "printing":
|
|
29716
|
-
return /* @__PURE__ */
|
|
29317
|
+
return /* @__PURE__ */ jsx47(
|
|
29717
29318
|
RunningStep,
|
|
29718
29319
|
{
|
|
29719
29320
|
stepNumber: totalSteps,
|
|
@@ -29724,7 +29325,7 @@ ${displayAgent} is mapping your selected components to Contentful's Component De
|
|
|
29724
29325
|
);
|
|
29725
29326
|
case "print-gate": {
|
|
29726
29327
|
const teaser = buildRunTeaserLine(state.lastRunId);
|
|
29727
|
-
return /* @__PURE__ */
|
|
29328
|
+
return /* @__PURE__ */ jsx47(
|
|
29728
29329
|
GateStep,
|
|
29729
29330
|
{
|
|
29730
29331
|
successMessage: "Files saved",
|
|
@@ -29741,7 +29342,7 @@ ${displayAgent} is mapping your selected components to Contentful's Component De
|
|
|
29741
29342
|
}
|
|
29742
29343
|
case "done": {
|
|
29743
29344
|
const totalFailed = state.pushResult.componentTypes.failed + state.pushResult.designTokens.failed;
|
|
29744
|
-
return /* @__PURE__ */
|
|
29345
|
+
return /* @__PURE__ */ jsx47(
|
|
29745
29346
|
DoneStep,
|
|
29746
29347
|
{
|
|
29747
29348
|
componentTypes: state.pushResult.componentTypes,
|
|
@@ -29756,7 +29357,7 @@ ${displayAgent} is mapping your selected components to Contentful's Component De
|
|
|
29756
29357
|
);
|
|
29757
29358
|
}
|
|
29758
29359
|
case "preview-validation-error": {
|
|
29759
|
-
return /* @__PURE__ */
|
|
29360
|
+
return /* @__PURE__ */ jsx47(
|
|
29760
29361
|
PreviewValidationErrorStep,
|
|
29761
29362
|
{
|
|
29762
29363
|
errors: state.previewValidationErrors,
|
|
@@ -29772,13 +29373,12 @@ ${displayAgent} is mapping your selected components to Contentful's Component De
|
|
|
29772
29373
|
);
|
|
29773
29374
|
}
|
|
29774
29375
|
case "error":
|
|
29775
|
-
return /* @__PURE__ */
|
|
29376
|
+
return /* @__PURE__ */ jsx47(
|
|
29776
29377
|
ErrorStep,
|
|
29777
29378
|
{
|
|
29778
29379
|
stepName: state.errorStep,
|
|
29779
29380
|
message: state.errorMessage,
|
|
29780
29381
|
onExit: () => process.exit(1),
|
|
29781
|
-
onRetryCredentials: state.errorAllowCredentialRetry ? () => update({ step: "credentials", credentialsError: "" }) : void 0,
|
|
29782
29382
|
onAcknowledgeBreakingChanges: state.errorAllowBreakingChangeAcknowledgment && state.cdf ? () => void runPush(
|
|
29783
29383
|
state.cdf,
|
|
29784
29384
|
state.spaceId,
|
|
@@ -29794,9 +29394,9 @@ ${displayAgent} is mapping your selected components to Contentful's Component De
|
|
|
29794
29394
|
return null;
|
|
29795
29395
|
}
|
|
29796
29396
|
})();
|
|
29797
|
-
return /* @__PURE__ */
|
|
29798
|
-
/* @__PURE__ */
|
|
29799
|
-
/* @__PURE__ */
|
|
29397
|
+
return /* @__PURE__ */ jsxs39(Box38, { flexDirection: "column", width: terminalWidth, children: [
|
|
29398
|
+
/* @__PURE__ */ jsx47(TopBar, { subcommand: "import", hints }),
|
|
29399
|
+
/* @__PURE__ */ jsx47(CustomPromptBanner, { generatePromptPath }),
|
|
29800
29400
|
stepContent
|
|
29801
29401
|
] });
|
|
29802
29402
|
}
|
|
@@ -29807,7 +29407,6 @@ var init_WizardApp = __esm({
|
|
|
29807
29407
|
init_theme();
|
|
29808
29408
|
init_run_teaser();
|
|
29809
29409
|
init_debug_logger();
|
|
29810
|
-
init_credentials_store();
|
|
29811
29410
|
init_path_prompt();
|
|
29812
29411
|
init_save_path_resolver();
|
|
29813
29412
|
init_store();
|
|
@@ -29816,7 +29415,6 @@ var init_WizardApp = __esm({
|
|
|
29816
29415
|
init_CustomPromptBanner();
|
|
29817
29416
|
init_RunningStep();
|
|
29818
29417
|
init_GateStep();
|
|
29819
|
-
init_CredentialsStep();
|
|
29820
29418
|
init_WizardPreviewStep();
|
|
29821
29419
|
init_DoneStep();
|
|
29822
29420
|
init_ErrorStep();
|
|
@@ -30322,9 +29920,9 @@ var init_command7 = __esm({
|
|
|
30322
29920
|
});
|
|
30323
29921
|
|
|
30324
29922
|
// packages/experience-design-system-cli-legacy/src/setup/SetupStepper.tsx
|
|
30325
|
-
import
|
|
30326
|
-
import { Box as
|
|
30327
|
-
import { jsx as
|
|
29923
|
+
import React13 from "react";
|
|
29924
|
+
import { Box as Box39, Text as Text41 } from "ink";
|
|
29925
|
+
import { jsx as jsx48, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
30328
29926
|
function stepLabel(step, title, state, wide) {
|
|
30329
29927
|
if (state === "complete") return wide ? `\u2713 ${title}` : "\u2713";
|
|
30330
29928
|
if (state === "active") return wide ? `[${step} ${title}]` : `[${step}]`;
|
|
@@ -30337,12 +29935,12 @@ function stepColor(state) {
|
|
|
30337
29935
|
}
|
|
30338
29936
|
function SetupStepper({ activeStep, columns }) {
|
|
30339
29937
|
const wide = columns !== void 0 && columns >= WIDE_MIN_COLUMNS;
|
|
30340
|
-
return /* @__PURE__ */
|
|
29938
|
+
return /* @__PURE__ */ jsx48(Box39, { columnGap: wide ? 0 : COMPACT_GAP, children: SETUP_SCREENS.map((title, index) => {
|
|
30341
29939
|
const step = index + 1;
|
|
30342
29940
|
const state = step < activeStep ? "complete" : step === activeStep ? "active" : "pending";
|
|
30343
|
-
return /* @__PURE__ */
|
|
30344
|
-
wide && index > 0 && /* @__PURE__ */
|
|
30345
|
-
/* @__PURE__ */
|
|
29941
|
+
return /* @__PURE__ */ jsxs40(React13.Fragment, { children: [
|
|
29942
|
+
wide && index > 0 && /* @__PURE__ */ jsx48(Text41, { color: PALETTE.muted, children: WIDE_SEPARATOR }),
|
|
29943
|
+
/* @__PURE__ */ jsx48(Text41, { bold: state === "active", color: state === "pending" ? PALETTE.muted : stepColor(state), children: stepLabel(step, title, state, wide) })
|
|
30346
29944
|
] }, step);
|
|
30347
29945
|
}) });
|
|
30348
29946
|
}
|
|
@@ -30361,33 +29959,33 @@ var init_SetupStepper = __esm({
|
|
|
30361
29959
|
});
|
|
30362
29960
|
|
|
30363
29961
|
// packages/experience-design-system-cli-legacy/src/setup/steps/StepLayout.tsx
|
|
30364
|
-
import { Box as
|
|
30365
|
-
import { jsx as
|
|
29962
|
+
import { Box as Box40, Text as Text42 } from "ink";
|
|
29963
|
+
import { jsx as jsx49, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
30366
29964
|
function StepLayout({ helpText, children, prompt }) {
|
|
30367
|
-
return /* @__PURE__ */
|
|
29965
|
+
return /* @__PURE__ */ jsxs41(Box40, { flexDirection: "column", children: [
|
|
30368
29966
|
children,
|
|
30369
|
-
prompt && /* @__PURE__ */
|
|
30370
|
-
helpText && /* @__PURE__ */
|
|
29967
|
+
prompt && /* @__PURE__ */ jsx49(Box40, { marginTop: 1, children: prompt }),
|
|
29968
|
+
helpText && /* @__PURE__ */ jsx49(Box40, { marginTop: 1, children: /* @__PURE__ */ jsx49(Text42, { color: PALETTE.muted, children: helpText }) })
|
|
30371
29969
|
] });
|
|
30372
29970
|
}
|
|
30373
29971
|
function StepSuccess({ children }) {
|
|
30374
|
-
return /* @__PURE__ */
|
|
29972
|
+
return /* @__PURE__ */ jsxs41(Text42, { color: PALETTE.success, children: [
|
|
30375
29973
|
"\u2713 ",
|
|
30376
29974
|
children
|
|
30377
29975
|
] });
|
|
30378
29976
|
}
|
|
30379
29977
|
function StepWarning({ children }) {
|
|
30380
|
-
return /* @__PURE__ */
|
|
29978
|
+
return /* @__PURE__ */ jsxs41(Text42, { color: PALETTE.warning, children: [
|
|
30381
29979
|
"\u26A0 ",
|
|
30382
29980
|
children
|
|
30383
29981
|
] });
|
|
30384
29982
|
}
|
|
30385
29983
|
function StepValue({ label, value }) {
|
|
30386
29984
|
const color = value ? void 0 : PALETTE.warning;
|
|
30387
|
-
return /* @__PURE__ */
|
|
30388
|
-
/* @__PURE__ */
|
|
30389
|
-
/* @__PURE__ */
|
|
30390
|
-
/* @__PURE__ */
|
|
29985
|
+
return /* @__PURE__ */ jsxs41(Box40, { children: [
|
|
29986
|
+
/* @__PURE__ */ jsx49(Box40, { width: 2, children: /* @__PURE__ */ jsx49(Text42, { color, children: value ? "" : "\u26A0" }) }),
|
|
29987
|
+
/* @__PURE__ */ jsx49(Box40, { width: 20, flexShrink: 0, children: /* @__PURE__ */ jsx49(Text42, { color, children: label }) }),
|
|
29988
|
+
/* @__PURE__ */ jsx49(Text42, { color, children: value || "(not set)" })
|
|
30391
29989
|
] });
|
|
30392
29990
|
}
|
|
30393
29991
|
var init_StepLayout = __esm({
|
|
@@ -30398,10 +29996,10 @@ var init_StepLayout = __esm({
|
|
|
30398
29996
|
});
|
|
30399
29997
|
|
|
30400
29998
|
// packages/experience-design-system-cli-legacy/src/setup/steps/CodingAgentScreen.tsx
|
|
30401
|
-
import { useEffect as useEffect15, useRef as
|
|
30402
|
-
import { Box as
|
|
29999
|
+
import { useEffect as useEffect15, useRef as useRef10, useState as useState20 } from "react";
|
|
30000
|
+
import { Box as Box41, Text as Text43 } from "ink";
|
|
30403
30001
|
import { Select, TextInput } from "@inkjs/ui";
|
|
30404
|
-
import { jsx as
|
|
30002
|
+
import { jsx as jsx50, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
30405
30003
|
async function detectAgents(exists = binaryExists) {
|
|
30406
30004
|
const found = await Promise.all(AGENT_DEFS.map(async (agent) => await exists(agent.binary) ? agent : void 0));
|
|
30407
30005
|
return found.filter((agent) => agent !== void 0);
|
|
@@ -30411,9 +30009,9 @@ function needsCodexModel(agent, env) {
|
|
|
30411
30009
|
}
|
|
30412
30010
|
function CodingAgentScreen({ onDone, deps }) {
|
|
30413
30011
|
const { binaryExists: exists, run, env } = deps ?? { binaryExists, run: runSpawn, env: process.env };
|
|
30414
|
-
const [phase, setPhase] =
|
|
30415
|
-
const [notes, setNotes] =
|
|
30416
|
-
const startedRef =
|
|
30012
|
+
const [phase, setPhase] = useState20({ kind: "detecting" });
|
|
30013
|
+
const [notes, setNotes] = useState20([]);
|
|
30014
|
+
const startedRef = useRef10(false);
|
|
30417
30015
|
const save = async (agent, agentModel) => {
|
|
30418
30016
|
const stored = await readExperiencesCredentials();
|
|
30419
30017
|
const { agentModel: _stale, ...rest } = stored;
|
|
@@ -30434,7 +30032,7 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
30434
30032
|
const found = await detectAgents(exists);
|
|
30435
30033
|
if (found.length === 1) {
|
|
30436
30034
|
const only = found[0];
|
|
30437
|
-
setNotes([/* @__PURE__ */
|
|
30035
|
+
setNotes([/* @__PURE__ */ jsx50(StepSuccess, { children: `${only.name} (${only.binary}) found` }, "found")]);
|
|
30438
30036
|
afterSelection(only);
|
|
30439
30037
|
return;
|
|
30440
30038
|
}
|
|
@@ -30442,7 +30040,7 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
30442
30040
|
setPhase({ kind: "choose", found });
|
|
30443
30041
|
return;
|
|
30444
30042
|
}
|
|
30445
|
-
setNotes([/* @__PURE__ */
|
|
30043
|
+
setNotes([/* @__PURE__ */ jsx50(StepWarning, { children: "No coding agent found on PATH" }, "none")]);
|
|
30446
30044
|
setPhase({ kind: "install-choice" });
|
|
30447
30045
|
})();
|
|
30448
30046
|
}, []);
|
|
@@ -30454,12 +30052,12 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
30454
30052
|
onDone("failed");
|
|
30455
30053
|
return;
|
|
30456
30054
|
}
|
|
30457
|
-
setNotes((current) => [...current, /* @__PURE__ */
|
|
30055
|
+
setNotes((current) => [...current, /* @__PURE__ */ jsx50(StepSuccess, { children: `${agent.name} installed` }, "installed")]);
|
|
30458
30056
|
afterSelection(agent);
|
|
30459
30057
|
};
|
|
30460
|
-
const chooser = (question, options, describe, onPick) => /* @__PURE__ */
|
|
30461
|
-
/* @__PURE__ */
|
|
30462
|
-
/* @__PURE__ */
|
|
30058
|
+
const chooser = (question, options, describe, onPick) => /* @__PURE__ */ jsxs42(Box41, { flexDirection: "column", children: [
|
|
30059
|
+
/* @__PURE__ */ jsx50(Text43, { children: question }),
|
|
30060
|
+
/* @__PURE__ */ jsx50(Box41, { marginTop: 1, children: /* @__PURE__ */ jsx50(
|
|
30463
30061
|
Select,
|
|
30464
30062
|
{
|
|
30465
30063
|
options: [
|
|
@@ -30471,7 +30069,7 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
30471
30069
|
) })
|
|
30472
30070
|
] });
|
|
30473
30071
|
if (phase.kind === "choose") {
|
|
30474
|
-
return /* @__PURE__ */
|
|
30072
|
+
return /* @__PURE__ */ jsx50(
|
|
30475
30073
|
StepLayout,
|
|
30476
30074
|
{
|
|
30477
30075
|
helpText: AGENT_HELP,
|
|
@@ -30486,7 +30084,7 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
30486
30084
|
);
|
|
30487
30085
|
}
|
|
30488
30086
|
if (phase.kind === "install-choice") {
|
|
30489
|
-
return /* @__PURE__ */
|
|
30087
|
+
return /* @__PURE__ */ jsx50(
|
|
30490
30088
|
StepLayout,
|
|
30491
30089
|
{
|
|
30492
30090
|
helpText: AGENT_HELP,
|
|
@@ -30501,13 +30099,13 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
30501
30099
|
);
|
|
30502
30100
|
}
|
|
30503
30101
|
if (phase.kind === "model") {
|
|
30504
|
-
return /* @__PURE__ */
|
|
30102
|
+
return /* @__PURE__ */ jsx50(
|
|
30505
30103
|
StepLayout,
|
|
30506
30104
|
{
|
|
30507
30105
|
helpText: AGENT_HELP,
|
|
30508
|
-
prompt: /* @__PURE__ */
|
|
30509
|
-
/* @__PURE__ */
|
|
30510
|
-
/* @__PURE__ */
|
|
30106
|
+
prompt: /* @__PURE__ */ jsxs42(Box41, { children: [
|
|
30107
|
+
/* @__PURE__ */ jsx50(Text43, { children: "Model name (optional - press Enter for Codex default): " }),
|
|
30108
|
+
/* @__PURE__ */ jsx50(
|
|
30511
30109
|
TextInput,
|
|
30512
30110
|
{
|
|
30513
30111
|
onSubmit: (value) => void save(phase.agent.binary, value.trim() || void 0)
|
|
@@ -30517,19 +30115,19 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
30517
30115
|
] }),
|
|
30518
30116
|
children: [
|
|
30519
30117
|
...notes,
|
|
30520
|
-
/* @__PURE__ */
|
|
30521
|
-
/* @__PURE__ */
|
|
30118
|
+
/* @__PURE__ */ jsx50(StepWarning, { children: "No OPENAI_API_KEY \u2014 using ChatGPT account authentication." }, "no-key"),
|
|
30119
|
+
/* @__PURE__ */ jsx50(Text43, { color: PALETTE.muted, children: "Tip: run codex then type /model to browse all available models." }, "tip")
|
|
30522
30120
|
]
|
|
30523
30121
|
}
|
|
30524
30122
|
);
|
|
30525
30123
|
}
|
|
30526
30124
|
if (phase.kind === "installing") {
|
|
30527
|
-
return /* @__PURE__ */
|
|
30125
|
+
return /* @__PURE__ */ jsx50(StepLayout, { helpText: AGENT_HELP, children: [...notes, /* @__PURE__ */ jsx50(Text43, { children: `Installing ${phase.agent.name}\u2026` }, "installing")] });
|
|
30528
30126
|
}
|
|
30529
30127
|
if (phase.kind === "failed") {
|
|
30530
|
-
return /* @__PURE__ */
|
|
30128
|
+
return /* @__PURE__ */ jsx50(StepLayout, { helpText: AGENT_HELP, children: [...notes, /* @__PURE__ */ jsx50(Text43, { children: `\u2717 ${phase.message}` }, "failed")] });
|
|
30531
30129
|
}
|
|
30532
|
-
return /* @__PURE__ */
|
|
30130
|
+
return /* @__PURE__ */ jsx50(Text43, { color: PALETTE.muted, children: "Looking for a coding agent\u2026" });
|
|
30533
30131
|
}
|
|
30534
30132
|
var AGENT_HELP, SKIP_VALUE;
|
|
30535
30133
|
var init_CodingAgentScreen = __esm({
|
|
@@ -30546,10 +30144,10 @@ var init_CodingAgentScreen = __esm({
|
|
|
30546
30144
|
});
|
|
30547
30145
|
|
|
30548
30146
|
// packages/experience-design-system-cli-legacy/src/setup/steps/ContentfulCredentialsScreen.tsx
|
|
30549
|
-
import { useEffect as useEffect16, useRef as
|
|
30550
|
-
import { Box as
|
|
30147
|
+
import { useEffect as useEffect16, useRef as useRef11, useState as useState21 } from "react";
|
|
30148
|
+
import { Box as Box42, Text as Text44 } from "ink";
|
|
30551
30149
|
import { PasswordInput, Select as Select2, TextInput as TextInput2 } from "@inkjs/ui";
|
|
30552
|
-
import { Fragment as
|
|
30150
|
+
import { Fragment as Fragment19, jsx as jsx51, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
30553
30151
|
function envShadowingWarning(env) {
|
|
30554
30152
|
const set = ENV_KEYS.filter((key) => env[key]);
|
|
30555
30153
|
if (set.length === 0) return null;
|
|
@@ -30559,28 +30157,28 @@ function maskToken(token) {
|
|
|
30559
30157
|
return `${"\u2022".repeat(Math.min(token.length, 8))}...`;
|
|
30560
30158
|
}
|
|
30561
30159
|
function ContentfulCredentialsScreen({ onDone }) {
|
|
30562
|
-
const [stored, setStored] =
|
|
30563
|
-
const [field, setField] =
|
|
30564
|
-
const enteredRef =
|
|
30565
|
-
const [error, setError] =
|
|
30160
|
+
const [stored, setStored] = useState21(null);
|
|
30161
|
+
const [field, setField] = useState21("confirm");
|
|
30162
|
+
const enteredRef = useRef11({});
|
|
30163
|
+
const [error, setError] = useState21(null);
|
|
30566
30164
|
useEffect16(() => {
|
|
30567
30165
|
void readExperiencesCredentials().then(setStored);
|
|
30568
30166
|
}, []);
|
|
30569
|
-
if (!stored) return /* @__PURE__ */
|
|
30167
|
+
if (!stored) return /* @__PURE__ */ jsx51(Text44, { color: PALETTE.muted, children: "Reading saved credentials\u2026" });
|
|
30570
30168
|
const currentHost = stored.host ?? DEFAULT_CONFIGURED_HOST;
|
|
30571
30169
|
const hasAny = Boolean(stored.spaceId || stored.environmentId || stored.cmaToken);
|
|
30572
30170
|
const allSet = Boolean(stored.spaceId && stored.environmentId && stored.cmaToken);
|
|
30573
30171
|
const shadowing = envShadowingWarning(process.env);
|
|
30574
|
-
const summary = /* @__PURE__ */
|
|
30575
|
-
shadowing && /* @__PURE__ */
|
|
30576
|
-
hasAny && /* @__PURE__ */
|
|
30577
|
-
/* @__PURE__ */
|
|
30578
|
-
/* @__PURE__ */
|
|
30579
|
-
/* @__PURE__ */
|
|
30580
|
-
/* @__PURE__ */
|
|
30581
|
-
/* @__PURE__ */
|
|
30172
|
+
const summary = /* @__PURE__ */ jsxs43(Fragment19, { children: [
|
|
30173
|
+
shadowing && /* @__PURE__ */ jsx51(StepWarning, { children: shadowing }),
|
|
30174
|
+
hasAny && /* @__PURE__ */ jsxs43(Box42, { flexDirection: "column", marginTop: shadowing ? 1 : 0, children: [
|
|
30175
|
+
/* @__PURE__ */ jsx51(Text44, { children: "Current values:" }),
|
|
30176
|
+
/* @__PURE__ */ jsx51(StepValue, { label: "Space ID", value: stored.spaceId }),
|
|
30177
|
+
/* @__PURE__ */ jsx51(StepValue, { label: "Environment ID", value: stored.environmentId }),
|
|
30178
|
+
/* @__PURE__ */ jsx51(StepValue, { label: "CMA Token", value: stored.cmaToken ? maskToken(stored.cmaToken) : void 0 }),
|
|
30179
|
+
/* @__PURE__ */ jsx51(StepValue, { label: "API Host", value: currentHost })
|
|
30582
30180
|
] }),
|
|
30583
|
-
error && /* @__PURE__ */
|
|
30181
|
+
error && /* @__PURE__ */ jsx51(StepWarning, { children: error })
|
|
30584
30182
|
] });
|
|
30585
30183
|
const helpText = `Saved to ${experiencesCredentialsPath()} \u2014 loaded automatically by experiences import.`;
|
|
30586
30184
|
if (field === "confirm") {
|
|
@@ -30588,13 +30186,13 @@ function ContentfulCredentialsScreen({ onDone }) {
|
|
|
30588
30186
|
{ label: hasAny ? "Update the saved credentials" : "Enter credentials now", value: ENTER },
|
|
30589
30187
|
{ label: allSet ? "Keep them as they are" : "Skip for now", value: KEEP }
|
|
30590
30188
|
];
|
|
30591
|
-
return /* @__PURE__ */
|
|
30189
|
+
return /* @__PURE__ */ jsx51(
|
|
30592
30190
|
StepLayout,
|
|
30593
30191
|
{
|
|
30594
30192
|
helpText,
|
|
30595
|
-
prompt: /* @__PURE__ */
|
|
30596
|
-
/* @__PURE__ */
|
|
30597
|
-
/* @__PURE__ */
|
|
30193
|
+
prompt: /* @__PURE__ */ jsxs43(Box42, { flexDirection: "column", children: [
|
|
30194
|
+
/* @__PURE__ */ jsx51(Text44, { children: "Contentful credentials" }),
|
|
30195
|
+
/* @__PURE__ */ jsx51(Box42, { marginTop: 1, children: /* @__PURE__ */ jsx51(
|
|
30598
30196
|
Select2,
|
|
30599
30197
|
{
|
|
30600
30198
|
options: allSet ? [...options].reverse() : options,
|
|
@@ -30635,24 +30233,24 @@ function ContentfulCredentialsScreen({ onDone }) {
|
|
|
30635
30233
|
onDone("completed");
|
|
30636
30234
|
};
|
|
30637
30235
|
const prompts = {
|
|
30638
|
-
spaceId: /* @__PURE__ */
|
|
30639
|
-
/* @__PURE__ */
|
|
30640
|
-
/* @__PURE__ */
|
|
30236
|
+
spaceId: /* @__PURE__ */ jsxs43(Box42, { children: [
|
|
30237
|
+
/* @__PURE__ */ jsx51(Text44, { children: `Space ID${stored.spaceId ? ` [${stored.spaceId}]` : ""}: ` }),
|
|
30238
|
+
/* @__PURE__ */ jsx51(TextInput2, { onSubmit: (v) => advance("spaceId", v) }, "spaceId")
|
|
30641
30239
|
] }),
|
|
30642
|
-
environmentId: /* @__PURE__ */
|
|
30643
|
-
/* @__PURE__ */
|
|
30644
|
-
/* @__PURE__ */
|
|
30240
|
+
environmentId: /* @__PURE__ */ jsxs43(Box42, { children: [
|
|
30241
|
+
/* @__PURE__ */ jsx51(Text44, { children: `Environment ID [${stored.environmentId || "master"}]: ` }),
|
|
30242
|
+
/* @__PURE__ */ jsx51(TextInput2, { onSubmit: (v) => advance("environmentId", v) }, "environmentId")
|
|
30645
30243
|
] }),
|
|
30646
|
-
cmaToken: /* @__PURE__ */
|
|
30647
|
-
/* @__PURE__ */
|
|
30648
|
-
/* @__PURE__ */
|
|
30244
|
+
cmaToken: /* @__PURE__ */ jsxs43(Box42, { children: [
|
|
30245
|
+
/* @__PURE__ */ jsx51(Text44, { children: `CMA token${stored.cmaToken ? " [press Enter to keep existing]" : " (paste here)"}: ` }),
|
|
30246
|
+
/* @__PURE__ */ jsx51(PasswordInput, { onSubmit: (v) => advance("cmaToken", v) }, "cmaToken")
|
|
30649
30247
|
] }),
|
|
30650
|
-
host: /* @__PURE__ */
|
|
30651
|
-
/* @__PURE__ */
|
|
30652
|
-
/* @__PURE__ */
|
|
30248
|
+
host: /* @__PURE__ */ jsxs43(Box42, { children: [
|
|
30249
|
+
/* @__PURE__ */ jsx51(Text44, { children: `API host [${currentHost}]: ` }),
|
|
30250
|
+
/* @__PURE__ */ jsx51(TextInput2, { onSubmit: (v) => advance("host", v) }, "host")
|
|
30653
30251
|
] })
|
|
30654
30252
|
};
|
|
30655
|
-
return /* @__PURE__ */
|
|
30253
|
+
return /* @__PURE__ */ jsx51(StepLayout, { helpText, prompt: prompts[field], children: summary });
|
|
30656
30254
|
}
|
|
30657
30255
|
var ENV_KEYS, ENTER, KEEP, FIELD_ORDER;
|
|
30658
30256
|
var init_ContentfulCredentialsScreen = __esm({
|
|
@@ -30670,10 +30268,10 @@ var init_ContentfulCredentialsScreen = __esm({
|
|
|
30670
30268
|
});
|
|
30671
30269
|
|
|
30672
30270
|
// packages/experience-design-system-cli-legacy/src/setup/steps/preferences/BooleanInput.tsx
|
|
30673
|
-
import { useEffect as useEffect17, useState as
|
|
30674
|
-
import { Box as
|
|
30271
|
+
import { useEffect as useEffect17, useState as useState22 } from "react";
|
|
30272
|
+
import { Box as Box43, Text as Text45 } from "ink";
|
|
30675
30273
|
import { Select as Select3 } from "@inkjs/ui";
|
|
30676
|
-
import { jsx as
|
|
30274
|
+
import { jsx as jsx52, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
30677
30275
|
function tick(labels, forOn, current) {
|
|
30678
30276
|
const label = forOn ? labels.on : labels.off;
|
|
30679
30277
|
return forOn === current ? `${label} \u2713` : label;
|
|
@@ -30687,11 +30285,11 @@ function BooleanInput({
|
|
|
30687
30285
|
fallback,
|
|
30688
30286
|
onDone
|
|
30689
30287
|
}) {
|
|
30690
|
-
const [stored, setStored] =
|
|
30288
|
+
const [stored, setStored] = useState22(null);
|
|
30691
30289
|
useEffect17(() => {
|
|
30692
30290
|
void readExperiencesCredentials().then(setStored);
|
|
30693
30291
|
}, []);
|
|
30694
|
-
if (!stored) return /* @__PURE__ */
|
|
30292
|
+
if (!stored) return /* @__PURE__ */ jsx52(Text45, { color: PALETTE.muted, children: "Reading saved preferences\u2026" });
|
|
30695
30293
|
const current = read(stored) ?? fallback;
|
|
30696
30294
|
const submit = (value) => {
|
|
30697
30295
|
if (value === current) {
|
|
@@ -30700,13 +30298,13 @@ function BooleanInput({
|
|
|
30700
30298
|
}
|
|
30701
30299
|
void writeExperiencesCredentials(write2(stored, value)).then(() => onDone("completed"));
|
|
30702
30300
|
};
|
|
30703
|
-
return /* @__PURE__ */
|
|
30301
|
+
return /* @__PURE__ */ jsx52(
|
|
30704
30302
|
StepLayout,
|
|
30705
30303
|
{
|
|
30706
30304
|
helpText,
|
|
30707
|
-
prompt: /* @__PURE__ */
|
|
30708
|
-
/* @__PURE__ */
|
|
30709
|
-
/* @__PURE__ */
|
|
30305
|
+
prompt: /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", children: [
|
|
30306
|
+
/* @__PURE__ */ jsx52(Text45, { children: question }),
|
|
30307
|
+
/* @__PURE__ */ jsx52(Box43, { marginTop: 1, children: /* @__PURE__ */ jsx52(
|
|
30710
30308
|
Select3,
|
|
30711
30309
|
{
|
|
30712
30310
|
options: [
|
|
@@ -30732,9 +30330,9 @@ var init_BooleanInput = __esm({
|
|
|
30732
30330
|
});
|
|
30733
30331
|
|
|
30734
30332
|
// packages/experience-design-system-cli-legacy/src/setup/steps/preferences/AnalyticsScreen.tsx
|
|
30735
|
-
import { jsx as
|
|
30333
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
30736
30334
|
function AnalyticsScreen({ onDone }) {
|
|
30737
|
-
return /* @__PURE__ */
|
|
30335
|
+
return /* @__PURE__ */ jsx53(
|
|
30738
30336
|
BooleanInput,
|
|
30739
30337
|
{
|
|
30740
30338
|
helpText: "Shares anonymous usage data about which CLI commands are used and where imports succeed or fail. Never includes source code, file paths, credentials, or authored content",
|
|
@@ -30755,9 +30353,9 @@ var init_AnalyticsScreen = __esm({
|
|
|
30755
30353
|
});
|
|
30756
30354
|
|
|
30757
30355
|
// packages/experience-design-system-cli-legacy/src/setup/steps/preferences/ColorPreferenceScreen.tsx
|
|
30758
|
-
import { jsx as
|
|
30356
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
30759
30357
|
function ColorPreferenceScreen({ onDone }) {
|
|
30760
|
-
return /* @__PURE__ */
|
|
30358
|
+
return /* @__PURE__ */ jsx54(
|
|
30761
30359
|
BooleanInput,
|
|
30762
30360
|
{
|
|
30763
30361
|
helpText: `Prints plain text with no color, which suits CI logs and basic terminals.`,
|
|
@@ -30778,10 +30376,10 @@ var init_ColorPreferenceScreen = __esm({
|
|
|
30778
30376
|
});
|
|
30779
30377
|
|
|
30780
30378
|
// packages/experience-design-system-cli-legacy/src/setup/steps/preferences/CustomPromptScreen.tsx
|
|
30781
|
-
import { useEffect as useEffect18, useState as
|
|
30782
|
-
import { Box as
|
|
30379
|
+
import { useEffect as useEffect18, useState as useState23 } from "react";
|
|
30380
|
+
import { Box as Box44, Text as Text46 } from "ink";
|
|
30783
30381
|
import { ConfirmInput, TextInput as TextInput3 } from "@inkjs/ui";
|
|
30784
|
-
import { jsx as
|
|
30382
|
+
import { jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
30785
30383
|
function parseCustomSkillPath(answer) {
|
|
30786
30384
|
const trimmed = answer.trim();
|
|
30787
30385
|
if (trimmed === "") return void 0;
|
|
@@ -30798,24 +30396,24 @@ function applyCustomSkillPath(credentials, parsed) {
|
|
|
30798
30396
|
return next;
|
|
30799
30397
|
}
|
|
30800
30398
|
function CustomPromptsScreen({ onDone }) {
|
|
30801
|
-
const [stored, setStored] =
|
|
30802
|
-
const [phase, setPhase] =
|
|
30399
|
+
const [stored, setStored] = useState23(null);
|
|
30400
|
+
const [phase, setPhase] = useState23("confirm");
|
|
30803
30401
|
useEffect18(() => {
|
|
30804
30402
|
void readExperiencesCredentials().then(setStored);
|
|
30805
30403
|
}, []);
|
|
30806
|
-
if (!stored) return /* @__PURE__ */
|
|
30404
|
+
if (!stored) return /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: "Reading saved prompt paths\u2026" });
|
|
30807
30405
|
const submit = (answer) => {
|
|
30808
30406
|
const next = applyCustomSkillPath(stored, parseCustomSkillPath(answer));
|
|
30809
30407
|
void writeExperiencesCredentials(next).then(() => onDone("completed"));
|
|
30810
30408
|
};
|
|
30811
30409
|
if (phase === "confirm") {
|
|
30812
|
-
return /* @__PURE__ */
|
|
30410
|
+
return /* @__PURE__ */ jsx55(
|
|
30813
30411
|
StepLayout,
|
|
30814
30412
|
{
|
|
30815
30413
|
helpText: CUSTOM_PROMPTS_HELP,
|
|
30816
|
-
prompt: /* @__PURE__ */
|
|
30817
|
-
/* @__PURE__ */
|
|
30818
|
-
/* @__PURE__ */
|
|
30414
|
+
prompt: /* @__PURE__ */ jsxs45(Box44, { children: [
|
|
30415
|
+
/* @__PURE__ */ jsx55(Text46, { children: "Use your own prompt file instead of the built-in one? " }),
|
|
30416
|
+
/* @__PURE__ */ jsx55(
|
|
30819
30417
|
ConfirmInput,
|
|
30820
30418
|
{
|
|
30821
30419
|
defaultChoice: "cancel",
|
|
@@ -30827,13 +30425,13 @@ function CustomPromptsScreen({ onDone }) {
|
|
|
30827
30425
|
}
|
|
30828
30426
|
);
|
|
30829
30427
|
}
|
|
30830
|
-
return /* @__PURE__ */
|
|
30428
|
+
return /* @__PURE__ */ jsx55(
|
|
30831
30429
|
StepLayout,
|
|
30832
30430
|
{
|
|
30833
30431
|
helpText: CUSTOM_PROMPTS_HELP,
|
|
30834
|
-
prompt: /* @__PURE__ */
|
|
30835
|
-
/* @__PURE__ */
|
|
30836
|
-
/* @__PURE__ */
|
|
30432
|
+
prompt: /* @__PURE__ */ jsxs45(Box44, { children: [
|
|
30433
|
+
/* @__PURE__ */ jsx55(Text46, { children: customSkillPathQuestion(stored.generatePromptPath) }),
|
|
30434
|
+
/* @__PURE__ */ jsx55(TextInput3, { onSubmit: submit })
|
|
30837
30435
|
] })
|
|
30838
30436
|
}
|
|
30839
30437
|
);
|
|
@@ -30850,9 +30448,9 @@ var init_CustomPromptScreen = __esm({
|
|
|
30850
30448
|
});
|
|
30851
30449
|
|
|
30852
30450
|
// packages/experience-design-system-cli-legacy/src/setup/steps/preferences/DebugLogsScreen.tsx
|
|
30853
|
-
import { jsx as
|
|
30451
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
30854
30452
|
function DebugLogsScreen({ onDone }) {
|
|
30855
|
-
return /* @__PURE__ */
|
|
30453
|
+
return /* @__PURE__ */ jsx56(
|
|
30856
30454
|
BooleanInput,
|
|
30857
30455
|
{
|
|
30858
30456
|
helpText: `Writes a verbose trace of every command decision, for troubleshooting.`,
|
|
@@ -30873,17 +30471,17 @@ var init_DebugLogsScreen = __esm({
|
|
|
30873
30471
|
});
|
|
30874
30472
|
|
|
30875
30473
|
// packages/experience-design-system-cli-legacy/src/setup/steps/preferences/PreferencesMenu.tsx
|
|
30876
|
-
import { useState as
|
|
30877
|
-
import { Box as
|
|
30474
|
+
import { useState as useState24 } from "react";
|
|
30475
|
+
import { Box as Box45, Text as Text47 } from "ink";
|
|
30878
30476
|
import { Select as Select4 } from "@inkjs/ui";
|
|
30879
|
-
import { jsx as
|
|
30477
|
+
import { jsx as jsx57, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
30880
30478
|
function PreferencesMenu({ onDone }) {
|
|
30881
|
-
const [open, setOpen] =
|
|
30882
|
-
const [changed, setChanged] =
|
|
30479
|
+
const [open, setOpen] = useState24(null);
|
|
30480
|
+
const [changed, setChanged] = useState24(/* @__PURE__ */ new Set());
|
|
30883
30481
|
const entry = open === null ? void 0 : PREFERENCE_OPTIONS.find((option) => option.key === open);
|
|
30884
|
-
if (!entry) return /* @__PURE__ */
|
|
30482
|
+
if (!entry) return /* @__PURE__ */ jsx57(PreferenceList, { changed, onOpen: setOpen, onDone });
|
|
30885
30483
|
const { key, Screen } = entry;
|
|
30886
|
-
return /* @__PURE__ */
|
|
30484
|
+
return /* @__PURE__ */ jsx57(
|
|
30887
30485
|
Screen,
|
|
30888
30486
|
{
|
|
30889
30487
|
onDone: (status) => {
|
|
@@ -30895,18 +30493,18 @@ function PreferencesMenu({ onDone }) {
|
|
|
30895
30493
|
);
|
|
30896
30494
|
}
|
|
30897
30495
|
function PreferenceList({ changed, onOpen, onDone }) {
|
|
30898
|
-
const [pick, setPick] =
|
|
30496
|
+
const [pick, setPick] = useState24(0);
|
|
30899
30497
|
const options = [
|
|
30900
30498
|
...PREFERENCE_OPTIONS.map((option) => ({ label: option.label, value: option.key })),
|
|
30901
30499
|
{ label: "Done", value: DONE_VALUE }
|
|
30902
30500
|
];
|
|
30903
|
-
return /* @__PURE__ */
|
|
30501
|
+
return /* @__PURE__ */ jsx57(
|
|
30904
30502
|
StepLayout,
|
|
30905
30503
|
{
|
|
30906
30504
|
helpText: PREFERENCES_MENU_HELP,
|
|
30907
|
-
prompt: /* @__PURE__ */
|
|
30908
|
-
/* @__PURE__ */
|
|
30909
|
-
/* @__PURE__ */
|
|
30505
|
+
prompt: /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", children: [
|
|
30506
|
+
/* @__PURE__ */ jsx57(Text47, { children: "Preferences" }),
|
|
30507
|
+
/* @__PURE__ */ jsx57(Box45, { marginTop: 1, children: /* @__PURE__ */ jsx57(
|
|
30910
30508
|
Select4,
|
|
30911
30509
|
{
|
|
30912
30510
|
options,
|
|
@@ -30939,22 +30537,22 @@ var init_PreferencesMenu = __esm({
|
|
|
30939
30537
|
{
|
|
30940
30538
|
key: "customPrompts",
|
|
30941
30539
|
label: "Custom prompts",
|
|
30942
|
-
Screen: ({ onDone }) => /* @__PURE__ */
|
|
30540
|
+
Screen: ({ onDone }) => /* @__PURE__ */ jsx57(CustomPromptsScreen, { onDone })
|
|
30943
30541
|
},
|
|
30944
30542
|
{
|
|
30945
30543
|
key: "debug",
|
|
30946
30544
|
label: "Debug logging",
|
|
30947
|
-
Screen: ({ onDone }) => /* @__PURE__ */
|
|
30545
|
+
Screen: ({ onDone }) => /* @__PURE__ */ jsx57(DebugLogsScreen, { onDone })
|
|
30948
30546
|
},
|
|
30949
30547
|
{
|
|
30950
30548
|
key: "analytics",
|
|
30951
30549
|
label: "Usage analytics",
|
|
30952
|
-
Screen: ({ onDone }) => /* @__PURE__ */
|
|
30550
|
+
Screen: ({ onDone }) => /* @__PURE__ */ jsx57(AnalyticsScreen, { onDone })
|
|
30953
30551
|
},
|
|
30954
30552
|
{
|
|
30955
30553
|
key: "noColor",
|
|
30956
30554
|
label: "Terminal colors",
|
|
30957
|
-
Screen: ({ onDone }) => /* @__PURE__ */
|
|
30555
|
+
Screen: ({ onDone }) => /* @__PURE__ */ jsx57(ColorPreferenceScreen, { onDone })
|
|
30958
30556
|
}
|
|
30959
30557
|
];
|
|
30960
30558
|
DONE_VALUE = "menu:done";
|
|
@@ -31169,24 +30767,24 @@ var init_prerequisites = __esm({
|
|
|
31169
30767
|
});
|
|
31170
30768
|
|
|
31171
30769
|
// packages/experience-design-system-cli-legacy/src/setup/steps/prerequisites/PrerequisitesScreen.tsx
|
|
31172
|
-
import { useEffect as useEffect19, useRef as
|
|
31173
|
-
import { Box as
|
|
30770
|
+
import { useEffect as useEffect19, useRef as useRef12, useState as useState25 } from "react";
|
|
30771
|
+
import { Box as Box46, Text as Text48 } from "ink";
|
|
31174
30772
|
import { ConfirmInput as ConfirmInput2 } from "@inkjs/ui";
|
|
31175
|
-
import { jsx as
|
|
30773
|
+
import { jsx as jsx58, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
31176
30774
|
function EventLine({ event }) {
|
|
31177
|
-
if (event.kind === "success") return /* @__PURE__ */
|
|
30775
|
+
if (event.kind === "success") return /* @__PURE__ */ jsxs47(Text48, { color: PALETTE.success, children: [
|
|
31178
30776
|
"\u2713 ",
|
|
31179
30777
|
event.message
|
|
31180
30778
|
] });
|
|
31181
|
-
if (event.kind === "failure") return /* @__PURE__ */
|
|
30779
|
+
if (event.kind === "failure") return /* @__PURE__ */ jsxs47(Text48, { color: PALETTE.error, children: [
|
|
31182
30780
|
"\u2717 ",
|
|
31183
30781
|
event.message
|
|
31184
30782
|
] });
|
|
31185
|
-
if (event.kind === "warning") return /* @__PURE__ */
|
|
30783
|
+
if (event.kind === "warning") return /* @__PURE__ */ jsxs47(Text48, { color: PALETTE.warning, children: [
|
|
31186
30784
|
"\u26A0 ",
|
|
31187
30785
|
event.message
|
|
31188
30786
|
] });
|
|
31189
|
-
return /* @__PURE__ */
|
|
30787
|
+
return /* @__PURE__ */ jsx58(Text48, { children: event.message });
|
|
31190
30788
|
}
|
|
31191
30789
|
function PrerequisitesScreen({
|
|
31192
30790
|
repoRoot,
|
|
@@ -31194,9 +30792,9 @@ function PrerequisitesScreen({
|
|
|
31194
30792
|
onDone,
|
|
31195
30793
|
deps
|
|
31196
30794
|
}) {
|
|
31197
|
-
const [events, setEvents] =
|
|
31198
|
-
const [confirm, setConfirm] =
|
|
31199
|
-
const startedRef =
|
|
30795
|
+
const [events, setEvents] = useState25([]);
|
|
30796
|
+
const [confirm, setConfirm] = useState25(null);
|
|
30797
|
+
const startedRef = useRef12(false);
|
|
31200
30798
|
useEffect19(() => {
|
|
31201
30799
|
if (startedRef.current) return;
|
|
31202
30800
|
startedRef.current = true;
|
|
@@ -31225,15 +30823,15 @@ function PrerequisitesScreen({
|
|
|
31225
30823
|
...skipBuild !== void 0 ? { skipBuild } : {}
|
|
31226
30824
|
}).then(onDone);
|
|
31227
30825
|
}, []);
|
|
31228
|
-
return /* @__PURE__ */
|
|
30826
|
+
return /* @__PURE__ */ jsx58(
|
|
31229
30827
|
StepLayout,
|
|
31230
30828
|
{
|
|
31231
|
-
prompt: confirm ? /* @__PURE__ */
|
|
31232
|
-
/* @__PURE__ */
|
|
30829
|
+
prompt: confirm ? /* @__PURE__ */ jsxs47(Box46, { children: [
|
|
30830
|
+
/* @__PURE__ */ jsxs47(Text48, { children: [
|
|
31233
30831
|
confirm.question,
|
|
31234
30832
|
" "
|
|
31235
30833
|
] }),
|
|
31236
|
-
/* @__PURE__ */
|
|
30834
|
+
/* @__PURE__ */ jsx58(
|
|
31237
30835
|
ConfirmInput2,
|
|
31238
30836
|
{
|
|
31239
30837
|
defaultChoice: confirm.defaultYes ? "confirm" : "cancel",
|
|
@@ -31242,8 +30840,8 @@ function PrerequisitesScreen({
|
|
|
31242
30840
|
},
|
|
31243
30841
|
confirm.question
|
|
31244
30842
|
)
|
|
31245
|
-
] }) : /* @__PURE__ */
|
|
31246
|
-
children: /* @__PURE__ */
|
|
30843
|
+
] }) : /* @__PURE__ */ jsx58(Text48, { color: PALETTE.info, children: "\u27F3 Checking prerequisites\u2026" }),
|
|
30844
|
+
children: /* @__PURE__ */ jsx58(Box46, { flexDirection: "column", children: events.map((event, index) => /* @__PURE__ */ jsx58(EventLine, { event }, `${index}-${event.message}`)) })
|
|
31247
30845
|
}
|
|
31248
30846
|
);
|
|
31249
30847
|
}
|
|
@@ -31263,9 +30861,9 @@ __export(SetupScreen_exports, {
|
|
|
31263
30861
|
SetupScreen: () => SetupScreen,
|
|
31264
30862
|
formatSetupCompletionMessage: () => formatSetupCompletionMessage
|
|
31265
30863
|
});
|
|
31266
|
-
import { useEffect as useEffect20, useRef as
|
|
31267
|
-
import { Box as
|
|
31268
|
-
import { jsx as
|
|
30864
|
+
import { useEffect as useEffect20, useRef as useRef13, useState as useState26 } from "react";
|
|
30865
|
+
import { Box as Box47, Text as Text49 } from "ink";
|
|
30866
|
+
import { jsx as jsx59, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
31269
30867
|
function countRequiredFailures(results) {
|
|
31270
30868
|
return results.filter((result) => result.required && result.status === "failed").length;
|
|
31271
30869
|
}
|
|
@@ -31283,11 +30881,11 @@ function SetupScreen({
|
|
|
31283
30881
|
}) {
|
|
31284
30882
|
const { columns: terminalColumns } = useTerminalSize();
|
|
31285
30883
|
const columns = columnsOverride ?? terminalColumns;
|
|
31286
|
-
const [activeStep, setActiveStep] =
|
|
31287
|
-
const [outcome, setOutcome] =
|
|
31288
|
-
const [notice, setNotice] =
|
|
31289
|
-
const [screen, setScreen] =
|
|
31290
|
-
const startedRef =
|
|
30884
|
+
const [activeStep, setActiveStep] = useState26(1);
|
|
30885
|
+
const [outcome, setOutcome] = useState26(null);
|
|
30886
|
+
const [notice, setNotice] = useState26(null);
|
|
30887
|
+
const [screen, setScreen] = useState26(null);
|
|
30888
|
+
const startedRef = useRef13(false);
|
|
31291
30889
|
useEffect20(() => {
|
|
31292
30890
|
if (startedRef.current) return;
|
|
31293
30891
|
startedRef.current = true;
|
|
@@ -31296,7 +30894,7 @@ function SetupScreen({
|
|
|
31296
30894
|
});
|
|
31297
30895
|
void (async () => {
|
|
31298
30896
|
const results = [];
|
|
31299
|
-
const prerequisites = await runScreen((done) => /* @__PURE__ */
|
|
30897
|
+
const prerequisites = await runScreen((done) => /* @__PURE__ */ jsx59(
|
|
31300
30898
|
PrerequisitesScreen,
|
|
31301
30899
|
{
|
|
31302
30900
|
repoRoot,
|
|
@@ -31330,21 +30928,21 @@ function SetupScreen({
|
|
|
31330
30928
|
if (skip.skipAgent) {
|
|
31331
30929
|
results.push({ name: "Coding agent", status: "skipped", required: false });
|
|
31332
30930
|
} else {
|
|
31333
|
-
const status = await runScreen((done) => /* @__PURE__ */
|
|
30931
|
+
const status = await runScreen((done) => /* @__PURE__ */ jsx59(CodingAgentScreen, { onDone: done }));
|
|
31334
30932
|
results.push({ name: "Coding agent", status, required: true });
|
|
31335
30933
|
}
|
|
31336
30934
|
setActiveStep(3);
|
|
31337
30935
|
if (skip.skipCredentials) {
|
|
31338
30936
|
results.push({ name: "Contentful credentials", status: "skipped", required: false });
|
|
31339
30937
|
} else {
|
|
31340
|
-
const status = await runScreen((done) => /* @__PURE__ */
|
|
30938
|
+
const status = await runScreen((done) => /* @__PURE__ */ jsx59(ContentfulCredentialsScreen, { onDone: done }));
|
|
31341
30939
|
results.push({ name: "Contentful credentials", status, required: false });
|
|
31342
30940
|
}
|
|
31343
30941
|
setActiveStep(4);
|
|
31344
30942
|
if (skip.skipOptional) {
|
|
31345
30943
|
results.push({ name: "Preferences", status: "skipped", required: false });
|
|
31346
30944
|
} else {
|
|
31347
|
-
const status = await runScreen((done) => /* @__PURE__ */
|
|
30945
|
+
const status = await runScreen((done) => /* @__PURE__ */ jsx59(PreferencesMenu, { onDone: done }));
|
|
31348
30946
|
results.push({ name: "Preferences", status, required: false });
|
|
31349
30947
|
}
|
|
31350
30948
|
const exitCode = countRequiredFailures(results) === 0 ? 0 : 1;
|
|
@@ -31353,37 +30951,37 @@ function SetupScreen({
|
|
|
31353
30951
|
onComplete(finalOutcome);
|
|
31354
30952
|
})();
|
|
31355
30953
|
}, []);
|
|
31356
|
-
return /* @__PURE__ */
|
|
31357
|
-
/* @__PURE__ */
|
|
31358
|
-
/* @__PURE__ */
|
|
31359
|
-
/* @__PURE__ */
|
|
30954
|
+
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 1, children: [
|
|
30955
|
+
/* @__PURE__ */ jsxs48(Box47, { justifyContent: "space-between", columnGap: 1, ...columns !== void 0 ? { width: columns - 2 } : {}, children: [
|
|
30956
|
+
/* @__PURE__ */ jsx59(Box47, { flexShrink: 0, children: /* @__PURE__ */ jsx59(Text49, { bold: true, children: "experiences setup" }) }),
|
|
30957
|
+
/* @__PURE__ */ jsx59(Box47, { flexShrink: 0, children: /* @__PURE__ */ jsxs48(Text49, { color: PALETTE.muted, children: [
|
|
31360
30958
|
"v",
|
|
31361
30959
|
version
|
|
31362
30960
|
] }) })
|
|
31363
30961
|
] }),
|
|
31364
|
-
/* @__PURE__ */
|
|
31365
|
-
outcome ? /* @__PURE__ */
|
|
30962
|
+
/* @__PURE__ */ jsx59(Box47, { marginTop: 1, children: /* @__PURE__ */ jsx59(SetupStepper, { activeStep, columns }) }),
|
|
30963
|
+
outcome ? /* @__PURE__ */ jsx59(SetupSummary, { outcome, notice }) : screen && /* @__PURE__ */ jsx59(Box47, { marginTop: 1, children: screen })
|
|
31366
30964
|
] });
|
|
31367
30965
|
}
|
|
31368
30966
|
function SetupSummary({ outcome, notice }) {
|
|
31369
30967
|
const requiredFailed = countRequiredFailures(outcome.results);
|
|
31370
|
-
return /* @__PURE__ */
|
|
31371
|
-
/* @__PURE__ */
|
|
30968
|
+
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", marginTop: 1, children: [
|
|
30969
|
+
/* @__PURE__ */ jsx59(Text49, { bold: true, children: "Summary" }),
|
|
31372
30970
|
outcome.results.map((result) => {
|
|
31373
30971
|
if (result.status === "completed") {
|
|
31374
|
-
return /* @__PURE__ */
|
|
30972
|
+
return /* @__PURE__ */ jsxs48(Text49, { color: PALETTE.success, children: [
|
|
31375
30973
|
"\u2713 ",
|
|
31376
30974
|
result.name
|
|
31377
30975
|
] }, result.name);
|
|
31378
30976
|
}
|
|
31379
30977
|
if (result.status === "skipped") {
|
|
31380
|
-
return /* @__PURE__ */
|
|
30978
|
+
return /* @__PURE__ */ jsxs48(Text49, { color: PALETTE.muted, children: [
|
|
31381
30979
|
"\u2013 ",
|
|
31382
30980
|
result.name,
|
|
31383
30981
|
" \u2014 skipped"
|
|
31384
30982
|
] }, result.name);
|
|
31385
30983
|
}
|
|
31386
|
-
return /* @__PURE__ */
|
|
30984
|
+
return /* @__PURE__ */ jsxs48(Text49, { color: result.required ? PALETTE.error : PALETTE.warning, children: [
|
|
31387
30985
|
result.required ? "\u2717" : "\u26A0",
|
|
31388
30986
|
" ",
|
|
31389
30987
|
result.name,
|
|
@@ -31391,10 +30989,10 @@ function SetupSummary({ outcome, notice }) {
|
|
|
31391
30989
|
result.required ? "required" : "optional"
|
|
31392
30990
|
] }, result.name);
|
|
31393
30991
|
}),
|
|
31394
|
-
notice && /* @__PURE__ */
|
|
31395
|
-
/* @__PURE__ */
|
|
31396
|
-
requiredFailed > 0 && /* @__PURE__ */
|
|
31397
|
-
/* @__PURE__ */
|
|
30992
|
+
notice && /* @__PURE__ */ jsx59(Box47, { marginTop: 1, children: /* @__PURE__ */ jsx59(Text49, { color: PALETTE.warning, children: notice }) }),
|
|
30993
|
+
/* @__PURE__ */ jsx59(Box47, { marginTop: 1, children: /* @__PURE__ */ jsx59(Text49, { bold: true, color: requiredFailed === 0 ? PALETTE.success : PALETTE.warning, children: formatSetupCompletionMessage(outcome.results) }) }),
|
|
30994
|
+
requiredFailed > 0 && /* @__PURE__ */ jsx59(Text49, { color: PALETTE.muted, children: "Complete the steps above, then re-run experiences setup." }),
|
|
30995
|
+
/* @__PURE__ */ jsx59(Text49, { color: PALETTE.muted, children: "Run experiences doctor any time to re-check." })
|
|
31398
30996
|
] });
|
|
31399
30997
|
}
|
|
31400
30998
|
var init_SetupScreen = __esm({
|