@contentful/experience-design-system-cli 2.40.0 → 2.40.1-dev-build-08f065f9.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 +131 -95
- package/dist/index.js +131 -95
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/01-welcome/screen.d.ts +4 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -20366,15 +20366,49 @@ var init_controls4 = __esm({
|
|
|
20366
20366
|
});
|
|
20367
20367
|
|
|
20368
20368
|
// packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx
|
|
20369
|
-
import { useState as useState5 } from "react";
|
|
20369
|
+
import { useEffect as useEffect5, useRef as useRef3, useState as useState5 } from "react";
|
|
20370
20370
|
import { Box as Box10, Text as Text10 } from "ink";
|
|
20371
20371
|
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
20372
|
-
function WelcomeScreen({ onContinue, onQuit, initialPath = "" }) {
|
|
20372
|
+
function WelcomeScreen({ mode, onContinue, onQuit, initialPath = "" }) {
|
|
20373
20373
|
const [projectPath, setProjectPath] = useState5(initialPath);
|
|
20374
|
-
|
|
20374
|
+
const visit = useRef3({ emptySubmits: 0 }).current;
|
|
20375
|
+
useEffect5(() => {
|
|
20376
|
+
startDebugRun({
|
|
20377
|
+
flow: "import/welcome",
|
|
20378
|
+
step: "01-welcome",
|
|
20379
|
+
menuOption: "Welcome",
|
|
20380
|
+
inputs: { import_mode: mode, initial_path: initialPath }
|
|
20381
|
+
});
|
|
20382
|
+
}, []);
|
|
20383
|
+
const quit = () => {
|
|
20384
|
+
void finishDebugRun({
|
|
20385
|
+
outputs: {
|
|
20386
|
+
project_path: null,
|
|
20387
|
+
typed_something: toProjectPath(projectPath) !== null,
|
|
20388
|
+
empty_submits: visit.emptySubmits
|
|
20389
|
+
},
|
|
20390
|
+
status: "success",
|
|
20391
|
+
exitMethod: "discarded"
|
|
20392
|
+
});
|
|
20393
|
+
onQuit();
|
|
20394
|
+
};
|
|
20395
|
+
useWelcomeControls(quit);
|
|
20375
20396
|
const submit = (value) => {
|
|
20376
20397
|
const path5 = toProjectPath(value);
|
|
20377
|
-
if (path5)
|
|
20398
|
+
if (!path5) {
|
|
20399
|
+
visit.emptySubmits += 1;
|
|
20400
|
+
return;
|
|
20401
|
+
}
|
|
20402
|
+
void finishDebugRun({
|
|
20403
|
+
outputs: {
|
|
20404
|
+
project_path: path5,
|
|
20405
|
+
changed_from_initial: path5 !== initialPath.trim(),
|
|
20406
|
+
empty_submits: visit.emptySubmits
|
|
20407
|
+
},
|
|
20408
|
+
status: "success",
|
|
20409
|
+
exitMethod: "saved"
|
|
20410
|
+
});
|
|
20411
|
+
onContinue(path5);
|
|
20378
20412
|
};
|
|
20379
20413
|
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
|
|
20380
20414
|
/* @__PURE__ */ jsx11(StepHeader, { step: "setup" }),
|
|
@@ -20395,6 +20429,7 @@ var init_screen2 = __esm({
|
|
|
20395
20429
|
"packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx"() {
|
|
20396
20430
|
"use strict";
|
|
20397
20431
|
init_theme();
|
|
20432
|
+
init_debug_store();
|
|
20398
20433
|
init_ClearableTextInput();
|
|
20399
20434
|
init_controls4();
|
|
20400
20435
|
init_logic5();
|
|
@@ -20680,7 +20715,7 @@ var init_scan_files = __esm({
|
|
|
20680
20715
|
});
|
|
20681
20716
|
|
|
20682
20717
|
// packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/screen.tsx
|
|
20683
|
-
import { useEffect as
|
|
20718
|
+
import { useEffect as useEffect6, useMemo, useState as useState7 } from "react";
|
|
20684
20719
|
import { Box as Box12, Text as Text12 } from "ink";
|
|
20685
20720
|
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
20686
20721
|
function Row({ row }) {
|
|
@@ -20736,7 +20771,7 @@ function PathValidationScreen({
|
|
|
20736
20771
|
}) {
|
|
20737
20772
|
const resolvedPath = useMemo(() => resolveUserPath(projectPath), [projectPath]);
|
|
20738
20773
|
const [scan, setScan] = useState7();
|
|
20739
|
-
|
|
20774
|
+
useEffect6(() => {
|
|
20740
20775
|
setScan(scanFiles(resolvedPath));
|
|
20741
20776
|
}, [resolvedPath]);
|
|
20742
20777
|
const phase = phaseOf(scan);
|
|
@@ -21033,7 +21068,7 @@ var init_validate4 = __esm({
|
|
|
21033
21068
|
});
|
|
21034
21069
|
|
|
21035
21070
|
// packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx
|
|
21036
|
-
import { useRef as
|
|
21071
|
+
import { useRef as useRef4, useState as useState9 } from "react";
|
|
21037
21072
|
import { Box as Box14, Text as Text14, useInput as useInput11 } from "ink";
|
|
21038
21073
|
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
21039
21074
|
function CredentialsScreen({
|
|
@@ -21043,7 +21078,7 @@ function CredentialsScreen({
|
|
|
21043
21078
|
validate: validate3 = validateCredentials,
|
|
21044
21079
|
tokensOnly = false
|
|
21045
21080
|
}) {
|
|
21046
|
-
const initialValues =
|
|
21081
|
+
const initialValues = useRef4(
|
|
21047
21082
|
normalize({
|
|
21048
21083
|
spaceId: initial.spaceId ?? "",
|
|
21049
21084
|
environmentId: initial.environmentId || "master",
|
|
@@ -21763,11 +21798,11 @@ var init_run = __esm({
|
|
|
21763
21798
|
});
|
|
21764
21799
|
|
|
21765
21800
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-extraction.ts
|
|
21766
|
-
import { useEffect as
|
|
21801
|
+
import { useEffect as useEffect7, useRef as useRef5, useState as useState11 } from "react";
|
|
21767
21802
|
function useExtraction(input) {
|
|
21768
21803
|
const [state2, setState] = useState11();
|
|
21769
|
-
const current =
|
|
21770
|
-
|
|
21804
|
+
const current = useRef5();
|
|
21805
|
+
useEffect7(() => {
|
|
21771
21806
|
current.current = input;
|
|
21772
21807
|
if (!input) {
|
|
21773
21808
|
setState(void 0);
|
|
@@ -21838,11 +21873,11 @@ var init_run_tokens_only = __esm({
|
|
|
21838
21873
|
});
|
|
21839
21874
|
|
|
21840
21875
|
// packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-tokens-only.ts
|
|
21841
|
-
import { useEffect as
|
|
21876
|
+
import { useEffect as useEffect8, useRef as useRef6, useState as useState12 } from "react";
|
|
21842
21877
|
function useTokensOnly(input) {
|
|
21843
21878
|
const [state2, setState] = useState12();
|
|
21844
|
-
const current =
|
|
21845
|
-
|
|
21879
|
+
const current = useRef6();
|
|
21880
|
+
useEffect8(() => {
|
|
21846
21881
|
current.current = input;
|
|
21847
21882
|
if (!input) {
|
|
21848
21883
|
setState(void 0);
|
|
@@ -23039,7 +23074,7 @@ var init_GroupedSidebar = __esm({
|
|
|
23039
23074
|
});
|
|
23040
23075
|
|
|
23041
23076
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/hooks/useImmediateInput.ts
|
|
23042
|
-
import { useLayoutEffect, useRef as
|
|
23077
|
+
import { useLayoutEffect, useRef as useRef7 } from "react";
|
|
23043
23078
|
import { useStdin } from "ink";
|
|
23044
23079
|
function parseInput(data) {
|
|
23045
23080
|
const isShiftTab = data === "\x1B[Z";
|
|
@@ -23101,7 +23136,7 @@ function registerInputHandler(stdin, setRawMode, handler) {
|
|
|
23101
23136
|
}
|
|
23102
23137
|
function useImmediateInput(handler, enabled = true) {
|
|
23103
23138
|
const { stdin, setRawMode } = useStdin();
|
|
23104
|
-
const handlerRef =
|
|
23139
|
+
const handlerRef = useRef7(handler);
|
|
23105
23140
|
handlerRef.current = handler;
|
|
23106
23141
|
useLayoutEffect(() => {
|
|
23107
23142
|
if (!enabled) return;
|
|
@@ -23119,7 +23154,7 @@ var init_useImmediateInput = __esm({
|
|
|
23119
23154
|
|
|
23120
23155
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/hooks/use-terminal-size.ts
|
|
23121
23156
|
import { useStdout as useStdout2 } from "ink";
|
|
23122
|
-
import { useEffect as
|
|
23157
|
+
import { useEffect as useEffect9, useState as useState13 } from "react";
|
|
23123
23158
|
function readTerminalSize(stdout) {
|
|
23124
23159
|
return {
|
|
23125
23160
|
columns: stdout?.columns ?? 80,
|
|
@@ -23129,7 +23164,7 @@ function readTerminalSize(stdout) {
|
|
|
23129
23164
|
function useTerminalSize() {
|
|
23130
23165
|
const { stdout } = useStdout2();
|
|
23131
23166
|
const [size, setSize] = useState13(() => readTerminalSize(stdout));
|
|
23132
|
-
|
|
23167
|
+
useEffect9(() => {
|
|
23133
23168
|
const updateSize = () => setSize(readTerminalSize(stdout));
|
|
23134
23169
|
stdout?.on("resize", updateSize);
|
|
23135
23170
|
updateSize();
|
|
@@ -24131,7 +24166,7 @@ var init_state = __esm({
|
|
|
24131
24166
|
});
|
|
24132
24167
|
|
|
24133
24168
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/use-scope-gate.ts
|
|
24134
|
-
import { useEffect as
|
|
24169
|
+
import { useEffect as useEffect10, useMemo as useMemo3, useRef as useRef8, useState as useState16 } from "react";
|
|
24135
24170
|
function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }) {
|
|
24136
24171
|
const { columns: totalWidth, rows: terminalRows } = useTerminalSize();
|
|
24137
24172
|
const columnPlan = useMemo3(
|
|
@@ -24177,8 +24212,8 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
24177
24212
|
for (const p of cycleParticipants) seed.add(p);
|
|
24178
24213
|
return seed;
|
|
24179
24214
|
});
|
|
24180
|
-
const seededGroupsRef =
|
|
24181
|
-
|
|
24215
|
+
const seededGroupsRef = useRef8(closures.size > 0 || cycleParticipants.size > 0);
|
|
24216
|
+
useEffect10(() => {
|
|
24182
24217
|
if (seededGroupsRef.current) return;
|
|
24183
24218
|
if (closures.size === 0 && cycleParticipants.size === 0) return;
|
|
24184
24219
|
seededGroupsRef.current = true;
|
|
@@ -24269,7 +24304,7 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
|
|
|
24269
24304
|
entryCount: 0
|
|
24270
24305
|
});
|
|
24271
24306
|
const panelLayout = useMemo3(() => computePanelLayout(visibleCount), [visibleCount]);
|
|
24272
|
-
|
|
24307
|
+
useEffect10(() => {
|
|
24273
24308
|
setNav((prev) => {
|
|
24274
24309
|
const maxIdx = Math.max(0, visibleRows.length - 1);
|
|
24275
24310
|
const nextCursor = Math.min(prev.cursor, maxIdx);
|
|
@@ -24842,13 +24877,13 @@ var init_load2 = __esm({
|
|
|
24842
24877
|
});
|
|
24843
24878
|
|
|
24844
24879
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/use-scope-gate-flow.ts
|
|
24845
|
-
import { useEffect as
|
|
24880
|
+
import { useEffect as useEffect11, useMemo as useMemo5, useRef as useRef9, useState as useState17 } from "react";
|
|
24846
24881
|
function useScopeGateFlow(input, deps = realDeps3) {
|
|
24847
24882
|
const sessionId = input?.sessionId;
|
|
24848
24883
|
const loaded = useMemo5(() => sessionId ? deps.load(sessionId) : void 0, [sessionId]);
|
|
24849
|
-
const cacheCheck =
|
|
24884
|
+
const cacheCheck = useRef9(void 0);
|
|
24850
24885
|
const [confirmed, setConfirmed] = useState17();
|
|
24851
|
-
|
|
24886
|
+
useEffect11(() => {
|
|
24852
24887
|
if (!input || !loaded?.ok || cacheCheck.current) return;
|
|
24853
24888
|
cacheCheck.current = deps.checkCache(input.cache);
|
|
24854
24889
|
}, [input, loaded]);
|
|
@@ -25119,11 +25154,11 @@ var init_run2 = __esm({
|
|
|
25119
25154
|
});
|
|
25120
25155
|
|
|
25121
25156
|
// packages/experience-design-system-cli/src/tui/import/steps/08-generation/use-generation.ts
|
|
25122
|
-
import { useEffect as
|
|
25157
|
+
import { useEffect as useEffect12, useRef as useRef10, useState as useState18 } from "react";
|
|
25123
25158
|
function useGeneration(input) {
|
|
25124
25159
|
const [state2, setState] = useState18();
|
|
25125
|
-
const current =
|
|
25126
|
-
|
|
25160
|
+
const current = useRef10();
|
|
25161
|
+
useEffect12(() => {
|
|
25127
25162
|
current.current = input;
|
|
25128
25163
|
if (!input) {
|
|
25129
25164
|
setState(void 0);
|
|
@@ -26110,7 +26145,7 @@ var init_scroll_offset = __esm({
|
|
|
26110
26145
|
});
|
|
26111
26146
|
|
|
26112
26147
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx
|
|
26113
|
-
import React13, { useEffect as
|
|
26148
|
+
import React13, { useEffect as useEffect13, useLayoutEffect as useLayoutEffect2, useState as useState19 } from "react";
|
|
26114
26149
|
import figures6 from "figures";
|
|
26115
26150
|
import { Box as Box26, measureElement, Text as Text27 } from "ink";
|
|
26116
26151
|
import { Fragment as Fragment6, jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
@@ -27637,7 +27672,7 @@ function FieldEditor({
|
|
|
27637
27672
|
}
|
|
27638
27673
|
return Math.max(start + 1, end2);
|
|
27639
27674
|
};
|
|
27640
|
-
|
|
27675
|
+
useEffect13(() => {
|
|
27641
27676
|
if (focusLevel === "field" || selectedRowIdx < 0) return;
|
|
27642
27677
|
setListScrollStart((previous) => {
|
|
27643
27678
|
if (initialFocusTarget && !initialFocusScrollApplied.current) {
|
|
@@ -29032,7 +29067,7 @@ var init_FinalizeDialog = __esm({
|
|
|
29032
29067
|
});
|
|
29033
29068
|
|
|
29034
29069
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-finalize-preview.ts
|
|
29035
|
-
import { useEffect as
|
|
29070
|
+
import { useEffect as useEffect14, useRef as useRef11, useState as useState20 } from "react";
|
|
29036
29071
|
function useReviewFinalizePreview({
|
|
29037
29072
|
components,
|
|
29038
29073
|
...options
|
|
@@ -29047,9 +29082,9 @@ function useFinalizePreview(opts) {
|
|
|
29047
29082
|
const [status, setStatus] = useState20("idle");
|
|
29048
29083
|
const [removed, setRemoved] = useState20([]);
|
|
29049
29084
|
const [scrollOffset, setScrollOffset] = useState20(0);
|
|
29050
|
-
const generationRef =
|
|
29085
|
+
const generationRef = useRef11(0);
|
|
29051
29086
|
const acceptedKey = [...acceptedKeys].sort().join("\0");
|
|
29052
|
-
|
|
29087
|
+
useEffect14(() => {
|
|
29053
29088
|
if (!open) {
|
|
29054
29089
|
setStatus("idle");
|
|
29055
29090
|
setRemoved([]);
|
|
@@ -29101,7 +29136,7 @@ var init_use_finalize_preview = __esm({
|
|
|
29101
29136
|
});
|
|
29102
29137
|
|
|
29103
29138
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-session.ts
|
|
29104
|
-
import { useCallback as useCallback2, useEffect as
|
|
29139
|
+
import { useCallback as useCallback2, useEffect as useEffect15, useRef as useRef12, useState as useState21 } from "react";
|
|
29105
29140
|
function useReviewSession({
|
|
29106
29141
|
loadSession,
|
|
29107
29142
|
tokensPath,
|
|
@@ -29120,7 +29155,7 @@ function useReviewSession({
|
|
|
29120
29155
|
}));
|
|
29121
29156
|
return { result, catalog };
|
|
29122
29157
|
}, [loadSession, tokensPath]);
|
|
29123
|
-
|
|
29158
|
+
useEffect15(() => {
|
|
29124
29159
|
let disposed = false;
|
|
29125
29160
|
void (async () => {
|
|
29126
29161
|
try {
|
|
@@ -29173,7 +29208,7 @@ function useReviewSession({
|
|
|
29173
29208
|
function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
|
|
29174
29209
|
const [reviewMetadata, setReviewMetadata] = useState21(null);
|
|
29175
29210
|
const [componentRationale, setComponentRationale] = useState21(null);
|
|
29176
|
-
|
|
29211
|
+
useEffect15(() => {
|
|
29177
29212
|
const current = components[selectedIdx];
|
|
29178
29213
|
if (!current) {
|
|
29179
29214
|
setReviewMetadata(null);
|
|
@@ -29203,9 +29238,9 @@ function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
|
|
|
29203
29238
|
return { reviewMetadata, componentRationale };
|
|
29204
29239
|
}
|
|
29205
29240
|
function useReviewHistory({ loading, components, createSnapshot, applySnapshot }) {
|
|
29206
|
-
const historyRef =
|
|
29207
|
-
const historySeededRef =
|
|
29208
|
-
|
|
29241
|
+
const historyRef = useRef12(null);
|
|
29242
|
+
const historySeededRef = useRef12(false);
|
|
29243
|
+
useEffect15(() => {
|
|
29209
29244
|
if (loading || historySeededRef.current) return;
|
|
29210
29245
|
historySeededRef.current = true;
|
|
29211
29246
|
historyRef.current = createHistoryStack(createSnapshot(components));
|
|
@@ -29287,7 +29322,7 @@ var init_token_suggestions = __esm({
|
|
|
29287
29322
|
});
|
|
29288
29323
|
|
|
29289
29324
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-editor.ts
|
|
29290
|
-
import { useEffect as
|
|
29325
|
+
import { useEffect as useEffect16, useRef as useRef13, useState as useState22 } from "react";
|
|
29291
29326
|
function parseReviewEntry(draftValue) {
|
|
29292
29327
|
const parsed = JSON.parse(draftValue);
|
|
29293
29328
|
const keys = Object.keys(parsed);
|
|
@@ -29319,9 +29354,9 @@ function useReviewEditor({
|
|
|
29319
29354
|
const [tokenReviewEditing, setTokenReviewEditing] = useState22(false);
|
|
29320
29355
|
const [tokenReviewEditCursor, setTokenReviewEditCursor] = useState22(0);
|
|
29321
29356
|
const [tokenReviewEditSelection, setTokenReviewEditSelection] = useState22(/* @__PURE__ */ new Set());
|
|
29322
|
-
const tokenReviewSuggestedRef =
|
|
29323
|
-
const pendingGRef =
|
|
29324
|
-
|
|
29357
|
+
const tokenReviewSuggestedRef = useRef13(/* @__PURE__ */ new Map());
|
|
29358
|
+
const pendingGRef = useRef13(false);
|
|
29359
|
+
useEffect16(() => {
|
|
29325
29360
|
setTokenReviewRow(0);
|
|
29326
29361
|
setTokenReviewEditing(false);
|
|
29327
29362
|
setTokenReviewEditCursor(0);
|
|
@@ -29803,24 +29838,24 @@ var init_preview_annotations = __esm({
|
|
|
29803
29838
|
});
|
|
29804
29839
|
|
|
29805
29840
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-live-preview.ts
|
|
29806
|
-
import { useCallback as useCallback3, useEffect as
|
|
29841
|
+
import { useCallback as useCallback3, useEffect as useEffect17, useRef as useRef14, useState as useState24 } from "react";
|
|
29807
29842
|
function useLivePreview(opts) {
|
|
29808
29843
|
const debounceMs = opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
29809
29844
|
const [status, setStatus] = useState24("idle");
|
|
29810
29845
|
const [disabled, setDisabled] = useState24(false);
|
|
29811
|
-
const timerRef =
|
|
29812
|
-
const generationRef =
|
|
29813
|
-
const latestRef =
|
|
29814
|
-
const inflightRef =
|
|
29815
|
-
const optsRef =
|
|
29816
|
-
|
|
29846
|
+
const timerRef = useRef14(null);
|
|
29847
|
+
const generationRef = useRef14(0);
|
|
29848
|
+
const latestRef = useRef14(0);
|
|
29849
|
+
const inflightRef = useRef14(0);
|
|
29850
|
+
const optsRef = useRef14(opts);
|
|
29851
|
+
useEffect17(() => {
|
|
29817
29852
|
optsRef.current = opts;
|
|
29818
29853
|
});
|
|
29819
|
-
const disabledRef =
|
|
29820
|
-
|
|
29854
|
+
const disabledRef = useRef14(disabled);
|
|
29855
|
+
useEffect17(() => {
|
|
29821
29856
|
disabledRef.current = disabled;
|
|
29822
29857
|
}, [disabled]);
|
|
29823
|
-
|
|
29858
|
+
useEffect17(() => {
|
|
29824
29859
|
return () => {
|
|
29825
29860
|
if (timerRef.current) {
|
|
29826
29861
|
clearTimeout(timerRef.current);
|
|
@@ -29901,7 +29936,7 @@ var init_use_live_preview = __esm({
|
|
|
29901
29936
|
});
|
|
29902
29937
|
|
|
29903
29938
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-preview.ts
|
|
29904
|
-
import { useCallback as useCallback4, useEffect as
|
|
29939
|
+
import { useCallback as useCallback4, useEffect as useEffect18, useState as useState25 } from "react";
|
|
29905
29940
|
function useReviewPreview({
|
|
29906
29941
|
components,
|
|
29907
29942
|
loading,
|
|
@@ -29943,13 +29978,13 @@ function useReviewPreview({
|
|
|
29943
29978
|
deleteAllComponents
|
|
29944
29979
|
});
|
|
29945
29980
|
const [spinnerTick, setSpinnerTick] = useState25(0);
|
|
29946
|
-
|
|
29981
|
+
useEffect18(() => {
|
|
29947
29982
|
if (livePreviewHook.status !== "running") return;
|
|
29948
29983
|
const id = setInterval(() => setSpinnerTick((tick) => tick + 1), 80);
|
|
29949
29984
|
return () => clearInterval(id);
|
|
29950
29985
|
}, [livePreviewHook.status]);
|
|
29951
29986
|
const livePreviewSpinner = SPINNER_FRAMES[spinnerTick % SPINNER_FRAMES.length];
|
|
29952
|
-
|
|
29987
|
+
useEffect18(() => {
|
|
29953
29988
|
if (loading) return;
|
|
29954
29989
|
if (!livePreview) return;
|
|
29955
29990
|
if (components.length === 0) return;
|
|
@@ -30006,7 +30041,7 @@ var init_LivePreviewSummary = __esm({
|
|
|
30006
30041
|
});
|
|
30007
30042
|
|
|
30008
30043
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx
|
|
30009
|
-
import { useCallback as useCallback5, useEffect as
|
|
30044
|
+
import { useCallback as useCallback5, useEffect as useEffect19, useMemo as useMemo6, useRef as useRef15, useState as useState26 } from "react";
|
|
30010
30045
|
import figures8 from "figures";
|
|
30011
30046
|
import { Box as Box38, Text as Text40 } from "ink";
|
|
30012
30047
|
import { Fragment as Fragment14, jsx as jsx48, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
@@ -30220,7 +30255,7 @@ function GenerateReviewStepView({
|
|
|
30220
30255
|
setFinalizeError
|
|
30221
30256
|
} = reviewSurface;
|
|
30222
30257
|
const [removedBannerCollapsed, setRemovedBannerCollapsed] = useState26(false);
|
|
30223
|
-
const removedBannerDefaultedRef =
|
|
30258
|
+
const removedBannerDefaultedRef = useRef15(false);
|
|
30224
30259
|
const [cyclePanelScroll, setCyclePanelScroll] = useState26(0);
|
|
30225
30260
|
const [cyclesCursor, setCyclesCursor] = useState26(0);
|
|
30226
30261
|
const cyclePanel = useOverlayPanel({
|
|
@@ -30240,7 +30275,7 @@ function GenerateReviewStepView({
|
|
|
30240
30275
|
const [breakCursor, setBreakCursor] = useState26(0);
|
|
30241
30276
|
const [breakConfirm, setBreakConfirm] = useState26(false);
|
|
30242
30277
|
const [expandedGroups, setExpandedGroups] = useState26(/* @__PURE__ */ new Set());
|
|
30243
|
-
const seededGroupsRef =
|
|
30278
|
+
const seededGroupsRef = useRef15(false);
|
|
30244
30279
|
const {
|
|
30245
30280
|
searchOpen,
|
|
30246
30281
|
setSearchOpen,
|
|
@@ -30264,7 +30299,7 @@ function GenerateReviewStepView({
|
|
|
30264
30299
|
const [pendingEditorFocus, setPendingEditorFocus] = useState26(null);
|
|
30265
30300
|
const [autoRejected, setAutoRejected] = useState26([]);
|
|
30266
30301
|
const [undoSnapshot, setUndoSnapshot] = useState26(null);
|
|
30267
|
-
const autoRejectFiredRef =
|
|
30302
|
+
const autoRejectFiredRef = useRef15(false);
|
|
30268
30303
|
const [showReloadDialog, setShowReloadDialog] = useState26(false);
|
|
30269
30304
|
const acceptedCountForPreview = components.filter((c2) => c2.status === "accepted").length;
|
|
30270
30305
|
const { previewAnnotations, removedComponents, livePreviewHook, livePreviewSpinner } = useReviewPreview({
|
|
@@ -30327,7 +30362,7 @@ function GenerateReviewStepView({
|
|
|
30327
30362
|
[components]
|
|
30328
30363
|
);
|
|
30329
30364
|
const closures = useMemo6(() => computeAllClosures(componentGraph), [componentGraph]);
|
|
30330
|
-
|
|
30365
|
+
useEffect19(() => {
|
|
30331
30366
|
if (seededGroupsRef.current) return;
|
|
30332
30367
|
if (closures.size === 0 && slotCycles.length === 0) return;
|
|
30333
30368
|
seededGroupsRef.current = true;
|
|
@@ -30354,7 +30389,7 @@ function GenerateReviewStepView({
|
|
|
30354
30389
|
suggestedBreak: cycle.edges.length > 0 ? suggestCycleBreakEdge2(cycle, cycleView.pushBlocking) : null
|
|
30355
30390
|
}));
|
|
30356
30391
|
}, [slotCycles, cycleView]);
|
|
30357
|
-
|
|
30392
|
+
useEffect19(() => {
|
|
30358
30393
|
const decision = computeAutoRejectDecision({
|
|
30359
30394
|
loading,
|
|
30360
30395
|
autoRejectFired: autoRejectFiredRef.current,
|
|
@@ -30397,8 +30432,8 @@ function GenerateReviewStepView({
|
|
|
30397
30432
|
}),
|
|
30398
30433
|
applySnapshot: applyHistorySnapshot
|
|
30399
30434
|
});
|
|
30400
|
-
const autoRejectPushedRef =
|
|
30401
|
-
|
|
30435
|
+
const autoRejectPushedRef = useRef15(false);
|
|
30436
|
+
useEffect19(() => {
|
|
30402
30437
|
if (loading) return;
|
|
30403
30438
|
if (!historySeededRef.current) return;
|
|
30404
30439
|
if (!autoRejectFiredRef.current) return;
|
|
@@ -30482,7 +30517,7 @@ function GenerateReviewStepView({
|
|
|
30482
30517
|
const panelHeight = leftPanelHeight + 2;
|
|
30483
30518
|
const panelContentHeight = Math.max(1, panelHeight - 3);
|
|
30484
30519
|
const cycleViewportHeight = Math.max(1, panelHeight - 4);
|
|
30485
|
-
|
|
30520
|
+
useEffect19(() => {
|
|
30486
30521
|
if (selectableRowPositions.length === 0) return;
|
|
30487
30522
|
const cursorInRange = selectableRowPositions.includes(cursorRowIdx);
|
|
30488
30523
|
const maxScroll = Math.max(0, visibleRowsMemo.length - visibleCount);
|
|
@@ -31564,10 +31599,10 @@ var init_path_utils = __esm({
|
|
|
31564
31599
|
});
|
|
31565
31600
|
|
|
31566
31601
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-blinking-cursor.ts
|
|
31567
|
-
import { useEffect as
|
|
31602
|
+
import { useEffect as useEffect20, useState as useState27 } from "react";
|
|
31568
31603
|
function useBlinkingCursor() {
|
|
31569
31604
|
const [visible, setVisible] = useState27(true);
|
|
31570
|
-
|
|
31605
|
+
useEffect20(() => {
|
|
31571
31606
|
const interval = setInterval(() => setVisible((current) => !current), 500);
|
|
31572
31607
|
return () => clearInterval(interval);
|
|
31573
31608
|
}, []);
|
|
@@ -31704,12 +31739,12 @@ var init_produced = __esm({
|
|
|
31704
31739
|
});
|
|
31705
31740
|
|
|
31706
31741
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-timed-spinner.tsx
|
|
31707
|
-
import { useEffect as
|
|
31742
|
+
import { useEffect as useEffect21, useState as useState29 } from "react";
|
|
31708
31743
|
import { Spinner as Spinner2 } from "@inkjs/ui";
|
|
31709
31744
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
31710
31745
|
function useTimedSpinner() {
|
|
31711
31746
|
const [elapsedSeconds, setElapsedSeconds] = useState29(0);
|
|
31712
|
-
|
|
31747
|
+
useEffect21(() => {
|
|
31713
31748
|
const timer = setInterval(() => setElapsedSeconds((current) => current + 1), 1e3);
|
|
31714
31749
|
return () => {
|
|
31715
31750
|
clearInterval(timer);
|
|
@@ -31978,7 +32013,7 @@ var init_preview_confirmation_input = __esm({
|
|
|
31978
32013
|
});
|
|
31979
32014
|
|
|
31980
32015
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/WizardPreviewStep.tsx
|
|
31981
|
-
import { useEffect as
|
|
32016
|
+
import { useEffect as useEffect22, useState as useState30, useMemo as useMemo7 } from "react";
|
|
31982
32017
|
import { Box as Box44, Text as Text46 } from "ink";
|
|
31983
32018
|
import { Fragment as Fragment16, jsx as jsx55, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
31984
32019
|
function buildPreviewSummaryLines(preview) {
|
|
@@ -32188,7 +32223,7 @@ function WizardPreviewStep({
|
|
|
32188
32223
|
const activeLines = diffExpanded ? diffLines : summaryLines;
|
|
32189
32224
|
const maxScroll = Math.max(0, activeLines.length - viewportHeight);
|
|
32190
32225
|
const boundedScrollOffset = Math.min(scrollOffset, maxScroll);
|
|
32191
|
-
|
|
32226
|
+
useEffect22(() => {
|
|
32192
32227
|
setScrollOffset((previous) => Math.min(previous, maxScroll));
|
|
32193
32228
|
}, [maxScroll]);
|
|
32194
32229
|
useImmediateInput((input, key) => {
|
|
@@ -33236,9 +33271,9 @@ var init_controller = __esm({
|
|
|
33236
33271
|
});
|
|
33237
33272
|
|
|
33238
33273
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
|
|
33239
|
-
import { useEffect as
|
|
33274
|
+
import { useEffect as useEffect23, useRef as useRef16, useSyncExternalStore } from "react";
|
|
33240
33275
|
function useFlow(start, options = {}) {
|
|
33241
|
-
const controller =
|
|
33276
|
+
const controller = useRef16();
|
|
33242
33277
|
if (start && !controller.current) {
|
|
33243
33278
|
try {
|
|
33244
33279
|
startWizardLog();
|
|
@@ -33255,7 +33290,7 @@ function useFlow(start, options = {}) {
|
|
|
33255
33290
|
(listener) => current?.subscribe(listener) ?? (() => void 0),
|
|
33256
33291
|
() => current?.getState()
|
|
33257
33292
|
);
|
|
33258
|
-
|
|
33293
|
+
useEffect23(() => {
|
|
33259
33294
|
if (!start) controller.current = void 0;
|
|
33260
33295
|
}, [start]);
|
|
33261
33296
|
return current && state2 ? { controller: current, state: state2 } : void 0;
|
|
@@ -33334,7 +33369,7 @@ var init_help_info = __esm({
|
|
|
33334
33369
|
});
|
|
33335
33370
|
|
|
33336
33371
|
// packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
|
|
33337
|
-
import { useEffect as
|
|
33372
|
+
import { useEffect as useEffect24, useState as useState31 } from "react";
|
|
33338
33373
|
import { Box as Box46, Text as Text47, useInput as useInput13 } from "ink";
|
|
33339
33374
|
import { Fragment as Fragment17, jsx as jsx57, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
33340
33375
|
function Section({ title, rows }) {
|
|
@@ -33348,7 +33383,7 @@ function Section({ title, rows }) {
|
|
|
33348
33383
|
}
|
|
33349
33384
|
function HelpScreen({ onDone }) {
|
|
33350
33385
|
const [info, setInfo] = useState31();
|
|
33351
|
-
|
|
33386
|
+
useEffect24(() => {
|
|
33352
33387
|
startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
|
|
33353
33388
|
void readHelpInfo().then(setInfo);
|
|
33354
33389
|
}, []);
|
|
@@ -33769,7 +33804,7 @@ var init_AgentStatusBadge = __esm({
|
|
|
33769
33804
|
});
|
|
33770
33805
|
|
|
33771
33806
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx
|
|
33772
|
-
import { useEffect as
|
|
33807
|
+
import { useEffect as useEffect25, useState as useState33 } from "react";
|
|
33773
33808
|
import { Box as Box48, Text as Text50 } from "ink";
|
|
33774
33809
|
import { jsx as jsx60, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
33775
33810
|
function StatusHeading() {
|
|
@@ -33790,7 +33825,7 @@ function AgentDetail({
|
|
|
33790
33825
|
const [testing, setTesting] = useState33(false);
|
|
33791
33826
|
const [notice, setNotice] = useState33(null);
|
|
33792
33827
|
const [checks, setChecks] = useState33(void 0);
|
|
33793
|
-
|
|
33828
|
+
useEffect25(() => {
|
|
33794
33829
|
let active = true;
|
|
33795
33830
|
setChecks(void 0);
|
|
33796
33831
|
const timer = setTimeout(() => {
|
|
@@ -33882,7 +33917,7 @@ var init_AgentDetail = __esm({
|
|
|
33882
33917
|
});
|
|
33883
33918
|
|
|
33884
33919
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentsScreen.tsx
|
|
33885
|
-
import { useEffect as
|
|
33920
|
+
import { useEffect as useEffect26, useRef as useRef17, useState as useState34 } from "react";
|
|
33886
33921
|
import { Box as Box49, Text as Text51, useInput as useInput15 } from "ink";
|
|
33887
33922
|
import { Fragment as Fragment18, jsx as jsx61, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
33888
33923
|
function AgentsScreen({ onDone }) {
|
|
@@ -33893,7 +33928,7 @@ function AgentsScreen({ onDone }) {
|
|
|
33893
33928
|
const [saving, setSaving] = useState34(false);
|
|
33894
33929
|
const [loadError, setLoadError] = useState34(null);
|
|
33895
33930
|
const [checks, setChecks] = useState34({});
|
|
33896
|
-
const visit =
|
|
33931
|
+
const visit = useRef17({
|
|
33897
33932
|
trail: createTrail(),
|
|
33898
33933
|
before: void 0,
|
|
33899
33934
|
environment: void 0,
|
|
@@ -33906,7 +33941,7 @@ function AgentsScreen({ onDone }) {
|
|
|
33906
33941
|
);
|
|
33907
33942
|
}
|
|
33908
33943
|
};
|
|
33909
|
-
|
|
33944
|
+
useEffect26(() => {
|
|
33910
33945
|
readAgentConfig().then((loaded) => {
|
|
33911
33946
|
setConfig(loaded);
|
|
33912
33947
|
inspectAll(loaded);
|
|
@@ -34132,7 +34167,7 @@ var init_project_store = __esm({
|
|
|
34132
34167
|
});
|
|
34133
34168
|
|
|
34134
34169
|
// packages/experience-design-system-cli/src/tui/settings/configuration/project/ProjectScreen.tsx
|
|
34135
|
-
import { useEffect as
|
|
34170
|
+
import { useEffect as useEffect27, useRef as useRef18, useState as useState35 } from "react";
|
|
34136
34171
|
import { Box as Box50, Text as Text52, useInput as useInput16 } from "ink";
|
|
34137
34172
|
import { Fragment as Fragment19, jsx as jsx62, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
34138
34173
|
function debugFields(config) {
|
|
@@ -34151,14 +34186,14 @@ function ProjectScreen({ onDone }) {
|
|
|
34151
34186
|
const [saving, setSaving] = useState35(false);
|
|
34152
34187
|
const [notice, setNotice] = useState35(null);
|
|
34153
34188
|
const [loadError, setLoadError] = useState35(null);
|
|
34154
|
-
const visit =
|
|
34189
|
+
const visit = useRef18({
|
|
34155
34190
|
trail: createTrail(),
|
|
34156
34191
|
before: void 0,
|
|
34157
34192
|
persisted: void 0,
|
|
34158
34193
|
error: ""
|
|
34159
34194
|
}).current;
|
|
34160
34195
|
const scrub = (err) => scrubError(err, [config?.cmaToken ?? ""]);
|
|
34161
|
-
|
|
34196
|
+
useEffect27(() => {
|
|
34162
34197
|
readCredentials().then((cfg) => {
|
|
34163
34198
|
setConfig(cfg);
|
|
34164
34199
|
visit.before = snapshotOf(cfg);
|
|
@@ -34345,13 +34380,13 @@ var init_ConfigurationScreen = __esm({
|
|
|
34345
34380
|
});
|
|
34346
34381
|
|
|
34347
34382
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
34348
|
-
import { useEffect as
|
|
34383
|
+
import { useEffect as useEffect28, useState as useState37 } from "react";
|
|
34349
34384
|
import { Box as Box52, Text as Text54, useInput as useInput18 } from "ink";
|
|
34350
34385
|
import { Fragment as Fragment20, jsx as jsx64, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
34351
34386
|
function OptInAnalyticsScreen({ onDone }) {
|
|
34352
34387
|
const [loading, setLoading] = useState37(true);
|
|
34353
34388
|
const [enabled, setEnabled] = useState37(true);
|
|
34354
|
-
|
|
34389
|
+
useEffect28(() => {
|
|
34355
34390
|
readAnalyticsSetting().then((setting) => {
|
|
34356
34391
|
setEnabled(setting.enabled);
|
|
34357
34392
|
setLoading(false);
|
|
@@ -34414,7 +34449,7 @@ var init_screen12 = __esm({
|
|
|
34414
34449
|
});
|
|
34415
34450
|
|
|
34416
34451
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
34417
|
-
import { useEffect as
|
|
34452
|
+
import { useEffect as useEffect29, useRef as useRef19, useState as useState38 } from "react";
|
|
34418
34453
|
import { Box as Box53, Text as Text55, useInput as useInput19 } from "ink";
|
|
34419
34454
|
import { Fragment as Fragment21, jsx as jsx65, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
34420
34455
|
function DebugModeScreen({ onDone }) {
|
|
@@ -34424,8 +34459,8 @@ function DebugModeScreen({ onDone }) {
|
|
|
34424
34459
|
RETENTION_CHOICES[RETENTION_CHOICES.length - 1]
|
|
34425
34460
|
);
|
|
34426
34461
|
const [notice, setNotice] = useState38(null);
|
|
34427
|
-
const visit =
|
|
34428
|
-
|
|
34462
|
+
const visit = useRef19({ trail: createTrail(), before: void 0, error: "" }).current;
|
|
34463
|
+
useEffect29(() => {
|
|
34429
34464
|
readDebugModeSetting().then((loaded) => {
|
|
34430
34465
|
setSetting(loaded);
|
|
34431
34466
|
setPending(loaded.retentionDays);
|
|
@@ -34566,7 +34601,7 @@ var app_exports = {};
|
|
|
34566
34601
|
__export(app_exports, {
|
|
34567
34602
|
runApp: () => runApp
|
|
34568
34603
|
});
|
|
34569
|
-
import { useEffect as
|
|
34604
|
+
import { useEffect as useEffect30, useState as useState39 } from "react";
|
|
34570
34605
|
import { Fragment as Fragment22, jsx as jsx66 } from "react/jsx-runtime";
|
|
34571
34606
|
function App({ importOptions, inkClear }) {
|
|
34572
34607
|
const [screen, setScreen] = useState39("start");
|
|
@@ -34600,7 +34635,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34600
34635
|
const [flowStart, setFlowStart] = useState39();
|
|
34601
34636
|
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
34602
34637
|
const [importDefaults, setImportDefaults] = useState39();
|
|
34603
|
-
|
|
34638
|
+
useEffect30(() => {
|
|
34604
34639
|
if (screen !== "import") {
|
|
34605
34640
|
setImportDefaults(void 0);
|
|
34606
34641
|
return;
|
|
@@ -34673,7 +34708,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34673
34708
|
}
|
|
34674
34709
|
});
|
|
34675
34710
|
};
|
|
34676
|
-
|
|
34711
|
+
useEffect30(() => {
|
|
34677
34712
|
if (!tokensOnlyRun || tokensOnly?.status !== "done" || !tokensOnly.result.ok) return;
|
|
34678
34713
|
const { credentialsSkipped, input, tokens } = tokensOnlyRun;
|
|
34679
34714
|
const { tokensPath, tokenSessionId, tokenCount } = tokensOnly.result;
|
|
@@ -34695,12 +34730,12 @@ function App({ importOptions, inkClear }) {
|
|
|
34695
34730
|
}
|
|
34696
34731
|
});
|
|
34697
34732
|
}, [tokensOnly, tokensOnlyRun]);
|
|
34698
|
-
|
|
34733
|
+
useEffect30(() => {
|
|
34699
34734
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
34700
34735
|
setExtractionRun(void 0);
|
|
34701
34736
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
34702
34737
|
}, [extraction, extractionRun]);
|
|
34703
|
-
|
|
34738
|
+
useEffect30(() => {
|
|
34704
34739
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
34705
34740
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
34706
34741
|
setGenerationInput({
|
|
@@ -34718,7 +34753,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34718
34753
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
34719
34754
|
});
|
|
34720
34755
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
34721
|
-
|
|
34756
|
+
useEffect30(() => {
|
|
34722
34757
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
34723
34758
|
const { credentialsSkipped, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
34724
34759
|
inkClear();
|
|
@@ -34801,6 +34836,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34801
34836
|
return /* @__PURE__ */ jsx66(
|
|
34802
34837
|
WelcomeScreen,
|
|
34803
34838
|
{
|
|
34839
|
+
mode: target,
|
|
34804
34840
|
onContinue: (projectPath) => answer({ projectPath }),
|
|
34805
34841
|
onQuit: () => goBackFrom("project"),
|
|
34806
34842
|
initialPath: importDefaults.componentDir
|