@contentful/experience-design-system-cli 2.37.1-dev-build-c3291210.0 → 2.37.1-dev-build-0d4be259.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 +88 -94
- package/dist/index.js +88 -94
- package/dist/package.json +1 -1
- package/legacy/package.json +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -263,14 +263,9 @@ var init_home = __esm({
|
|
|
263
263
|
});
|
|
264
264
|
|
|
265
265
|
// packages/experience-design-system-cli/src/tui/import/PageContainer.tsx
|
|
266
|
-
import {
|
|
267
|
-
import { Box as Box2, Text as Text3, useInput as useInput2, useStdout as useStdout2 } from "ink";
|
|
266
|
+
import { Box as Box2, Text as Text3, useInput as useInput2 } from "ink";
|
|
268
267
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
269
268
|
function ImportScreen({ exitCode, onDone }) {
|
|
270
|
-
const { stdout } = useStdout2();
|
|
271
|
-
useEffect3(() => {
|
|
272
|
-
stdout.write("\x1B[H\x1B[0J");
|
|
273
|
-
}, [stdout]);
|
|
274
269
|
useInput2((input, key) => {
|
|
275
270
|
if (key.return || key.escape || input === "q") {
|
|
276
271
|
onDone();
|
|
@@ -19721,7 +19716,7 @@ var init_scan_files = __esm({
|
|
|
19721
19716
|
});
|
|
19722
19717
|
|
|
19723
19718
|
// packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/screen.tsx
|
|
19724
|
-
import { useEffect as
|
|
19719
|
+
import { useEffect as useEffect3, useMemo, useState as useState5 } from "react";
|
|
19725
19720
|
import { Box as Box5, Text as Text6 } from "ink";
|
|
19726
19721
|
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
19727
19722
|
function Row({ row }) {
|
|
@@ -19772,7 +19767,7 @@ function PathValidationScreen({
|
|
|
19772
19767
|
}) {
|
|
19773
19768
|
const resolvedPath = useMemo(() => resolveUserPath(projectPath), [projectPath]);
|
|
19774
19769
|
const [scan, setScan] = useState5();
|
|
19775
|
-
|
|
19770
|
+
useEffect3(() => {
|
|
19776
19771
|
setScan(scanFiles(resolvedPath));
|
|
19777
19772
|
}, [resolvedPath]);
|
|
19778
19773
|
const phase = phaseOf(scan);
|
|
@@ -20222,10 +20217,10 @@ var init_theme = __esm({
|
|
|
20222
20217
|
});
|
|
20223
20218
|
|
|
20224
20219
|
// packages/experience-design-system-cli/src/tui/import/shared/running-step/use-elapsed.ts
|
|
20225
|
-
import { useEffect as
|
|
20220
|
+
import { useEffect as useEffect4, useState as useState7 } from "react";
|
|
20226
20221
|
function useElapsed() {
|
|
20227
20222
|
const [seconds, setSeconds] = useState7(0);
|
|
20228
|
-
|
|
20223
|
+
useEffect4(() => {
|
|
20229
20224
|
const timer = setInterval(() => setSeconds((current) => current + 1), 1e3);
|
|
20230
20225
|
return () => clearInterval(timer);
|
|
20231
20226
|
}, []);
|
|
@@ -20811,11 +20806,11 @@ var init_run = __esm({
|
|
|
20811
20806
|
});
|
|
20812
20807
|
|
|
20813
20808
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-extraction.ts
|
|
20814
|
-
import { useEffect as
|
|
20809
|
+
import { useEffect as useEffect5, useRef as useRef2, useState as useState8 } from "react";
|
|
20815
20810
|
function useExtraction(input) {
|
|
20816
20811
|
const [state, setState] = useState8();
|
|
20817
20812
|
const current = useRef2();
|
|
20818
|
-
|
|
20813
|
+
useEffect5(() => {
|
|
20819
20814
|
current.current = input;
|
|
20820
20815
|
if (!input) {
|
|
20821
20816
|
setState(void 0);
|
|
@@ -21051,7 +21046,7 @@ var init_windowed_panel = __esm({
|
|
|
21051
21046
|
});
|
|
21052
21047
|
|
|
21053
21048
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/added-column.tsx
|
|
21054
|
-
import
|
|
21049
|
+
import React6 from "react";
|
|
21055
21050
|
import { Box as Box11, Text as Text12 } from "ink";
|
|
21056
21051
|
import figures from "figures";
|
|
21057
21052
|
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
@@ -21069,7 +21064,7 @@ function AddedColumn(props) {
|
|
|
21069
21064
|
const aiFlagged = aiFlaggedByKey?.get(entry.name) === true;
|
|
21070
21065
|
const showSeparator = firstNonCycleIdx > 0 && i === firstNonCycleIdx;
|
|
21071
21066
|
const style = sideColumnLabelStyle({ isCycle: entry.isCycle, isSelected, focused });
|
|
21072
|
-
return /* @__PURE__ */ jsxs11(
|
|
21067
|
+
return /* @__PURE__ */ jsxs11(React6.Fragment, { children: [
|
|
21073
21068
|
showSeparator && /* @__PURE__ */ jsx14(Text12, { dimColor: true, children: "\u2500".repeat(Math.max(0, width - 2)) }),
|
|
21074
21069
|
/* @__PURE__ */ jsxs11(Box11, { children: [
|
|
21075
21070
|
isCursor ? /* @__PURE__ */ jsx14(Text12, { color: PALETTE2.info, bold: true, children: figures.pointer }) : /* @__PURE__ */ jsx14(Text12, { children: " " }),
|
|
@@ -22250,8 +22245,8 @@ var init_useImmediateInput = __esm({
|
|
|
22250
22245
|
});
|
|
22251
22246
|
|
|
22252
22247
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/hooks/use-terminal-size.ts
|
|
22253
|
-
import { useStdout as
|
|
22254
|
-
import { useEffect as
|
|
22248
|
+
import { useStdout as useStdout2 } from "ink";
|
|
22249
|
+
import { useEffect as useEffect6, useState as useState9 } from "react";
|
|
22255
22250
|
function readTerminalSize(stdout) {
|
|
22256
22251
|
return {
|
|
22257
22252
|
columns: stdout?.columns ?? 80,
|
|
@@ -22259,9 +22254,9 @@ function readTerminalSize(stdout) {
|
|
|
22259
22254
|
};
|
|
22260
22255
|
}
|
|
22261
22256
|
function useTerminalSize() {
|
|
22262
|
-
const { stdout } =
|
|
22257
|
+
const { stdout } = useStdout2();
|
|
22263
22258
|
const [size, setSize] = useState9(() => readTerminalSize(stdout));
|
|
22264
|
-
|
|
22259
|
+
useEffect6(() => {
|
|
22265
22260
|
const updateSize = () => setSize(readTerminalSize(stdout));
|
|
22266
22261
|
stdout?.on("resize", updateSize);
|
|
22267
22262
|
updateSize();
|
|
@@ -22278,7 +22273,7 @@ var init_use_terminal_size = __esm({
|
|
|
22278
22273
|
});
|
|
22279
22274
|
|
|
22280
22275
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/HelpOverlay.tsx
|
|
22281
|
-
import
|
|
22276
|
+
import React7 from "react";
|
|
22282
22277
|
import { Box as Box18, Text as Text20 } from "ink";
|
|
22283
22278
|
import { Fragment as Fragment2, jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
22284
22279
|
function HelpOverlay(props) {
|
|
@@ -22302,7 +22297,7 @@ function HelpOverlay(props) {
|
|
|
22302
22297
|
overflowY: "hidden",
|
|
22303
22298
|
children: [
|
|
22304
22299
|
/* @__PURE__ */ jsx22(Text20, { bold: true, children: "\u2500".repeat(titleRule) + " Help " + "\u2500".repeat(titleRule) }),
|
|
22305
|
-
props.sections.map((section) => /* @__PURE__ */ jsxs19(
|
|
22300
|
+
props.sections.map((section) => /* @__PURE__ */ jsxs19(React7.Fragment, { children: [
|
|
22306
22301
|
/* @__PURE__ */ jsx22(Text20, { children: " " }),
|
|
22307
22302
|
/* @__PURE__ */ jsx22(Text20, { bold: true, children: section.title }),
|
|
22308
22303
|
section.entries.map((entry) => /* @__PURE__ */ jsx22(Text20, { children: entry.keys ? " " + entry.keys.padEnd(16) + " " + entry.label : " " + entry.label }, entry.keys + entry.label))
|
|
@@ -23206,7 +23201,7 @@ var init_state = __esm({
|
|
|
23206
23201
|
});
|
|
23207
23202
|
|
|
23208
23203
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/use-scope-gate.ts
|
|
23209
|
-
import { useEffect as
|
|
23204
|
+
import { useEffect as useEffect7, useMemo as useMemo2, useRef as useRef4, useState as useState12 } from "react";
|
|
23210
23205
|
function useScopeGate({ components, onConfirm, onQuit }) {
|
|
23211
23206
|
const { columns: totalWidth, rows: terminalRows } = useTerminalSize();
|
|
23212
23207
|
const columnPlan = useMemo2(() => computeColumnWidths(totalWidth), [totalWidth]);
|
|
@@ -23250,7 +23245,7 @@ function useScopeGate({ components, onConfirm, onQuit }) {
|
|
|
23250
23245
|
return seed;
|
|
23251
23246
|
});
|
|
23252
23247
|
const seededGroupsRef = useRef4(closures.size > 0 || cycleParticipants.size > 0);
|
|
23253
|
-
|
|
23248
|
+
useEffect7(() => {
|
|
23254
23249
|
if (seededGroupsRef.current) return;
|
|
23255
23250
|
if (closures.size === 0 && cycleParticipants.size === 0) return;
|
|
23256
23251
|
seededGroupsRef.current = true;
|
|
@@ -23340,7 +23335,7 @@ function useScopeGate({ components, onConfirm, onQuit }) {
|
|
|
23340
23335
|
entryCount: 0
|
|
23341
23336
|
});
|
|
23342
23337
|
const panelLayout = useMemo2(() => computePanelLayout(visibleCount), [visibleCount]);
|
|
23343
|
-
|
|
23338
|
+
useEffect7(() => {
|
|
23344
23339
|
setNav((prev) => {
|
|
23345
23340
|
const maxIdx = Math.max(0, visibleRows.length - 1);
|
|
23346
23341
|
const nextCursor = Math.min(prev.cursor, maxIdx);
|
|
@@ -23902,13 +23897,13 @@ var init_load = __esm({
|
|
|
23902
23897
|
});
|
|
23903
23898
|
|
|
23904
23899
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/use-scope-gate-flow.ts
|
|
23905
|
-
import { useEffect as
|
|
23900
|
+
import { useEffect as useEffect8, useMemo as useMemo3, useRef as useRef5, useState as useState13 } from "react";
|
|
23906
23901
|
function useScopeGateFlow(input, deps = realDeps2) {
|
|
23907
23902
|
const sessionId = input?.sessionId;
|
|
23908
23903
|
const loaded = useMemo3(() => sessionId ? deps.load(sessionId) : void 0, [sessionId]);
|
|
23909
23904
|
const cacheCheck = useRef5(void 0);
|
|
23910
23905
|
const [confirmed, setConfirmed] = useState13();
|
|
23911
|
-
|
|
23906
|
+
useEffect8(() => {
|
|
23912
23907
|
if (!input || !loaded?.ok || cacheCheck.current) return;
|
|
23913
23908
|
cacheCheck.current = deps.checkCache(input.cache);
|
|
23914
23909
|
}, [input, loaded]);
|
|
@@ -24058,7 +24053,9 @@ async function runGeneration(input, onProgress, deps = realDeps3) {
|
|
|
24058
24053
|
onProgress(progress);
|
|
24059
24054
|
};
|
|
24060
24055
|
const accepted = input.decisions.accepted;
|
|
24056
|
+
update({ components: { done: 0, total: accepted.length, current: "Restoring cache..." } });
|
|
24061
24057
|
const handedOverNames = await input.cachedNames.catch(() => []);
|
|
24058
|
+
update({ components: { done: 0, total: accepted.length, current: "Starting generation..." } });
|
|
24062
24059
|
try {
|
|
24063
24060
|
await deps.saveDecisions({ sessionId: input.sessionId, decisions: input.decisions });
|
|
24064
24061
|
} catch (error) {
|
|
@@ -24183,11 +24180,11 @@ var init_run2 = __esm({
|
|
|
24183
24180
|
});
|
|
24184
24181
|
|
|
24185
24182
|
// packages/experience-design-system-cli/src/tui/import/steps/08-generation/use-generation.ts
|
|
24186
|
-
import { useEffect as
|
|
24183
|
+
import { useEffect as useEffect9, useRef as useRef6, useState as useState14 } from "react";
|
|
24187
24184
|
function useGeneration(input) {
|
|
24188
24185
|
const [state, setState] = useState14();
|
|
24189
24186
|
const current = useRef6();
|
|
24190
|
-
|
|
24187
|
+
useEffect9(() => {
|
|
24191
24188
|
current.current = input;
|
|
24192
24189
|
if (!input) {
|
|
24193
24190
|
setState(void 0);
|
|
@@ -25062,7 +25059,7 @@ var init_scroll_offset = __esm({
|
|
|
25062
25059
|
});
|
|
25063
25060
|
|
|
25064
25061
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx
|
|
25065
|
-
import
|
|
25062
|
+
import React8, { useEffect as useEffect10, useLayoutEffect as useLayoutEffect2, useState as useState15 } from "react";
|
|
25066
25063
|
import figures5 from "figures";
|
|
25067
25064
|
import { Box as Box21, measureElement, Text as Text23 } from "ink";
|
|
25068
25065
|
import { Fragment as Fragment5, jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
@@ -25742,9 +25739,9 @@ function FieldEditor({
|
|
|
25742
25739
|
const [editorState, setEditorState] = useState15(initialState);
|
|
25743
25740
|
const [parseErr] = useState15(parseError);
|
|
25744
25741
|
const [listScrollStart, setListScrollStart] = useState15(0);
|
|
25745
|
-
const initialFocusScrollApplied =
|
|
25742
|
+
const initialFocusScrollApplied = React8.useRef(false);
|
|
25746
25743
|
const [rowHeights, setRowHeights] = useState15({});
|
|
25747
|
-
const rowMeasureRefs =
|
|
25744
|
+
const rowMeasureRefs = React8.useRef(/* @__PURE__ */ new Map());
|
|
25748
25745
|
const initialFocus = (() => {
|
|
25749
25746
|
if (initialFocusTarget?.kind === "description") {
|
|
25750
25747
|
return {
|
|
@@ -25831,23 +25828,23 @@ function FieldEditor({
|
|
|
25831
25828
|
const [showHelp, setShowHelp] = useState15(false);
|
|
25832
25829
|
const props = editorState.props;
|
|
25833
25830
|
const slots = editorState.slots;
|
|
25834
|
-
const contentPropIndexes =
|
|
25831
|
+
const contentPropIndexes = React8.useMemo(
|
|
25835
25832
|
() => props.flatMap((prop, index) => prop.category === "content" ? [index] : []),
|
|
25836
25833
|
[props]
|
|
25837
25834
|
);
|
|
25838
|
-
const designPropIndexes =
|
|
25835
|
+
const designPropIndexes = React8.useMemo(
|
|
25839
25836
|
() => props.flatMap((prop, index) => prop.category === "design" ? [index] : []),
|
|
25840
25837
|
[props]
|
|
25841
25838
|
);
|
|
25842
|
-
const hiddenPropIndexes =
|
|
25839
|
+
const hiddenPropIndexes = React8.useMemo(
|
|
25843
25840
|
() => showHiddenProps ? props.flatMap((prop, index) => prop.category === "state" || prop.category === "unattached" ? [index] : []) : [],
|
|
25844
25841
|
[props, showHiddenProps]
|
|
25845
25842
|
);
|
|
25846
|
-
const visiblePropIndexes =
|
|
25843
|
+
const visiblePropIndexes = React8.useMemo(
|
|
25847
25844
|
() => [...contentPropIndexes, ...designPropIndexes, ...hiddenPropIndexes],
|
|
25848
25845
|
[contentPropIndexes, designPropIndexes, hiddenPropIndexes]
|
|
25849
25846
|
);
|
|
25850
|
-
const propGroups =
|
|
25847
|
+
const propGroups = React8.useMemo(
|
|
25851
25848
|
() => [
|
|
25852
25849
|
{
|
|
25853
25850
|
kind: "content",
|
|
@@ -25867,7 +25864,7 @@ function FieldEditor({
|
|
|
25867
25864
|
],
|
|
25868
25865
|
[contentPropIndexes, designPropIndexes, hiddenPropIndexes]
|
|
25869
25866
|
);
|
|
25870
|
-
const selectableRows =
|
|
25867
|
+
const selectableRows = React8.useMemo(
|
|
25871
25868
|
() => [
|
|
25872
25869
|
...contentPropIndexes.map((idx) => ({ kind: "prop", idx })),
|
|
25873
25870
|
...designPropIndexes.map((idx) => ({ kind: "prop", idx })),
|
|
@@ -25877,7 +25874,7 @@ function FieldEditor({
|
|
|
25877
25874
|
[contentPropIndexes, designPropIndexes, hiddenPropIndexes, slots]
|
|
25878
25875
|
);
|
|
25879
25876
|
const visiblePropPosition = visiblePropIndexes.indexOf(propIdx);
|
|
25880
|
-
const selectedSelectableIndex =
|
|
25877
|
+
const selectedSelectableIndex = React8.useMemo(
|
|
25881
25878
|
() => selectableRows.findIndex(
|
|
25882
25879
|
(row) => inSlots ? row.kind === "slot" && row.idx === slotIdx : row.kind === "prop" && row.idx === propIdx
|
|
25883
25880
|
),
|
|
@@ -25896,12 +25893,12 @@ function FieldEditor({
|
|
|
25896
25893
|
}
|
|
25897
25894
|
};
|
|
25898
25895
|
const textEntryActive = focusLevel === "field" && editingField && activeField === "description" || focusLevel === "field" && editingField && activeField === "default" && (editorState.props[propIdx]?.type === "string" || editorState.props[propIdx]?.type === "token") || editingValue != null;
|
|
25899
|
-
|
|
25896
|
+
React8.useEffect(() => {
|
|
25900
25897
|
onTextEntryActiveChange?.(textEntryActive);
|
|
25901
25898
|
}, [textEntryActive, onTextEntryActiveChange]);
|
|
25902
25899
|
const currentProp = props[propIdx] ?? null;
|
|
25903
25900
|
const currentSlot = slots[slotIdx] ?? null;
|
|
25904
|
-
|
|
25901
|
+
React8.useEffect(() => {
|
|
25905
25902
|
if (showHiddenProps || inSlots || inComponentDesc || visiblePropPosition >= 0) return;
|
|
25906
25903
|
if (visiblePropIndexes.length > 0) {
|
|
25907
25904
|
setPropIdx(visiblePropIndexes[0]);
|
|
@@ -25920,22 +25917,22 @@ function FieldEditor({
|
|
|
25920
25917
|
setEditorState(next);
|
|
25921
25918
|
onChange(serializeState(next, value));
|
|
25922
25919
|
};
|
|
25923
|
-
const canonicalize =
|
|
25920
|
+
const canonicalize = React8.useCallback((json) => {
|
|
25924
25921
|
try {
|
|
25925
25922
|
return JSON.stringify(JSON.parse(json));
|
|
25926
25923
|
} catch {
|
|
25927
25924
|
return `__unparseable__:${json}`;
|
|
25928
25925
|
}
|
|
25929
25926
|
}, []);
|
|
25930
|
-
const initialStateRef =
|
|
25927
|
+
const initialStateRef = React8.useRef(initialState);
|
|
25931
25928
|
const baselineCanonical = canonicalize(serializeState(initialStateRef.current, value));
|
|
25932
25929
|
const currentCanonical = canonicalize(serializeState(editorState, value));
|
|
25933
25930
|
const isDirty = currentCanonical !== baselineCanonical;
|
|
25934
|
-
|
|
25931
|
+
React8.useEffect(() => {
|
|
25935
25932
|
onDirtyChange?.(isDirty);
|
|
25936
25933
|
}, [isDirty, onDirtyChange]);
|
|
25937
|
-
const lastDiscardTriggerRef =
|
|
25938
|
-
|
|
25934
|
+
const lastDiscardTriggerRef = React8.useRef(discardTrigger);
|
|
25935
|
+
React8.useEffect(() => {
|
|
25939
25936
|
if (discardTrigger === void 0) return;
|
|
25940
25937
|
if (discardTrigger === lastDiscardTriggerRef.current) return;
|
|
25941
25938
|
lastDiscardTriggerRef.current = discardTrigger;
|
|
@@ -26534,7 +26531,7 @@ function FieldEditor({
|
|
|
26534
26531
|
}
|
|
26535
26532
|
return Math.max(start + 1, end2);
|
|
26536
26533
|
};
|
|
26537
|
-
|
|
26534
|
+
useEffect10(() => {
|
|
26538
26535
|
if (focusLevel === "field" || selectedRowIdx < 0) return;
|
|
26539
26536
|
setListScrollStart((previous) => {
|
|
26540
26537
|
if (initialFocusTarget && !initialFocusScrollApplied.current) {
|
|
@@ -27905,7 +27902,7 @@ var init_FinalizeDialog = __esm({
|
|
|
27905
27902
|
});
|
|
27906
27903
|
|
|
27907
27904
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-finalize-preview.ts
|
|
27908
|
-
import { useEffect as
|
|
27905
|
+
import { useEffect as useEffect11, useRef as useRef7, useState as useState16 } from "react";
|
|
27909
27906
|
function useReviewFinalizePreview({
|
|
27910
27907
|
components,
|
|
27911
27908
|
...options
|
|
@@ -27922,7 +27919,7 @@ function useFinalizePreview(opts) {
|
|
|
27922
27919
|
const [scrollOffset, setScrollOffset] = useState16(0);
|
|
27923
27920
|
const generationRef = useRef7(0);
|
|
27924
27921
|
const acceptedKey = [...acceptedKeys].sort().join("\0");
|
|
27925
|
-
|
|
27922
|
+
useEffect11(() => {
|
|
27926
27923
|
if (!open) {
|
|
27927
27924
|
setStatus("idle");
|
|
27928
27925
|
setRemoved([]);
|
|
@@ -27974,7 +27971,7 @@ var init_use_finalize_preview = __esm({
|
|
|
27974
27971
|
});
|
|
27975
27972
|
|
|
27976
27973
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-session.ts
|
|
27977
|
-
import { useCallback as useCallback2, useEffect as
|
|
27974
|
+
import { useCallback as useCallback2, useEffect as useEffect12, useRef as useRef8, useState as useState17 } from "react";
|
|
27978
27975
|
function useReviewSession({
|
|
27979
27976
|
loadSession,
|
|
27980
27977
|
tokensPath,
|
|
@@ -27993,7 +27990,7 @@ function useReviewSession({
|
|
|
27993
27990
|
}));
|
|
27994
27991
|
return { result, catalog };
|
|
27995
27992
|
}, [loadSession, tokensPath]);
|
|
27996
|
-
|
|
27993
|
+
useEffect12(() => {
|
|
27997
27994
|
let disposed = false;
|
|
27998
27995
|
void (async () => {
|
|
27999
27996
|
try {
|
|
@@ -28046,7 +28043,7 @@ function useReviewSession({
|
|
|
28046
28043
|
function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
|
|
28047
28044
|
const [reviewMetadata, setReviewMetadata] = useState17(null);
|
|
28048
28045
|
const [componentRationale, setComponentRationale] = useState17(null);
|
|
28049
|
-
|
|
28046
|
+
useEffect12(() => {
|
|
28050
28047
|
const current = components[selectedIdx];
|
|
28051
28048
|
if (!current) {
|
|
28052
28049
|
setReviewMetadata(null);
|
|
@@ -28078,7 +28075,7 @@ function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
|
|
|
28078
28075
|
function useReviewHistory({ loading, components, createSnapshot, applySnapshot }) {
|
|
28079
28076
|
const historyRef = useRef8(null);
|
|
28080
28077
|
const historySeededRef = useRef8(false);
|
|
28081
|
-
|
|
28078
|
+
useEffect12(() => {
|
|
28082
28079
|
if (loading || historySeededRef.current) return;
|
|
28083
28080
|
historySeededRef.current = true;
|
|
28084
28081
|
historyRef.current = createHistoryStack(createSnapshot(components));
|
|
@@ -28160,7 +28157,7 @@ var init_token_suggestions = __esm({
|
|
|
28160
28157
|
});
|
|
28161
28158
|
|
|
28162
28159
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-editor.ts
|
|
28163
|
-
import { useEffect as
|
|
28160
|
+
import { useEffect as useEffect13, useRef as useRef9, useState as useState18 } from "react";
|
|
28164
28161
|
function parseReviewEntry(draftValue) {
|
|
28165
28162
|
const parsed = JSON.parse(draftValue);
|
|
28166
28163
|
const keys = Object.keys(parsed);
|
|
@@ -28194,7 +28191,7 @@ function useReviewEditor({
|
|
|
28194
28191
|
const [tokenReviewEditSelection, setTokenReviewEditSelection] = useState18(/* @__PURE__ */ new Set());
|
|
28195
28192
|
const tokenReviewSuggestedRef = useRef9(/* @__PURE__ */ new Map());
|
|
28196
28193
|
const pendingGRef = useRef9(false);
|
|
28197
|
-
|
|
28194
|
+
useEffect13(() => {
|
|
28198
28195
|
setTokenReviewRow(0);
|
|
28199
28196
|
setTokenReviewEditing(false);
|
|
28200
28197
|
setTokenReviewEditCursor(0);
|
|
@@ -28667,7 +28664,7 @@ var init_preview_annotations = __esm({
|
|
|
28667
28664
|
});
|
|
28668
28665
|
|
|
28669
28666
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-live-preview.ts
|
|
28670
|
-
import { useCallback as useCallback3, useEffect as
|
|
28667
|
+
import { useCallback as useCallback3, useEffect as useEffect14, useRef as useRef10, useState as useState20 } from "react";
|
|
28671
28668
|
function useLivePreview(opts) {
|
|
28672
28669
|
const debounceMs = opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
28673
28670
|
const [status, setStatus] = useState20("idle");
|
|
@@ -28677,14 +28674,14 @@ function useLivePreview(opts) {
|
|
|
28677
28674
|
const latestRef = useRef10(0);
|
|
28678
28675
|
const inflightRef = useRef10(0);
|
|
28679
28676
|
const optsRef = useRef10(opts);
|
|
28680
|
-
|
|
28677
|
+
useEffect14(() => {
|
|
28681
28678
|
optsRef.current = opts;
|
|
28682
28679
|
});
|
|
28683
28680
|
const disabledRef = useRef10(disabled);
|
|
28684
|
-
|
|
28681
|
+
useEffect14(() => {
|
|
28685
28682
|
disabledRef.current = disabled;
|
|
28686
28683
|
}, [disabled]);
|
|
28687
|
-
|
|
28684
|
+
useEffect14(() => {
|
|
28688
28685
|
return () => {
|
|
28689
28686
|
if (timerRef.current) {
|
|
28690
28687
|
clearTimeout(timerRef.current);
|
|
@@ -28765,7 +28762,7 @@ var init_use_live_preview = __esm({
|
|
|
28765
28762
|
});
|
|
28766
28763
|
|
|
28767
28764
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-preview.ts
|
|
28768
|
-
import { useCallback as useCallback4, useEffect as
|
|
28765
|
+
import { useCallback as useCallback4, useEffect as useEffect15, useState as useState21 } from "react";
|
|
28769
28766
|
function useReviewPreview({
|
|
28770
28767
|
components,
|
|
28771
28768
|
loading,
|
|
@@ -28807,13 +28804,13 @@ function useReviewPreview({
|
|
|
28807
28804
|
deleteAllComponents
|
|
28808
28805
|
});
|
|
28809
28806
|
const [spinnerTick, setSpinnerTick] = useState21(0);
|
|
28810
|
-
|
|
28807
|
+
useEffect15(() => {
|
|
28811
28808
|
if (livePreviewHook.status !== "running") return;
|
|
28812
28809
|
const id = setInterval(() => setSpinnerTick((tick) => tick + 1), 80);
|
|
28813
28810
|
return () => clearInterval(id);
|
|
28814
28811
|
}, [livePreviewHook.status]);
|
|
28815
28812
|
const livePreviewSpinner = SPINNER_FRAMES[spinnerTick % SPINNER_FRAMES.length];
|
|
28816
|
-
|
|
28813
|
+
useEffect15(() => {
|
|
28817
28814
|
if (loading) return;
|
|
28818
28815
|
if (!livePreview) return;
|
|
28819
28816
|
if (components.length === 0) return;
|
|
@@ -28870,7 +28867,7 @@ var init_LivePreviewSummary = __esm({
|
|
|
28870
28867
|
});
|
|
28871
28868
|
|
|
28872
28869
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx
|
|
28873
|
-
import { useCallback as useCallback5, useEffect as
|
|
28870
|
+
import { useCallback as useCallback5, useEffect as useEffect16, useMemo as useMemo4, useRef as useRef11, useState as useState22 } from "react";
|
|
28874
28871
|
import figures7 from "figures";
|
|
28875
28872
|
import { Box as Box33, Text as Text36 } from "ink";
|
|
28876
28873
|
import { Fragment as Fragment13, jsx as jsx43, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
@@ -29191,7 +29188,7 @@ function GenerateReviewStepView({
|
|
|
29191
29188
|
[components]
|
|
29192
29189
|
);
|
|
29193
29190
|
const closures = useMemo4(() => computeAllClosures(componentGraph), [componentGraph]);
|
|
29194
|
-
|
|
29191
|
+
useEffect16(() => {
|
|
29195
29192
|
if (seededGroupsRef.current) return;
|
|
29196
29193
|
if (closures.size === 0 && slotCycles.length === 0) return;
|
|
29197
29194
|
seededGroupsRef.current = true;
|
|
@@ -29218,7 +29215,7 @@ function GenerateReviewStepView({
|
|
|
29218
29215
|
suggestedBreak: cycle.edges.length > 0 ? suggestCycleBreakEdge2(cycle, cycleView.pushBlocking) : null
|
|
29219
29216
|
}));
|
|
29220
29217
|
}, [slotCycles, cycleView]);
|
|
29221
|
-
|
|
29218
|
+
useEffect16(() => {
|
|
29222
29219
|
const decision = computeAutoRejectDecision({
|
|
29223
29220
|
loading,
|
|
29224
29221
|
autoRejectFired: autoRejectFiredRef.current,
|
|
@@ -29262,7 +29259,7 @@ function GenerateReviewStepView({
|
|
|
29262
29259
|
applySnapshot: applyHistorySnapshot
|
|
29263
29260
|
});
|
|
29264
29261
|
const autoRejectPushedRef = useRef11(false);
|
|
29265
|
-
|
|
29262
|
+
useEffect16(() => {
|
|
29266
29263
|
if (loading) return;
|
|
29267
29264
|
if (!historySeededRef.current) return;
|
|
29268
29265
|
if (!autoRejectFiredRef.current) return;
|
|
@@ -29346,7 +29343,7 @@ function GenerateReviewStepView({
|
|
|
29346
29343
|
const panelHeight = leftPanelHeight + 2;
|
|
29347
29344
|
const panelContentHeight = Math.max(1, panelHeight - 3);
|
|
29348
29345
|
const cycleViewportHeight = Math.max(1, panelHeight - 4);
|
|
29349
|
-
|
|
29346
|
+
useEffect16(() => {
|
|
29350
29347
|
if (selectableRowPositions.length === 0) return;
|
|
29351
29348
|
const cursorInRange = selectableRowPositions.includes(cursorRowIdx);
|
|
29352
29349
|
const maxScroll = Math.max(0, visibleRowsMemo.length - visibleCount);
|
|
@@ -30446,10 +30443,10 @@ var init_path_utils = __esm({
|
|
|
30446
30443
|
});
|
|
30447
30444
|
|
|
30448
30445
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-blinking-cursor.ts
|
|
30449
|
-
import { useEffect as
|
|
30446
|
+
import { useEffect as useEffect17, useState as useState23 } from "react";
|
|
30450
30447
|
function useBlinkingCursor() {
|
|
30451
30448
|
const [visible, setVisible] = useState23(true);
|
|
30452
|
-
|
|
30449
|
+
useEffect17(() => {
|
|
30453
30450
|
const interval = setInterval(() => setVisible((current) => !current), 500);
|
|
30454
30451
|
return () => clearInterval(interval);
|
|
30455
30452
|
}, []);
|
|
@@ -30576,12 +30573,12 @@ var init_StepHeader = __esm({
|
|
|
30576
30573
|
});
|
|
30577
30574
|
|
|
30578
30575
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-timed-spinner.tsx
|
|
30579
|
-
import { useEffect as
|
|
30576
|
+
import { useEffect as useEffect18, useState as useState25 } from "react";
|
|
30580
30577
|
import { Spinner as Spinner2 } from "@inkjs/ui";
|
|
30581
30578
|
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
30582
30579
|
function useTimedSpinner() {
|
|
30583
30580
|
const [elapsedSeconds, setElapsedSeconds] = useState25(0);
|
|
30584
|
-
|
|
30581
|
+
useEffect18(() => {
|
|
30585
30582
|
const timer = setInterval(() => setElapsedSeconds((current) => current + 1), 1e3);
|
|
30586
30583
|
return () => {
|
|
30587
30584
|
clearInterval(timer);
|
|
@@ -30827,7 +30824,7 @@ var init_preview_confirmation_input = __esm({
|
|
|
30827
30824
|
});
|
|
30828
30825
|
|
|
30829
30826
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/WizardPreviewStep.tsx
|
|
30830
|
-
import { useEffect as
|
|
30827
|
+
import { useEffect as useEffect19, useState as useState26, useMemo as useMemo5 } from "react";
|
|
30831
30828
|
import { Box as Box40, Text as Text43 } from "ink";
|
|
30832
30829
|
import { Fragment as Fragment15, jsx as jsx51, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
30833
30830
|
function buildPreviewSummaryLines(preview) {
|
|
@@ -31039,7 +31036,7 @@ function WizardPreviewStep({
|
|
|
31039
31036
|
const activeLines = diffExpanded ? diffLines : summaryLines;
|
|
31040
31037
|
const maxScroll = Math.max(0, activeLines.length - viewportHeight);
|
|
31041
31038
|
const boundedScrollOffset = Math.min(scrollOffset, maxScroll);
|
|
31042
|
-
|
|
31039
|
+
useEffect19(() => {
|
|
31043
31040
|
setScrollOffset((previous) => Math.min(previous, maxScroll));
|
|
31044
31041
|
}, [maxScroll]);
|
|
31045
31042
|
useImmediateInput((input, key) => {
|
|
@@ -31143,7 +31140,7 @@ var init_run_teaser = __esm({
|
|
|
31143
31140
|
});
|
|
31144
31141
|
|
|
31145
31142
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/screen.tsx
|
|
31146
|
-
import { useEffect as
|
|
31143
|
+
import { useEffect as useEffect20, useRef as useRef12 } from "react";
|
|
31147
31144
|
import { Box as Box41 } from "ink";
|
|
31148
31145
|
import { jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
31149
31146
|
function totalStepsFor(state) {
|
|
@@ -31165,7 +31162,7 @@ function FlowScreen({
|
|
|
31165
31162
|
const totalSteps = totalStepsFor(state);
|
|
31166
31163
|
const quit = () => onExit(0);
|
|
31167
31164
|
const previousStep = useRef12(state.step);
|
|
31168
|
-
|
|
31165
|
+
useEffect20(() => {
|
|
31169
31166
|
if (previousStep.current !== state.step) {
|
|
31170
31167
|
onStepChange?.();
|
|
31171
31168
|
previousStep.current = state.step;
|
|
@@ -32090,7 +32087,7 @@ var init_controller = __esm({
|
|
|
32090
32087
|
});
|
|
32091
32088
|
|
|
32092
32089
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
32093
|
-
import { useEffect as
|
|
32090
|
+
import { useEffect as useEffect21, useRef as useRef13, useSyncExternalStore } from "react";
|
|
32094
32091
|
function useFlow(start, deps = realFlowDeps) {
|
|
32095
32092
|
const controller = useRef13();
|
|
32096
32093
|
if (start && !controller.current) {
|
|
@@ -32105,7 +32102,7 @@ function useFlow(start, deps = realFlowDeps) {
|
|
|
32105
32102
|
(listener) => current?.subscribe(listener) ?? (() => void 0),
|
|
32106
32103
|
() => current?.getState()
|
|
32107
32104
|
);
|
|
32108
|
-
|
|
32105
|
+
useEffect21(() => {
|
|
32109
32106
|
if (!start) controller.current = void 0;
|
|
32110
32107
|
}, [start]);
|
|
32111
32108
|
return current && state ? { controller: current, state } : void 0;
|
|
@@ -32318,7 +32315,7 @@ var init_help_info = __esm({
|
|
|
32318
32315
|
});
|
|
32319
32316
|
|
|
32320
32317
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
32321
|
-
import { useEffect as
|
|
32318
|
+
import { useEffect as useEffect22, useState as useState27 } from "react";
|
|
32322
32319
|
import { Box as Box42, Text as Text44, useInput as useInput9 } from "ink";
|
|
32323
32320
|
import { Fragment as Fragment16, jsx as jsx53, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
32324
32321
|
function Section({ title, rows }) {
|
|
@@ -32332,7 +32329,7 @@ function Section({ title, rows }) {
|
|
|
32332
32329
|
}
|
|
32333
32330
|
function HelpScreen({ onDone }) {
|
|
32334
32331
|
const [info, setInfo] = useState27();
|
|
32335
|
-
|
|
32332
|
+
useEffect22(() => {
|
|
32336
32333
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
32337
32334
|
void readHelpInfo().then(setInfo);
|
|
32338
32335
|
}, []);
|
|
@@ -32481,7 +32478,7 @@ var init_config_store = __esm({
|
|
|
32481
32478
|
});
|
|
32482
32479
|
|
|
32483
32480
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
32484
|
-
import { useEffect as
|
|
32481
|
+
import { useEffect as useEffect23, useState as useState29 } from "react";
|
|
32485
32482
|
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
32486
32483
|
import TextInput4 from "ink-text-input";
|
|
32487
32484
|
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
@@ -32503,7 +32500,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
32503
32500
|
const [lastSaved, setLastSaved] = useState29(null);
|
|
32504
32501
|
const [editing, setEditing] = useState29(false);
|
|
32505
32502
|
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
32506
|
-
|
|
32503
|
+
useEffect23(() => {
|
|
32507
32504
|
readCredentials().then((cfg) => {
|
|
32508
32505
|
setConfig(cfg);
|
|
32509
32506
|
setStage("form");
|
|
@@ -32687,13 +32684,13 @@ var init_analytics_store = __esm({
|
|
|
32687
32684
|
});
|
|
32688
32685
|
|
|
32689
32686
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
32690
|
-
import { useEffect as
|
|
32687
|
+
import { useEffect as useEffect24, useState as useState30 } from "react";
|
|
32691
32688
|
import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
|
|
32692
32689
|
import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
32693
32690
|
function OptInAnalyticsScreen({ onDone }) {
|
|
32694
32691
|
const [loading, setLoading] = useState30(true);
|
|
32695
32692
|
const [enabled, setEnabled] = useState30(true);
|
|
32696
|
-
|
|
32693
|
+
useEffect24(() => {
|
|
32697
32694
|
readAnalyticsSetting().then((setting) => {
|
|
32698
32695
|
setEnabled(setting.enabled);
|
|
32699
32696
|
setLoading(false);
|
|
@@ -32756,12 +32753,12 @@ var init_screen11 = __esm({
|
|
|
32756
32753
|
});
|
|
32757
32754
|
|
|
32758
32755
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
32759
|
-
import { useEffect as
|
|
32756
|
+
import { useEffect as useEffect25, useState as useState31 } from "react";
|
|
32760
32757
|
import { Box as Box46, Text as Text48, useInput as useInput13 } from "ink";
|
|
32761
32758
|
import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
32762
32759
|
function UpgradeScreen({ onDone }) {
|
|
32763
32760
|
const [upgradeCheck, setUpgradeCheck] = useState31();
|
|
32764
|
-
|
|
32761
|
+
useEffect25(() => {
|
|
32765
32762
|
startDebugRun({
|
|
32766
32763
|
flow: "upgrade",
|
|
32767
32764
|
step: "01-upgrade",
|
|
@@ -32836,13 +32833,13 @@ var init_PageContainer4 = __esm({
|
|
|
32836
32833
|
});
|
|
32837
32834
|
|
|
32838
32835
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
32839
|
-
import { useEffect as
|
|
32836
|
+
import { useEffect as useEffect26, useState as useState32 } from "react";
|
|
32840
32837
|
import { Box as Box47, Text as Text49, useInput as useInput14 } from "ink";
|
|
32841
32838
|
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
32842
32839
|
function DebugModeScreen({ onDone }) {
|
|
32843
32840
|
const [loading, setLoading] = useState32(true);
|
|
32844
32841
|
const [enabled, setEnabled] = useState32(true);
|
|
32845
|
-
|
|
32842
|
+
useEffect26(() => {
|
|
32846
32843
|
readDebugModeSetting().then((setting) => {
|
|
32847
32844
|
setEnabled(setting.enabled);
|
|
32848
32845
|
setLoading(false);
|
|
@@ -32905,7 +32902,7 @@ __export(app_exports, {
|
|
|
32905
32902
|
runApp: () => runApp
|
|
32906
32903
|
});
|
|
32907
32904
|
import { join as join27 } from "node:path";
|
|
32908
|
-
import { useEffect as
|
|
32905
|
+
import { useEffect as useEffect27, useState as useState33 } from "react";
|
|
32909
32906
|
import { Fragment as Fragment19, jsx as jsx59 } from "react/jsx-runtime";
|
|
32910
32907
|
function App({ importOptions, inkClear }) {
|
|
32911
32908
|
const [screen, setScreen] = useState33("start");
|
|
@@ -32937,7 +32934,7 @@ function App({ importOptions, inkClear }) {
|
|
|
32937
32934
|
const [flowStart, setFlowStart] = useState33();
|
|
32938
32935
|
const flow = useFlow(flowStart);
|
|
32939
32936
|
const [importDefaults, setImportDefaults] = useState33();
|
|
32940
|
-
|
|
32937
|
+
useEffect27(() => {
|
|
32941
32938
|
if (screen !== "import") {
|
|
32942
32939
|
setImportDefaults(void 0);
|
|
32943
32940
|
return;
|
|
@@ -32995,12 +32992,12 @@ function App({ importOptions, inkClear }) {
|
|
|
32995
32992
|
}
|
|
32996
32993
|
});
|
|
32997
32994
|
};
|
|
32998
|
-
|
|
32995
|
+
useEffect27(() => {
|
|
32999
32996
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
33000
32997
|
setExtractionRun(void 0);
|
|
33001
32998
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
33002
32999
|
}, [extraction, extractionRun]);
|
|
33003
|
-
|
|
33000
|
+
useEffect27(() => {
|
|
33004
33001
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
33005
33002
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
33006
33003
|
setGenerationInput({
|
|
@@ -33018,7 +33015,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33018
33015
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
33019
33016
|
});
|
|
33020
33017
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
33021
|
-
|
|
33018
|
+
useEffect27(() => {
|
|
33022
33019
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
33023
33020
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
33024
33021
|
inkClear();
|
|
@@ -33069,10 +33066,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33069
33066
|
state: flow.state,
|
|
33070
33067
|
controller: flow.controller,
|
|
33071
33068
|
generatePromptPath: flowStart.generatePromptPath,
|
|
33072
|
-
onExit:
|
|
33073
|
-
inkClear();
|
|
33074
|
-
setImportExitCode(code);
|
|
33075
|
-
},
|
|
33069
|
+
onExit: setImportExitCode,
|
|
33076
33070
|
onStepChange: inkClear
|
|
33077
33071
|
}
|
|
33078
33072
|
);
|