@contentful/experience-design-system-cli 2.34.3 → 2.34.4-dev-build-ddc181b.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/README.md +26 -13
- package/dist/package.json +1 -1
- package/dist/src/credentials-store.d.ts +7 -0
- package/dist/src/import/orchestrator.d.ts +2 -0
- package/dist/src/import/strip-allowed-components.d.ts +18 -0
- package/dist/src/import/tui/WizardApp.d.ts +3 -1
- package/dist/src/import/tui/final-review-host.d.ts +3 -1
- package/dist/src/import/tui/scope-gate-host.d.ts +3 -1
- package/dist/src/import/tui/steps/AtomicGenerateReviewStep.d.ts +28 -0
- package/dist/src/import/tui/steps/AtomicScopeGateStep.d.ts +3 -0
- package/dist/src/index.js +1668 -883
- package/dist/src/lib/command-options.d.ts +1 -0
- package/dist/src/lib/composition-mode.d.ts +30 -0
- package/dist/src/runs/modify-launcher.d.ts +4 -0
- package/dist/src/runs/store.d.ts +5 -0
- package/dist/src/setup/composition-mode-prompt.d.ts +14 -0
- package/package.json +6 -6
package/dist/src/index.js
CHANGED
|
@@ -11781,6 +11781,8 @@ function FinalizeDialog({
|
|
|
11781
11781
|
onConfirm,
|
|
11782
11782
|
onCancel,
|
|
11783
11783
|
removed = [],
|
|
11784
|
+
// Default 'done' so callers that pass a ready `removed` list (e.g. the atomic
|
|
11785
|
+
// review step) render it immediately without threading a status.
|
|
11784
11786
|
previewStatus = "done",
|
|
11785
11787
|
removedScrollOffset = 0
|
|
11786
11788
|
}) {
|
|
@@ -14296,6 +14298,33 @@ var init_SelectView = __esm({
|
|
|
14296
14298
|
}
|
|
14297
14299
|
});
|
|
14298
14300
|
|
|
14301
|
+
// packages/experience-design-system-cli/src/lib/composition-mode.ts
|
|
14302
|
+
function isCompositionMode(value) {
|
|
14303
|
+
return COMPOSITION_MODES.includes(value);
|
|
14304
|
+
}
|
|
14305
|
+
function hasCompositionSource(opts) {
|
|
14306
|
+
return !!opts.compositionMap || !!opts.compositionAgent || !!opts.compositionRefresh || !!opts.generateMap;
|
|
14307
|
+
}
|
|
14308
|
+
function resolveCompositionMode(opts, configMode) {
|
|
14309
|
+
if (opts.composite) return "composite";
|
|
14310
|
+
if (opts.atomic) return "atomic";
|
|
14311
|
+
if (hasCompositionSource(opts)) return "composite";
|
|
14312
|
+
const env = process.env["EXPERIENCES_COMPOSITION_MODE"];
|
|
14313
|
+
if (env !== void 0 && env !== "") {
|
|
14314
|
+
const v = env.toLowerCase();
|
|
14315
|
+
if (isCompositionMode(v)) return v;
|
|
14316
|
+
}
|
|
14317
|
+
if (configMode && isCompositionMode(configMode)) return configMode;
|
|
14318
|
+
return "atomic";
|
|
14319
|
+
}
|
|
14320
|
+
var COMPOSITION_MODES;
|
|
14321
|
+
var init_composition_mode = __esm({
|
|
14322
|
+
"packages/experience-design-system-cli/src/lib/composition-mode.ts"() {
|
|
14323
|
+
"use strict";
|
|
14324
|
+
COMPOSITION_MODES = ["composite", "atomic"];
|
|
14325
|
+
}
|
|
14326
|
+
});
|
|
14327
|
+
|
|
14299
14328
|
// packages/experience-design-system-cli/src/lib/command-options.ts
|
|
14300
14329
|
function addArtifactInputOptions(cmd) {
|
|
14301
14330
|
return cmd.option("--components <path>", "Path to components.json (CDF)").option("--tokens <path>", "Path to tokens.json (DTCG)").option("--session <id>", "Pipeline session ID to load generated components from");
|
|
@@ -14303,6 +14332,9 @@ function addArtifactInputOptions(cmd) {
|
|
|
14303
14332
|
function addContentfulTargetOptions(cmd) {
|
|
14304
14333
|
return cmd.requiredOption("--space-id <id>", "Contentful space ID").requiredOption("--environment-id <id>", "Contentful environment ID").option("--cma-token <token>", "CMA personal access token (or set CONTENTFUL_MANAGEMENT_TOKEN)").option("--host <url>", "Override API base URL");
|
|
14305
14334
|
}
|
|
14335
|
+
function addCompositionOptions(cmd) {
|
|
14336
|
+
return cmd.option("--composite", "Import embedded-component hierarchy (opt in; default is atomic)").option("--atomic", "Import flat components with no embedded-component hierarchy (default)");
|
|
14337
|
+
}
|
|
14306
14338
|
function collectOptionValue(value, previous) {
|
|
14307
14339
|
return [...previous, value];
|
|
14308
14340
|
}
|
|
@@ -14321,9 +14353,116 @@ var init_command_options = __esm({
|
|
|
14321
14353
|
}
|
|
14322
14354
|
});
|
|
14323
14355
|
|
|
14356
|
+
// packages/experience-design-system-cli/src/import/strip-allowed-components.ts
|
|
14357
|
+
function stripAllowedComponents(components) {
|
|
14358
|
+
return components.map(({ key, entry }) => {
|
|
14359
|
+
if (!entry.$slots) return { key, entry };
|
|
14360
|
+
const $slots = {};
|
|
14361
|
+
for (const [slotName, slotDef] of Object.entries(entry.$slots)) {
|
|
14362
|
+
const { $allowedComponents: _dropped, ...rest } = slotDef;
|
|
14363
|
+
$slots[slotName] = rest;
|
|
14364
|
+
}
|
|
14365
|
+
return { key, entry: { ...entry, $slots } };
|
|
14366
|
+
});
|
|
14367
|
+
}
|
|
14368
|
+
var init_strip_allowed_components = __esm({
|
|
14369
|
+
"packages/experience-design-system-cli/src/import/strip-allowed-components.ts"() {
|
|
14370
|
+
"use strict";
|
|
14371
|
+
}
|
|
14372
|
+
});
|
|
14373
|
+
|
|
14374
|
+
// packages/experience-design-system-cli/src/credentials-store.ts
|
|
14375
|
+
var credentials_store_exports = {};
|
|
14376
|
+
__export(credentials_store_exports, {
|
|
14377
|
+
experiencesCredentialsPath: () => experiencesCredentialsPath,
|
|
14378
|
+
readExperiencesCredentials: () => readExperiencesCredentials,
|
|
14379
|
+
writeExperiencesCredentials: () => writeExperiencesCredentials
|
|
14380
|
+
});
|
|
14381
|
+
import { readFile as readFile8, writeFile as writeFile2, mkdir as mkdir2 } from "node:fs/promises";
|
|
14382
|
+
import { join as join11 } from "node:path";
|
|
14383
|
+
import { homedir as homedir4 } from "node:os";
|
|
14384
|
+
async function readExperiencesCredentials() {
|
|
14385
|
+
try {
|
|
14386
|
+
const raw = await readFile8(CREDENTIALS_PATH, "utf8");
|
|
14387
|
+
const parsed = JSON.parse(raw);
|
|
14388
|
+
const host = toConfiguredHost(parsed.host || process.env["EDS_HOST"]);
|
|
14389
|
+
return {
|
|
14390
|
+
spaceId: parsed.spaceId || process.env["CONTENTFUL_SPACE_ID"] || "",
|
|
14391
|
+
environmentId: parsed.environmentId || process.env["CONTENTFUL_ENVIRONMENT_ID"] || "",
|
|
14392
|
+
cmaToken: parsed.cmaToken || process.env["CONTENTFUL_MANAGEMENT_TOKEN"] || "",
|
|
14393
|
+
...host ? { host } : {},
|
|
14394
|
+
...parsed.agent ? { agent: parsed.agent } : {},
|
|
14395
|
+
...parsed.agentModel ? { agentModel: parsed.agentModel } : {},
|
|
14396
|
+
...parsed.selectPromptPath ? { selectPromptPath: parsed.selectPromptPath } : {},
|
|
14397
|
+
...parsed.generatePromptPath ? { generatePromptPath: parsed.generatePromptPath } : {},
|
|
14398
|
+
...typeof parsed.autoFilter === "boolean" ? { autoFilter: parsed.autoFilter } : {},
|
|
14399
|
+
...typeof parsed.debug === "boolean" ? { debug: parsed.debug } : {},
|
|
14400
|
+
...typeof parsed.analyticsDisabled === "boolean" ? { analyticsDisabled: parsed.analyticsDisabled } : {},
|
|
14401
|
+
...typeof parsed.compositionMode === "string" && isCompositionMode(parsed.compositionMode) ? { compositionMode: parsed.compositionMode } : {}
|
|
14402
|
+
};
|
|
14403
|
+
} catch {
|
|
14404
|
+
const host = toConfiguredHost(process.env["EDS_HOST"]);
|
|
14405
|
+
return {
|
|
14406
|
+
spaceId: process.env["CONTENTFUL_SPACE_ID"] ?? "",
|
|
14407
|
+
environmentId: process.env["CONTENTFUL_ENVIRONMENT_ID"] ?? "",
|
|
14408
|
+
cmaToken: process.env["CONTENTFUL_MANAGEMENT_TOKEN"] ?? "",
|
|
14409
|
+
...host ? { host } : {}
|
|
14410
|
+
};
|
|
14411
|
+
}
|
|
14412
|
+
}
|
|
14413
|
+
async function writeExperiencesCredentials(creds) {
|
|
14414
|
+
const {
|
|
14415
|
+
host: _host,
|
|
14416
|
+
agent,
|
|
14417
|
+
agentModel,
|
|
14418
|
+
selectPromptPath,
|
|
14419
|
+
generatePromptPath,
|
|
14420
|
+
autoFilter,
|
|
14421
|
+
debug,
|
|
14422
|
+
analyticsDisabled,
|
|
14423
|
+
compositionMode,
|
|
14424
|
+
...rest
|
|
14425
|
+
} = creds;
|
|
14426
|
+
const host = toConfiguredHost(creds.host);
|
|
14427
|
+
await mkdir2(CREDENTIALS_DIR, { recursive: true });
|
|
14428
|
+
await writeFile2(
|
|
14429
|
+
CREDENTIALS_PATH,
|
|
14430
|
+
JSON.stringify(
|
|
14431
|
+
{
|
|
14432
|
+
...rest,
|
|
14433
|
+
...host ? { host } : {},
|
|
14434
|
+
...agent ? { agent } : {},
|
|
14435
|
+
...agentModel ? { agentModel } : {},
|
|
14436
|
+
...selectPromptPath ? { selectPromptPath } : {},
|
|
14437
|
+
...generatePromptPath ? { generatePromptPath } : {},
|
|
14438
|
+
...typeof autoFilter === "boolean" ? { autoFilter } : {},
|
|
14439
|
+
...typeof debug === "boolean" ? { debug } : {},
|
|
14440
|
+
...typeof analyticsDisabled === "boolean" ? { analyticsDisabled } : {},
|
|
14441
|
+
...compositionMode && isCompositionMode(compositionMode) ? { compositionMode } : {}
|
|
14442
|
+
},
|
|
14443
|
+
null,
|
|
14444
|
+
2
|
|
14445
|
+
) + "\n",
|
|
14446
|
+
{ mode: 384 }
|
|
14447
|
+
);
|
|
14448
|
+
}
|
|
14449
|
+
function experiencesCredentialsPath() {
|
|
14450
|
+
return CREDENTIALS_PATH;
|
|
14451
|
+
}
|
|
14452
|
+
var CREDENTIALS_DIR, CREDENTIALS_PATH;
|
|
14453
|
+
var init_credentials_store = __esm({
|
|
14454
|
+
"packages/experience-design-system-cli/src/credentials-store.ts"() {
|
|
14455
|
+
"use strict";
|
|
14456
|
+
init_host_utils();
|
|
14457
|
+
init_composition_mode();
|
|
14458
|
+
CREDENTIALS_DIR = join11(homedir4(), ".config", "experiences");
|
|
14459
|
+
CREDENTIALS_PATH = join11(CREDENTIALS_DIR, "credentials.json");
|
|
14460
|
+
}
|
|
14461
|
+
});
|
|
14462
|
+
|
|
14324
14463
|
// packages/experience-design-system-cli/src/analytics/client.ts
|
|
14325
14464
|
import { readFileSync as readFileSync7 } from "node:fs";
|
|
14326
|
-
import { join as
|
|
14465
|
+
import { join as join12 } from "node:path";
|
|
14327
14466
|
import { Analytics } from "@segment/analytics-node";
|
|
14328
14467
|
function cliVersion() {
|
|
14329
14468
|
return pkg2.version;
|
|
@@ -14377,7 +14516,7 @@ var init_client2 = __esm({
|
|
|
14377
14516
|
"packages/experience-design-system-cli/src/analytics/client.ts"() {
|
|
14378
14517
|
"use strict";
|
|
14379
14518
|
init_cli_path();
|
|
14380
|
-
pkg2 = JSON.parse(readFileSync7(
|
|
14519
|
+
pkg2 = JSON.parse(readFileSync7(join12(findPkgRoot(), "package.json"), "utf8"));
|
|
14381
14520
|
DEFAULT_WRITE_KEY = "6DmxiEPN3SV1vbRTTMcNqDzCvkfwT06N";
|
|
14382
14521
|
analyticsClient = null;
|
|
14383
14522
|
persistedDisabled = false;
|
|
@@ -14673,8 +14812,8 @@ var init_path_exists = __esm({
|
|
|
14673
14812
|
// packages/experience-design-system-cli/src/apply/command.ts
|
|
14674
14813
|
import { createElement, useState as useState6 } from "react";
|
|
14675
14814
|
import { render, useInput as useInput2 } from "ink";
|
|
14676
|
-
import { readFile as
|
|
14677
|
-
import { join as
|
|
14815
|
+
import { readFile as readFile9, readdir, stat } from "node:fs/promises";
|
|
14816
|
+
import { join as join13 } from "node:path";
|
|
14678
14817
|
import {
|
|
14679
14818
|
validateCDF,
|
|
14680
14819
|
flattenDTCG as flattenDTCG2,
|
|
@@ -14696,7 +14835,7 @@ async function assertFileExists(flag, p) {
|
|
|
14696
14835
|
async function readJsonFile(flag, p) {
|
|
14697
14836
|
let text;
|
|
14698
14837
|
try {
|
|
14699
|
-
text = await
|
|
14838
|
+
text = await readFile9(p, "utf8");
|
|
14700
14839
|
} catch {
|
|
14701
14840
|
return await die(`Error: file not found: ${p} (from ${flag})`);
|
|
14702
14841
|
}
|
|
@@ -14718,7 +14857,7 @@ async function collectJsonFiles(dir) {
|
|
|
14718
14857
|
await Promise.all(
|
|
14719
14858
|
entries.map(async (entry) => {
|
|
14720
14859
|
if (IGNORE_TOKEN_DIRS.has(entry)) return;
|
|
14721
|
-
const full =
|
|
14860
|
+
const full = join13(current, entry);
|
|
14722
14861
|
let s;
|
|
14723
14862
|
try {
|
|
14724
14863
|
s = await stat(full);
|
|
@@ -14750,7 +14889,7 @@ async function readTokensFromPath(flag, p) {
|
|
|
14750
14889
|
for (const file of files.sort()) {
|
|
14751
14890
|
let text;
|
|
14752
14891
|
try {
|
|
14753
|
-
text = await
|
|
14892
|
+
text = await readFile9(file, "utf8");
|
|
14754
14893
|
} catch {
|
|
14755
14894
|
continue;
|
|
14756
14895
|
}
|
|
@@ -14787,6 +14926,7 @@ ${errors.map((e) => ` ${e.path}: ${e.message}`).join("\n")}`
|
|
|
14787
14926
|
function addSharedApplyOptions(command) {
|
|
14788
14927
|
addArtifactInputOptions(command);
|
|
14789
14928
|
addContentfulTargetOptions(command);
|
|
14929
|
+
addCompositionOptions(command);
|
|
14790
14930
|
}
|
|
14791
14931
|
function splitSelectedKeys(selectedKeys) {
|
|
14792
14932
|
const selectedComponentKeys = /* @__PURE__ */ new Set();
|
|
@@ -14939,6 +15079,14 @@ async function resolveSharedInputs(opts) {
|
|
|
14939
15079
|
}
|
|
14940
15080
|
components = result.components;
|
|
14941
15081
|
}
|
|
15082
|
+
let configMode;
|
|
15083
|
+
try {
|
|
15084
|
+
configMode = (await readExperiencesCredentials()).compositionMode;
|
|
15085
|
+
} catch {
|
|
15086
|
+
}
|
|
15087
|
+
if (resolveCompositionMode(opts, configMode) === "atomic") {
|
|
15088
|
+
components = stripAllowedComponents(components);
|
|
15089
|
+
}
|
|
14942
15090
|
let tokens = [];
|
|
14943
15091
|
if (opts.tokens) {
|
|
14944
15092
|
tokens = await readTokensFromPath("--tokens", opts.tokens);
|
|
@@ -15426,7 +15574,10 @@ var init_command = __esm({
|
|
|
15426
15574
|
init_ServerApplyView();
|
|
15427
15575
|
init_SelectView();
|
|
15428
15576
|
init_contentful_urls();
|
|
15577
|
+
init_composition_mode();
|
|
15429
15578
|
init_command_options();
|
|
15579
|
+
init_strip_allowed_components();
|
|
15580
|
+
init_credentials_store();
|
|
15430
15581
|
init_terminal_capabilities();
|
|
15431
15582
|
init_analytics();
|
|
15432
15583
|
init_path_exists();
|
|
@@ -15445,7 +15596,7 @@ var init_manifest = __esm({
|
|
|
15445
15596
|
// packages/experience-design-system-cli/src/analyze/select/tui/App.tsx
|
|
15446
15597
|
import { useCallback as useCallback2, useEffect as useEffect2, useMemo, useRef as useRef2, useState as useState7 } from "react";
|
|
15447
15598
|
import { Box as Box17, Text as Text18, useStdout as useStdout2 } from "ink";
|
|
15448
|
-
import { readFile as
|
|
15599
|
+
import { readFile as readFile10 } from "node:fs/promises";
|
|
15449
15600
|
import { buildManifest as buildManifest2 } from "@contentful/experience-design-system-types";
|
|
15450
15601
|
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
15451
15602
|
function App({ sessionId: sessionId2, artifactsRoot, reviewRoot }) {
|
|
@@ -15610,7 +15761,7 @@ function App({ sessionId: sessionId2, artifactsRoot, reviewRoot }) {
|
|
|
15610
15761
|
if (!session || !selectedId) return;
|
|
15611
15762
|
const selectedComponent = session.components.find((c2) => c2.id === selectedId);
|
|
15612
15763
|
if (!selectedComponent || selectedComponent.sourceCode !== null) return;
|
|
15613
|
-
|
|
15764
|
+
readFile10(selectedComponent.resolvedSourcePath, "utf8").then((code) => {
|
|
15614
15765
|
setSession((prev) => {
|
|
15615
15766
|
if (!prev) return prev;
|
|
15616
15767
|
return {
|
|
@@ -16125,7 +16276,7 @@ var init_component_patch = __esm({
|
|
|
16125
16276
|
});
|
|
16126
16277
|
|
|
16127
16278
|
// packages/experience-design-system-cli/src/analyze/select/command.ts
|
|
16128
|
-
import { access as access4, readFile as
|
|
16279
|
+
import { access as access4, readFile as readFile11 } from "node:fs/promises";
|
|
16129
16280
|
import { dirname as dirname10, resolve as resolve11 } from "node:path";
|
|
16130
16281
|
import { createElement as createElement2 } from "react";
|
|
16131
16282
|
import { render as render2 } from "ink";
|
|
@@ -16216,7 +16367,7 @@ async function runNonInteractive(snapshot, opts, paths, sessionId2) {
|
|
|
16216
16367
|
if (opts.patch) {
|
|
16217
16368
|
let patchOps;
|
|
16218
16369
|
try {
|
|
16219
|
-
const raw = await
|
|
16370
|
+
const raw = await readFile11(resolve11(opts.patch), "utf8");
|
|
16220
16371
|
const parsed = JSON.parse(raw);
|
|
16221
16372
|
if (!Array.isArray(parsed)) {
|
|
16222
16373
|
process.stderr.write(`Error: --patch file must be a JSON array of patch operations: ${opts.patch}
|
|
@@ -16274,7 +16425,7 @@ async function patchReviewStateWithValidationErrors(sessionId2, errors, opts = {
|
|
|
16274
16425
|
let snapshot;
|
|
16275
16426
|
try {
|
|
16276
16427
|
await access4(paths.statePath);
|
|
16277
|
-
snapshot = JSON.parse(await
|
|
16428
|
+
snapshot = JSON.parse(await readFile11(paths.statePath, "utf8"));
|
|
16278
16429
|
} catch {
|
|
16279
16430
|
snapshot = await loadAndValidateForReview(sessionId2, void 0);
|
|
16280
16431
|
snapshot = await ensureRefineSession(sessionId2, artifactsRoot, snapshot);
|
|
@@ -16325,7 +16476,7 @@ async function rejectComponentsByName(sessionId2, names, opts = {}) {
|
|
|
16325
16476
|
const nameSet = new Set(names);
|
|
16326
16477
|
let snapshot;
|
|
16327
16478
|
try {
|
|
16328
|
-
snapshot = JSON.parse(await
|
|
16479
|
+
snapshot = JSON.parse(await readFile11(paths.statePath, "utf8"));
|
|
16329
16480
|
} catch {
|
|
16330
16481
|
return;
|
|
16331
16482
|
}
|
|
@@ -16470,91 +16621,6 @@ var init_command2 = __esm({
|
|
|
16470
16621
|
}
|
|
16471
16622
|
});
|
|
16472
16623
|
|
|
16473
|
-
// packages/experience-design-system-cli/src/credentials-store.ts
|
|
16474
|
-
var credentials_store_exports = {};
|
|
16475
|
-
__export(credentials_store_exports, {
|
|
16476
|
-
experiencesCredentialsPath: () => experiencesCredentialsPath,
|
|
16477
|
-
readExperiencesCredentials: () => readExperiencesCredentials,
|
|
16478
|
-
writeExperiencesCredentials: () => writeExperiencesCredentials
|
|
16479
|
-
});
|
|
16480
|
-
import { readFile as readFile12, writeFile as writeFile2, mkdir as mkdir2 } from "node:fs/promises";
|
|
16481
|
-
import { join as join13 } from "node:path";
|
|
16482
|
-
import { homedir as homedir4 } from "node:os";
|
|
16483
|
-
async function readExperiencesCredentials() {
|
|
16484
|
-
try {
|
|
16485
|
-
const raw = await readFile12(CREDENTIALS_PATH, "utf8");
|
|
16486
|
-
const parsed = JSON.parse(raw);
|
|
16487
|
-
const host = toConfiguredHost(parsed.host || process.env["EDS_HOST"]);
|
|
16488
|
-
return {
|
|
16489
|
-
spaceId: parsed.spaceId || process.env["CONTENTFUL_SPACE_ID"] || "",
|
|
16490
|
-
environmentId: parsed.environmentId || process.env["CONTENTFUL_ENVIRONMENT_ID"] || "",
|
|
16491
|
-
cmaToken: parsed.cmaToken || process.env["CONTENTFUL_MANAGEMENT_TOKEN"] || "",
|
|
16492
|
-
...host ? { host } : {},
|
|
16493
|
-
...parsed.agent ? { agent: parsed.agent } : {},
|
|
16494
|
-
...parsed.agentModel ? { agentModel: parsed.agentModel } : {},
|
|
16495
|
-
...parsed.selectPromptPath ? { selectPromptPath: parsed.selectPromptPath } : {},
|
|
16496
|
-
...parsed.generatePromptPath ? { generatePromptPath: parsed.generatePromptPath } : {},
|
|
16497
|
-
...typeof parsed.autoFilter === "boolean" ? { autoFilter: parsed.autoFilter } : {},
|
|
16498
|
-
...typeof parsed.debug === "boolean" ? { debug: parsed.debug } : {},
|
|
16499
|
-
...typeof parsed.analyticsDisabled === "boolean" ? { analyticsDisabled: parsed.analyticsDisabled } : {}
|
|
16500
|
-
};
|
|
16501
|
-
} catch {
|
|
16502
|
-
const host = toConfiguredHost(process.env["EDS_HOST"]);
|
|
16503
|
-
return {
|
|
16504
|
-
spaceId: process.env["CONTENTFUL_SPACE_ID"] ?? "",
|
|
16505
|
-
environmentId: process.env["CONTENTFUL_ENVIRONMENT_ID"] ?? "",
|
|
16506
|
-
cmaToken: process.env["CONTENTFUL_MANAGEMENT_TOKEN"] ?? "",
|
|
16507
|
-
...host ? { host } : {}
|
|
16508
|
-
};
|
|
16509
|
-
}
|
|
16510
|
-
}
|
|
16511
|
-
async function writeExperiencesCredentials(creds) {
|
|
16512
|
-
const {
|
|
16513
|
-
host: _host,
|
|
16514
|
-
agent,
|
|
16515
|
-
agentModel,
|
|
16516
|
-
selectPromptPath,
|
|
16517
|
-
generatePromptPath,
|
|
16518
|
-
autoFilter,
|
|
16519
|
-
debug,
|
|
16520
|
-
analyticsDisabled,
|
|
16521
|
-
...rest
|
|
16522
|
-
} = creds;
|
|
16523
|
-
const host = toConfiguredHost(creds.host);
|
|
16524
|
-
await mkdir2(CREDENTIALS_DIR, { recursive: true });
|
|
16525
|
-
await writeFile2(
|
|
16526
|
-
CREDENTIALS_PATH,
|
|
16527
|
-
JSON.stringify(
|
|
16528
|
-
{
|
|
16529
|
-
...rest,
|
|
16530
|
-
...host ? { host } : {},
|
|
16531
|
-
...agent ? { agent } : {},
|
|
16532
|
-
...agentModel ? { agentModel } : {},
|
|
16533
|
-
...selectPromptPath ? { selectPromptPath } : {},
|
|
16534
|
-
...generatePromptPath ? { generatePromptPath } : {},
|
|
16535
|
-
...typeof autoFilter === "boolean" ? { autoFilter } : {},
|
|
16536
|
-
...typeof debug === "boolean" ? { debug } : {},
|
|
16537
|
-
...typeof analyticsDisabled === "boolean" ? { analyticsDisabled } : {}
|
|
16538
|
-
},
|
|
16539
|
-
null,
|
|
16540
|
-
2
|
|
16541
|
-
) + "\n",
|
|
16542
|
-
{ mode: 384 }
|
|
16543
|
-
);
|
|
16544
|
-
}
|
|
16545
|
-
function experiencesCredentialsPath() {
|
|
16546
|
-
return CREDENTIALS_PATH;
|
|
16547
|
-
}
|
|
16548
|
-
var CREDENTIALS_DIR, CREDENTIALS_PATH;
|
|
16549
|
-
var init_credentials_store = __esm({
|
|
16550
|
-
"packages/experience-design-system-cli/src/credentials-store.ts"() {
|
|
16551
|
-
"use strict";
|
|
16552
|
-
init_host_utils();
|
|
16553
|
-
CREDENTIALS_DIR = join13(homedir4(), ".config", "experiences");
|
|
16554
|
-
CREDENTIALS_PATH = join13(CREDENTIALS_DIR, "credentials.json");
|
|
16555
|
-
}
|
|
16556
|
-
});
|
|
16557
|
-
|
|
16558
16624
|
// packages/experience-design-system-cli/src/import/path-utils.ts
|
|
16559
16625
|
import { resolve as resolve22 } from "node:path";
|
|
16560
16626
|
import { homedir as homedir6 } from "node:os";
|
|
@@ -21993,13 +22059,29 @@ var init_ScopeGateStep = __esm({
|
|
|
21993
22059
|
}
|
|
21994
22060
|
});
|
|
21995
22061
|
|
|
21996
|
-
// packages/experience-design-system-cli/src/import/tui/
|
|
22062
|
+
// packages/experience-design-system-cli/src/import/tui/steps/useTerminalColumns.ts
|
|
22063
|
+
import { useStdout as useStdout5 } from "ink";
|
|
22064
|
+
function useTerminalColumns() {
|
|
22065
|
+
const { stdout } = useStdout5();
|
|
22066
|
+
return stdout?.columns ?? 80;
|
|
22067
|
+
}
|
|
22068
|
+
var init_useTerminalColumns = __esm({
|
|
22069
|
+
"packages/experience-design-system-cli/src/import/tui/steps/useTerminalColumns.ts"() {
|
|
22070
|
+
"use strict";
|
|
22071
|
+
}
|
|
22072
|
+
});
|
|
22073
|
+
|
|
22074
|
+
// packages/experience-design-system-cli/src/import/tui/steps/AtomicScopeGateStep.tsx
|
|
21997
22075
|
import { Box as Box43, Text as Text46 } from "ink";
|
|
21998
|
-
import React20 from "react";
|
|
22076
|
+
import React20, { useMemo as useMemo6, useState as useState23 } from "react";
|
|
21999
22077
|
import { jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
22000
|
-
function
|
|
22078
|
+
function truncateReason(reason) {
|
|
22079
|
+
if (reason === null || reason === void 0 || reason === "") return "<no reason given>";
|
|
22080
|
+
if (reason.length <= REASON_DISPLAY_MAX) return reason;
|
|
22081
|
+
return reason.slice(0, REASON_DISPLAY_MAX - 1).trimEnd() + "\u2026";
|
|
22082
|
+
}
|
|
22083
|
+
function AtomicScopeGateStep({
|
|
22001
22084
|
components,
|
|
22002
|
-
autoAccept,
|
|
22003
22085
|
onConfirm,
|
|
22004
22086
|
onQuit,
|
|
22005
22087
|
aiFilterStatus = "idle",
|
|
@@ -22007,51 +22089,357 @@ function ScopeGateHost({
|
|
|
22007
22089
|
aiFilterError = null,
|
|
22008
22090
|
onCancelAutoFilter
|
|
22009
22091
|
}) {
|
|
22010
|
-
|
|
22011
|
-
|
|
22012
|
-
|
|
22013
|
-
|
|
22014
|
-
|
|
22015
|
-
|
|
22016
|
-
|
|
22017
|
-
|
|
22018
|
-
|
|
22019
|
-
|
|
22020
|
-
|
|
22021
|
-
|
|
22022
|
-
|
|
22023
|
-
|
|
22024
|
-
|
|
22025
|
-
|
|
22092
|
+
const totalWidth = useTerminalColumns();
|
|
22093
|
+
const [userExcluded, setUserExcluded] = useState23(/* @__PURE__ */ new Set());
|
|
22094
|
+
const [userUnExcluded, setUserUnExcluded] = useState23(/* @__PURE__ */ new Set());
|
|
22095
|
+
const [cursor, setCursor] = useState23(0);
|
|
22096
|
+
const [scrollOffset, setScrollOffset] = useState23(0);
|
|
22097
|
+
const [reasonPanelOpen, setReasonPanelOpen] = useState23(false);
|
|
22098
|
+
const aiList = components.filter(isAiFlagged);
|
|
22099
|
+
const componentsList = components.filter((c2) => !isAiFlagged(c2));
|
|
22100
|
+
const flatList = [...aiList, ...componentsList];
|
|
22101
|
+
const isIncluded = (row) => {
|
|
22102
|
+
if (userExcluded.has(row.name)) return false;
|
|
22103
|
+
if (userUnExcluded.has(row.name)) return true;
|
|
22104
|
+
return !isAiFlagged(row);
|
|
22105
|
+
};
|
|
22106
|
+
const partition = () => {
|
|
22107
|
+
const accepted = [];
|
|
22108
|
+
const rejected = [];
|
|
22109
|
+
for (const c2 of flatList) {
|
|
22110
|
+
if (isIncluded(c2)) accepted.push(c2.name);
|
|
22111
|
+
else rejected.push(c2.name);
|
|
22026
22112
|
}
|
|
22027
|
-
|
|
22028
|
-
}
|
|
22029
|
-
|
|
22030
|
-
|
|
22031
|
-
|
|
22032
|
-
|
|
22033
|
-
|
|
22034
|
-
|
|
22035
|
-
|
|
22036
|
-
|
|
22037
|
-
|
|
22038
|
-
|
|
22039
|
-
|
|
22040
|
-
|
|
22041
|
-
|
|
22042
|
-
|
|
22043
|
-
|
|
22044
|
-
|
|
22045
|
-
|
|
22046
|
-
|
|
22047
|
-
|
|
22048
|
-
|
|
22049
|
-
|
|
22050
|
-
|
|
22051
|
-
|
|
22052
|
-
|
|
22053
|
-
|
|
22054
|
-
|
|
22113
|
+
return { accepted, rejected };
|
|
22114
|
+
};
|
|
22115
|
+
const toggleFocused = () => {
|
|
22116
|
+
const target = flatList[cursor];
|
|
22117
|
+
if (!target) return;
|
|
22118
|
+
const currentlyIn = isIncluded(target);
|
|
22119
|
+
if (currentlyIn) {
|
|
22120
|
+
setUserExcluded((prev) => {
|
|
22121
|
+
if (prev.has(target.name)) return prev;
|
|
22122
|
+
const next = new Set(prev);
|
|
22123
|
+
next.add(target.name);
|
|
22124
|
+
return next;
|
|
22125
|
+
});
|
|
22126
|
+
setUserUnExcluded((prev) => {
|
|
22127
|
+
if (!prev.has(target.name)) return prev;
|
|
22128
|
+
const next = new Set(prev);
|
|
22129
|
+
next.delete(target.name);
|
|
22130
|
+
return next;
|
|
22131
|
+
});
|
|
22132
|
+
} else {
|
|
22133
|
+
setUserUnExcluded((prev) => {
|
|
22134
|
+
if (prev.has(target.name)) return prev;
|
|
22135
|
+
const next = new Set(prev);
|
|
22136
|
+
next.add(target.name);
|
|
22137
|
+
return next;
|
|
22138
|
+
});
|
|
22139
|
+
setUserExcluded((prev) => {
|
|
22140
|
+
if (!prev.has(target.name)) return prev;
|
|
22141
|
+
const next = new Set(prev);
|
|
22142
|
+
next.delete(target.name);
|
|
22143
|
+
return next;
|
|
22144
|
+
});
|
|
22145
|
+
}
|
|
22146
|
+
};
|
|
22147
|
+
useImmediateInput((input, key) => {
|
|
22148
|
+
if (input === "q" || key.escape) {
|
|
22149
|
+
if (aiFilterStatus === "running" && onCancelAutoFilter) {
|
|
22150
|
+
onCancelAutoFilter();
|
|
22151
|
+
return;
|
|
22152
|
+
}
|
|
22153
|
+
if (key.escape && reasonPanelOpen) {
|
|
22154
|
+
setReasonPanelOpen(false);
|
|
22155
|
+
return;
|
|
22156
|
+
}
|
|
22157
|
+
onQuit();
|
|
22158
|
+
return;
|
|
22159
|
+
}
|
|
22160
|
+
if (input === "f" || input === "F") {
|
|
22161
|
+
onConfirm(partition());
|
|
22162
|
+
return;
|
|
22163
|
+
}
|
|
22164
|
+
if (input === "s") {
|
|
22165
|
+
setReasonPanelOpen((prev) => !prev);
|
|
22166
|
+
return;
|
|
22167
|
+
}
|
|
22168
|
+
if (input === "a" || input === " " || input === "r") {
|
|
22169
|
+
toggleFocused();
|
|
22170
|
+
return;
|
|
22171
|
+
}
|
|
22172
|
+
if (input === "A") {
|
|
22173
|
+
const compNames = componentsList.map((c2) => c2.name);
|
|
22174
|
+
const anyCompExcluded = componentsList.some((c2) => !isIncluded(c2));
|
|
22175
|
+
if (anyCompExcluded) {
|
|
22176
|
+
setUserUnExcluded((prev) => {
|
|
22177
|
+
const next = new Set(prev);
|
|
22178
|
+
for (const n of compNames) next.add(n);
|
|
22179
|
+
return next;
|
|
22180
|
+
});
|
|
22181
|
+
setUserExcluded((prev) => {
|
|
22182
|
+
const next = new Set(prev);
|
|
22183
|
+
for (const n of compNames) next.delete(n);
|
|
22184
|
+
return next;
|
|
22185
|
+
});
|
|
22186
|
+
} else {
|
|
22187
|
+
setUserExcluded((prev) => {
|
|
22188
|
+
const next = new Set(prev);
|
|
22189
|
+
for (const n of compNames) next.add(n);
|
|
22190
|
+
return next;
|
|
22191
|
+
});
|
|
22192
|
+
setUserUnExcluded((prev) => {
|
|
22193
|
+
const next = new Set(prev);
|
|
22194
|
+
for (const n of compNames) next.delete(n);
|
|
22195
|
+
return next;
|
|
22196
|
+
});
|
|
22197
|
+
}
|
|
22198
|
+
return;
|
|
22199
|
+
}
|
|
22200
|
+
if (key.upArrow || input === "k") {
|
|
22201
|
+
const len = flatList.length;
|
|
22202
|
+
if (len === 0) return;
|
|
22203
|
+
setCursor((c2) => {
|
|
22204
|
+
const next = c2 <= 0 ? 0 : c2 - 1;
|
|
22205
|
+
setScrollOffset((prev) => Math.min(prev, next));
|
|
22206
|
+
return next;
|
|
22207
|
+
});
|
|
22208
|
+
return;
|
|
22209
|
+
}
|
|
22210
|
+
if (key.downArrow || input === "j") {
|
|
22211
|
+
const len = flatList.length;
|
|
22212
|
+
if (len === 0) return;
|
|
22213
|
+
setCursor((c2) => {
|
|
22214
|
+
const next = c2 >= len - 1 ? len - 1 : c2 + 1;
|
|
22215
|
+
setScrollOffset((prev) => next >= prev + VISIBLE_COUNT2 ? next - VISIBLE_COUNT2 + 1 : prev);
|
|
22216
|
+
return next;
|
|
22217
|
+
});
|
|
22218
|
+
return;
|
|
22219
|
+
}
|
|
22220
|
+
});
|
|
22221
|
+
const total = flatList.length;
|
|
22222
|
+
const includedCount = useMemo6(
|
|
22223
|
+
() => flatList.filter((c2) => isIncluded(c2)).length,
|
|
22224
|
+
[components, userExcluded, userUnExcluded]
|
|
22225
|
+
);
|
|
22226
|
+
const hasAnyAi = flatList.some(isAiFlagged);
|
|
22227
|
+
const visibleEnd = Math.min(scrollOffset + VISIBLE_COUNT2, total);
|
|
22228
|
+
const visible = flatList.slice(scrollOffset, visibleEnd);
|
|
22229
|
+
const above = scrollOffset;
|
|
22230
|
+
const below = Math.max(0, total - visibleEnd);
|
|
22231
|
+
const allRejected = aiFilterStatus === "complete" && total > 0 && userExcluded.size === 0 && userUnExcluded.size === 0 && flatList.every((c2) => !isIncluded(c2));
|
|
22232
|
+
const counters = {
|
|
22233
|
+
accepted: includedCount,
|
|
22234
|
+
rejected: total - includedCount,
|
|
22235
|
+
undecided: 0,
|
|
22236
|
+
groups: 0,
|
|
22237
|
+
total
|
|
22238
|
+
};
|
|
22239
|
+
return /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
22240
|
+
/* @__PURE__ */ jsx49(Text46, { color: PALETTE.success, children: "\u2713 Extraction complete" }),
|
|
22241
|
+
/* @__PURE__ */ jsxs44(Text46, { dimColor: true, children: [
|
|
22242
|
+
"Found ",
|
|
22243
|
+
total,
|
|
22244
|
+
" component",
|
|
22245
|
+
total === 1 ? "" : "s",
|
|
22246
|
+
". Pick which ones to import. Generation runs only on the included set."
|
|
22247
|
+
] }),
|
|
22248
|
+
/* @__PURE__ */ jsx49(AutoFilterBanner, { status: aiFilterStatus, progress: aiFilterProgress, error: aiFilterError }),
|
|
22249
|
+
/* @__PURE__ */ jsx49(CounterStrip, { counters, totalWidth }),
|
|
22250
|
+
reasonPanelOpen && flatList[cursor] !== void 0 && isAiFlagged(flatList[cursor]) && /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.border, paddingX: 1, marginTop: 1, children: [
|
|
22251
|
+
/* @__PURE__ */ jsx49(Text46, { dimColor: true, bold: true, children: `Review reason: ${flatList[cursor].name}` }),
|
|
22252
|
+
/* @__PURE__ */ jsx49(Text46, { children: flatList[cursor].aiReason ?? "<no reason given>" }),
|
|
22253
|
+
/* @__PURE__ */ jsx49(Text46, { dimColor: true, children: "[s] close \xB7 [Esc] close" })
|
|
22254
|
+
] }),
|
|
22255
|
+
allRejected ? /* @__PURE__ */ jsx49(Box43, { marginTop: 1, children: /* @__PURE__ */ jsx49(Text46, { color: PALETTE.warning, children: "AI excluded all components \u2014 press [a] to override or [q] to quit" }) }) : /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", marginTop: 1, children: [
|
|
22256
|
+
above > 0 && /* @__PURE__ */ jsxs44(Text46, { dimColor: true, children: [
|
|
22257
|
+
"\u2191 ",
|
|
22258
|
+
above,
|
|
22259
|
+
" above"
|
|
22260
|
+
] }),
|
|
22261
|
+
visible.map((c2, vi) => {
|
|
22262
|
+
const i = vi + scrollOffset;
|
|
22263
|
+
const isCursor = i === cursor;
|
|
22264
|
+
const included = isIncluded(c2);
|
|
22265
|
+
const aiFlagged = isAiFlagged(c2);
|
|
22266
|
+
const prefix = isCursor ? "\u203A" : " ";
|
|
22267
|
+
const stateGlyph = included ? "[\u2713]" : "[\u2717]";
|
|
22268
|
+
const stateColor = included ? PALETTE.success : PALETTE.error;
|
|
22269
|
+
const aiMarkerNode = aiFlagged ? /* @__PURE__ */ jsx49(Text46, { color: PALETTE.info, children: `${AI_MARKER} ` }) : null;
|
|
22270
|
+
const inlineReason = !isCursor && aiFlagged ? ` ${truncateReason(c2.aiReason)}` : "";
|
|
22271
|
+
const showAiHeader = aiList.length > 0 && i === 0;
|
|
22272
|
+
const showComponentsHeader = componentsList.length > 0 && i === aiList.length;
|
|
22273
|
+
const header = showAiHeader ? /* @__PURE__ */ jsx49(Text46, { bold: true, children: `Review flags (${aiList.length})` }, `hdr-ai-${i}`) : showComponentsHeader ? /* @__PURE__ */ jsx49(Text46, { bold: true, children: `Components (${componentsList.length})` }, `hdr-comp-${i}`) : null;
|
|
22274
|
+
if (isCursor) {
|
|
22275
|
+
const wrapReason = aiFlagged && c2.aiReason !== null && c2.aiReason !== void 0 && c2.aiReason.length > 0;
|
|
22276
|
+
return /* @__PURE__ */ jsxs44(React20.Fragment, { children: [
|
|
22277
|
+
header,
|
|
22278
|
+
/* @__PURE__ */ jsxs44(Text46, { children: [
|
|
22279
|
+
/* @__PURE__ */ jsx49(Text46, { color: PALETTE.info, children: `${prefix} ` }),
|
|
22280
|
+
aiMarkerNode,
|
|
22281
|
+
/* @__PURE__ */ jsx49(Text46, { color: stateColor, children: stateGlyph }),
|
|
22282
|
+
/* @__PURE__ */ jsx49(Text46, { color: PALETTE.info, children: ` ${c2.name}` })
|
|
22283
|
+
] }),
|
|
22284
|
+
wrapReason && /* @__PURE__ */ jsx49(Text46, { dimColor: true, children: `${REASON_WRAP_INDENT}${c2.aiReason}` })
|
|
22285
|
+
] }, c2.componentId);
|
|
22286
|
+
}
|
|
22287
|
+
return /* @__PURE__ */ jsxs44(React20.Fragment, { children: [
|
|
22288
|
+
header,
|
|
22289
|
+
/* @__PURE__ */ jsxs44(Text46, { children: [
|
|
22290
|
+
/* @__PURE__ */ jsx49(Text46, { children: `${prefix} ` }),
|
|
22291
|
+
aiMarkerNode,
|
|
22292
|
+
/* @__PURE__ */ jsx49(Text46, { color: stateColor, children: stateGlyph }),
|
|
22293
|
+
/* @__PURE__ */ jsx49(Text46, { color: stateColor, children: ` ${c2.name}` }),
|
|
22294
|
+
inlineReason !== "" && /* @__PURE__ */ jsx49(Text46, { dimColor: true, children: inlineReason })
|
|
22295
|
+
] })
|
|
22296
|
+
] }, c2.componentId);
|
|
22297
|
+
}),
|
|
22298
|
+
below > 0 && /* @__PURE__ */ jsxs44(Text46, { dimColor: true, children: [
|
|
22299
|
+
"\u2193 ",
|
|
22300
|
+
below,
|
|
22301
|
+
" below"
|
|
22302
|
+
] })
|
|
22303
|
+
] }),
|
|
22304
|
+
/* @__PURE__ */ jsxs44(Box43, { gap: 3, marginTop: 1, children: [
|
|
22305
|
+
includedCount > 0 ? /* @__PURE__ */ jsxs44(Text46, { children: [
|
|
22306
|
+
/* @__PURE__ */ jsx49(Text46, { color: PALETTE.success, children: includedCount }),
|
|
22307
|
+
/* @__PURE__ */ jsxs44(Text46, { dimColor: true, children: [
|
|
22308
|
+
"/",
|
|
22309
|
+
total,
|
|
22310
|
+
" included"
|
|
22311
|
+
] })
|
|
22312
|
+
] }) : /* @__PURE__ */ jsx49(Text46, { color: PALETTE.warning, children: "none included" }),
|
|
22313
|
+
/* @__PURE__ */ jsxs44(Text46, { children: [
|
|
22314
|
+
/* @__PURE__ */ jsx49(Text46, { color: PALETTE.info, children: "[j/k]" }),
|
|
22315
|
+
" ",
|
|
22316
|
+
/* @__PURE__ */ jsx49(Text46, { dimColor: true, children: "move" })
|
|
22317
|
+
] }),
|
|
22318
|
+
/* @__PURE__ */ jsxs44(Text46, { children: [
|
|
22319
|
+
/* @__PURE__ */ jsx49(Text46, { color: PALETTE.info, children: "[a/space]" }),
|
|
22320
|
+
" ",
|
|
22321
|
+
/* @__PURE__ */ jsx49(Text46, { dimColor: true, children: "toggle" })
|
|
22322
|
+
] }),
|
|
22323
|
+
/* @__PURE__ */ jsxs44(Text46, { children: [
|
|
22324
|
+
/* @__PURE__ */ jsx49(Text46, { color: PALETTE.info, children: "[A]" }),
|
|
22325
|
+
" ",
|
|
22326
|
+
/* @__PURE__ */ jsx49(Text46, { dimColor: true, children: "toggle all" })
|
|
22327
|
+
] }),
|
|
22328
|
+
/* @__PURE__ */ jsxs44(Text46, { children: [
|
|
22329
|
+
/* @__PURE__ */ jsx49(Text46, { color: PALETTE.info, children: "[f]" }),
|
|
22330
|
+
" ",
|
|
22331
|
+
/* @__PURE__ */ jsx49(Text46, { dimColor: true, children: "continue" })
|
|
22332
|
+
] }),
|
|
22333
|
+
/* @__PURE__ */ jsxs44(Text46, { children: [
|
|
22334
|
+
/* @__PURE__ */ jsx49(Text46, { color: PALETTE.info, children: "[q]" }),
|
|
22335
|
+
" ",
|
|
22336
|
+
/* @__PURE__ */ jsx49(Text46, { dimColor: true, children: "quit" })
|
|
22337
|
+
] }),
|
|
22338
|
+
hasAnyAi && /* @__PURE__ */ jsxs44(Text46, { children: [
|
|
22339
|
+
/* @__PURE__ */ jsx49(Text46, { color: PALETTE.info, children: "[s]" }),
|
|
22340
|
+
" ",
|
|
22341
|
+
/* @__PURE__ */ jsx49(Text46, { dimColor: true, children: "review reason" })
|
|
22342
|
+
] }),
|
|
22343
|
+
hasAnyAi && /* @__PURE__ */ jsxs44(Text46, { children: [
|
|
22344
|
+
/* @__PURE__ */ jsx49(Text46, { color: PALETTE.info, children: "*" }),
|
|
22345
|
+
" ",
|
|
22346
|
+
/* @__PURE__ */ jsx49(Text46, { dimColor: true, children: "requires review" })
|
|
22347
|
+
] })
|
|
22348
|
+
] })
|
|
22349
|
+
] });
|
|
22350
|
+
}
|
|
22351
|
+
var VISIBLE_COUNT2, REASON_DISPLAY_MAX, AI_MARKER, REASON_WRAP_INDENT;
|
|
22352
|
+
var init_AtomicScopeGateStep = __esm({
|
|
22353
|
+
"packages/experience-design-system-cli/src/import/tui/steps/AtomicScopeGateStep.tsx"() {
|
|
22354
|
+
"use strict";
|
|
22355
|
+
init_useImmediateInput();
|
|
22356
|
+
init_theme();
|
|
22357
|
+
init_AutoFilterBanner();
|
|
22358
|
+
init_CounterStrip();
|
|
22359
|
+
init_ai_flag();
|
|
22360
|
+
init_useTerminalColumns();
|
|
22361
|
+
VISIBLE_COUNT2 = 10;
|
|
22362
|
+
REASON_DISPLAY_MAX = 60;
|
|
22363
|
+
AI_MARKER = "*";
|
|
22364
|
+
REASON_WRAP_INDENT = " ";
|
|
22365
|
+
}
|
|
22366
|
+
});
|
|
22367
|
+
|
|
22368
|
+
// packages/experience-design-system-cli/src/import/tui/scope-gate-host.tsx
|
|
22369
|
+
import { Box as Box44, Text as Text47 } from "ink";
|
|
22370
|
+
import React21 from "react";
|
|
22371
|
+
import { jsx as jsx50, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
22372
|
+
function ScopeGateHost({
|
|
22373
|
+
components,
|
|
22374
|
+
autoAccept,
|
|
22375
|
+
compositionMode = "atomic",
|
|
22376
|
+
onConfirm,
|
|
22377
|
+
onQuit,
|
|
22378
|
+
aiFilterStatus = "idle",
|
|
22379
|
+
aiFilterProgress = null,
|
|
22380
|
+
aiFilterError = null,
|
|
22381
|
+
onCancelAutoFilter
|
|
22382
|
+
}) {
|
|
22383
|
+
if (components.length === 0) {
|
|
22384
|
+
return /* @__PURE__ */ jsx50(Box44, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx50(Text47, { color: PALETTE.error, children: "Error: no components found for this session \u2014 please re-run analyze extract." }) });
|
|
22385
|
+
}
|
|
22386
|
+
if (autoAccept) {
|
|
22387
|
+
return /* @__PURE__ */ jsx50(ScopeGateAutoAccept, { components, onConfirm });
|
|
22388
|
+
}
|
|
22389
|
+
if (compositionMode === "atomic") {
|
|
22390
|
+
return /* @__PURE__ */ jsx50(
|
|
22391
|
+
AtomicScopeGateStep,
|
|
22392
|
+
{
|
|
22393
|
+
components: [...components],
|
|
22394
|
+
onConfirm,
|
|
22395
|
+
onQuit,
|
|
22396
|
+
aiFilterStatus,
|
|
22397
|
+
aiFilterProgress,
|
|
22398
|
+
aiFilterError,
|
|
22399
|
+
onCancelAutoFilter
|
|
22400
|
+
}
|
|
22401
|
+
);
|
|
22402
|
+
}
|
|
22403
|
+
return /* @__PURE__ */ jsx50(
|
|
22404
|
+
ScopeGateStep,
|
|
22405
|
+
{
|
|
22406
|
+
components: [...components],
|
|
22407
|
+
onConfirm,
|
|
22408
|
+
onQuit,
|
|
22409
|
+
aiFilterStatus,
|
|
22410
|
+
aiFilterProgress,
|
|
22411
|
+
aiFilterError,
|
|
22412
|
+
onCancelAutoFilter
|
|
22413
|
+
}
|
|
22414
|
+
);
|
|
22415
|
+
}
|
|
22416
|
+
function ScopeGateAutoAccept({
|
|
22417
|
+
components,
|
|
22418
|
+
onConfirm
|
|
22419
|
+
}) {
|
|
22420
|
+
React21.useEffect(() => {
|
|
22421
|
+
onConfirm({ accepted: components.map((c2) => c2.name), rejected: [] });
|
|
22422
|
+
}, []);
|
|
22423
|
+
return /* @__PURE__ */ jsx50(Box44, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsxs45(Text47, { dimColor: true, children: [
|
|
22424
|
+
"Auto-accepting ",
|
|
22425
|
+
components.length,
|
|
22426
|
+
" components..."
|
|
22427
|
+
] }) });
|
|
22428
|
+
}
|
|
22429
|
+
var init_scope_gate_host = __esm({
|
|
22430
|
+
"packages/experience-design-system-cli/src/import/tui/scope-gate-host.tsx"() {
|
|
22431
|
+
"use strict";
|
|
22432
|
+
init_theme();
|
|
22433
|
+
init_ScopeGateStep();
|
|
22434
|
+
init_AtomicScopeGateStep();
|
|
22435
|
+
}
|
|
22436
|
+
});
|
|
22437
|
+
|
|
22438
|
+
// packages/experience-design-system-cli/src/import/tui/merge-ai-decisions.ts
|
|
22439
|
+
function mergeAiDecisions(components, aiDecisions) {
|
|
22440
|
+
return components.map((component) => {
|
|
22441
|
+
if (component.aiDecision !== null && component.aiDecision !== void 0) {
|
|
22442
|
+
return component;
|
|
22055
22443
|
}
|
|
22056
22444
|
const streamed = aiDecisions[component.name];
|
|
22057
22445
|
if (!streamed) {
|
|
@@ -22312,7 +22700,7 @@ var init_runLivePreview = __esm({
|
|
|
22312
22700
|
});
|
|
22313
22701
|
|
|
22314
22702
|
// packages/experience-design-system-cli/src/import/tui/useFinalizePreview.ts
|
|
22315
|
-
import { useEffect as useEffect7, useRef as useRef5, useState as
|
|
22703
|
+
import { useEffect as useEffect7, useRef as useRef5, useState as useState24 } from "react";
|
|
22316
22704
|
function useReviewFinalizePreview({
|
|
22317
22705
|
components,
|
|
22318
22706
|
...options
|
|
@@ -22324,9 +22712,9 @@ function useReviewFinalizePreview({
|
|
|
22324
22712
|
}
|
|
22325
22713
|
function useFinalizePreview(opts) {
|
|
22326
22714
|
const { open, extractSessionId, tokensPath, spaceId, environmentId, cmaToken, host, acceptedKeys, allowDeletions } = opts;
|
|
22327
|
-
const [status, setStatus] =
|
|
22328
|
-
const [removed, setRemoved] =
|
|
22329
|
-
const [scrollOffset, setScrollOffset] =
|
|
22715
|
+
const [status, setStatus] = useState24("idle");
|
|
22716
|
+
const [removed, setRemoved] = useState24([]);
|
|
22717
|
+
const [scrollOffset, setScrollOffset] = useState24(0);
|
|
22330
22718
|
const generationRef = useRef5(0);
|
|
22331
22719
|
const acceptedKey = [...acceptedKeys].sort().join("\0");
|
|
22332
22720
|
useEffect7(() => {
|
|
@@ -22542,14 +22930,14 @@ var init_scroll_offset = __esm({
|
|
|
22542
22930
|
});
|
|
22543
22931
|
|
|
22544
22932
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/FieldEditor.tsx
|
|
22545
|
-
import
|
|
22546
|
-
import { Box as
|
|
22933
|
+
import React22, { useState as useState25 } from "react";
|
|
22934
|
+
import { Box as Box45, Text as Text48 } from "ink";
|
|
22547
22935
|
import {
|
|
22548
22936
|
CDF_PROPERTY_TYPES,
|
|
22549
22937
|
CDF_PROPERTY_CATEGORIES,
|
|
22550
22938
|
DESIGN_TOKEN_TYPES as DESIGN_TOKEN_TYPES2
|
|
22551
22939
|
} from "@contentful/experience-design-system-types";
|
|
22552
|
-
import { Fragment as Fragment14, jsx as
|
|
22940
|
+
import { Fragment as Fragment14, jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
22553
22941
|
function removeAt(values, index) {
|
|
22554
22942
|
return values.filter((_, i) => i !== index);
|
|
22555
22943
|
}
|
|
@@ -22672,25 +23060,25 @@ function serializeState(state, originalJson) {
|
|
|
22672
23060
|
return JSON.stringify(entry, null, 2);
|
|
22673
23061
|
}
|
|
22674
23062
|
function Picker({ value, active }) {
|
|
22675
|
-
return /* @__PURE__ */
|
|
22676
|
-
active && /* @__PURE__ */
|
|
22677
|
-
/* @__PURE__ */
|
|
22678
|
-
active && /* @__PURE__ */
|
|
23063
|
+
return /* @__PURE__ */ jsxs46(Box45, { children: [
|
|
23064
|
+
active && /* @__PURE__ */ jsx51(Text48, { color: PALETTE.info, children: "\u2039" }),
|
|
23065
|
+
/* @__PURE__ */ jsx51(Text48, { color: active ? PALETTE.info : PALETTE.inverse, bold: active, children: value }),
|
|
23066
|
+
active && /* @__PURE__ */ jsx51(Text48, { color: PALETTE.info, children: "\u203A" })
|
|
22679
23067
|
] });
|
|
22680
23068
|
}
|
|
22681
23069
|
function Toggle({ value, active }) {
|
|
22682
|
-
return /* @__PURE__ */
|
|
23070
|
+
return /* @__PURE__ */ jsx51(Box45, { children: /* @__PURE__ */ jsx51(Text48, { color: active ? PALETTE.info : value ? PALETTE.success : void 0, children: value ? "[\u2713]" : "[ ]" }) });
|
|
22683
23071
|
}
|
|
22684
23072
|
function DefaultValueRow({ display, active }) {
|
|
22685
|
-
return /* @__PURE__ */
|
|
22686
|
-
/* @__PURE__ */
|
|
22687
|
-
active ? /* @__PURE__ */
|
|
23073
|
+
return /* @__PURE__ */ jsxs46(Box45, { paddingLeft: 2, gap: 1, children: [
|
|
23074
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "default:" }),
|
|
23075
|
+
active ? /* @__PURE__ */ jsx51(Picker, { value: display, active: true }) : /* @__PURE__ */ jsx51(Text48, { color: PALETTE.inverse, children: display })
|
|
22688
23076
|
] });
|
|
22689
23077
|
}
|
|
22690
23078
|
function RowLabel({ name, selected }) {
|
|
22691
23079
|
const nameDisplay = name.length > 14 ? name.slice(0, 13) + "\u2026" : name.padEnd(14);
|
|
22692
|
-
return /* @__PURE__ */
|
|
22693
|
-
|
|
23080
|
+
return /* @__PURE__ */ jsxs46(
|
|
23081
|
+
Text48,
|
|
22694
23082
|
{
|
|
22695
23083
|
color: selected ? PALETTE.inverse : PALETTE.info,
|
|
22696
23084
|
bold: selected,
|
|
@@ -22708,10 +23096,10 @@ function ValueInputRow({
|
|
|
22708
23096
|
valueText,
|
|
22709
23097
|
cursorVisible
|
|
22710
23098
|
}) {
|
|
22711
|
-
return /* @__PURE__ */
|
|
22712
|
-
/* @__PURE__ */
|
|
22713
|
-
/* @__PURE__ */
|
|
22714
|
-
/* @__PURE__ */
|
|
23099
|
+
return /* @__PURE__ */ jsxs46(Box45, { paddingLeft: 2, children: [
|
|
23100
|
+
/* @__PURE__ */ jsx51(Text48, { color: PALETTE.info, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
23101
|
+
/* @__PURE__ */ jsx51(Text48, { children: valueText }),
|
|
23102
|
+
/* @__PURE__ */ jsx51(Text48, { inverse: cursorVisible, children: " " })
|
|
22715
23103
|
] });
|
|
22716
23104
|
}
|
|
22717
23105
|
function EditableListItem({
|
|
@@ -22724,9 +23112,9 @@ function EditableListItem({
|
|
|
22724
23112
|
}) {
|
|
22725
23113
|
const isBeingEdited = editingValue?.mode === "edit" && editingValue.index === index;
|
|
22726
23114
|
if (isBeingEdited) {
|
|
22727
|
-
return /* @__PURE__ */
|
|
23115
|
+
return /* @__PURE__ */ jsx51(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
22728
23116
|
}
|
|
22729
|
-
return /* @__PURE__ */
|
|
23117
|
+
return /* @__PURE__ */ jsx51(Box45, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx51(Text48, { color: active ? PALETTE.info : PALETTE.inverse, children: active ? `\u25B6 ${value}` : ` ${value}` }) });
|
|
22730
23118
|
}
|
|
22731
23119
|
function EditableValueList({
|
|
22732
23120
|
values,
|
|
@@ -22739,9 +23127,9 @@ function EditableValueList({
|
|
|
22739
23127
|
emptyPaddingLeft,
|
|
22740
23128
|
showAddInput
|
|
22741
23129
|
}) {
|
|
22742
|
-
return /* @__PURE__ */
|
|
22743
|
-
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */
|
|
22744
|
-
values.map((value, index) => /* @__PURE__ */
|
|
23130
|
+
return /* @__PURE__ */ jsxs46(Fragment14, { children: [
|
|
23131
|
+
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx51(Text48, { dimColor: true, children: emptyMessage }) : /* @__PURE__ */ jsx51(Box45, { paddingLeft: emptyPaddingLeft, children: /* @__PURE__ */ jsx51(Text48, { dimColor: true, children: emptyMessage }) })),
|
|
23132
|
+
values.map((value, index) => /* @__PURE__ */ jsx51(
|
|
22745
23133
|
EditableListItem,
|
|
22746
23134
|
{
|
|
22747
23135
|
value,
|
|
@@ -22753,7 +23141,7 @@ function EditableValueList({
|
|
|
22753
23141
|
},
|
|
22754
23142
|
index
|
|
22755
23143
|
)),
|
|
22756
|
-
showAddInput && editingValue?.mode === "add" && /* @__PURE__ */
|
|
23144
|
+
showAddInput && editingValue?.mode === "add" && /* @__PURE__ */ jsx51(ValueInputRow, { mode: "add", valueText, cursorVisible })
|
|
22757
23145
|
] });
|
|
22758
23146
|
}
|
|
22759
23147
|
function DefaultSubRow({
|
|
@@ -22764,39 +23152,39 @@ function DefaultSubRow({
|
|
|
22764
23152
|
}) {
|
|
22765
23153
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
22766
23154
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
22767
|
-
return /* @__PURE__ */
|
|
22768
|
-
/* @__PURE__ */
|
|
22769
|
-
/* @__PURE__ */
|
|
23155
|
+
return /* @__PURE__ */ jsxs46(Box45, { paddingLeft: 2, gap: 1, children: [
|
|
23156
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "default:" }),
|
|
23157
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "(not applicable)" })
|
|
22770
23158
|
] });
|
|
22771
23159
|
}
|
|
22772
23160
|
if (prop.type === "boolean") {
|
|
22773
23161
|
const display = prop.default === true ? "true" : prop.default === false ? "false" : "(unset)";
|
|
22774
|
-
return /* @__PURE__ */
|
|
23162
|
+
return /* @__PURE__ */ jsx51(DefaultValueRow, { display, active });
|
|
22775
23163
|
}
|
|
22776
23164
|
if (prop.type === "enum") {
|
|
22777
23165
|
if (prop.values.length === 0) {
|
|
22778
|
-
return /* @__PURE__ */
|
|
22779
|
-
/* @__PURE__ */
|
|
22780
|
-
/* @__PURE__ */
|
|
23166
|
+
return /* @__PURE__ */ jsxs46(Box45, { paddingLeft: 2, gap: 1, children: [
|
|
23167
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "default:" }),
|
|
23168
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "(no values defined)" })
|
|
22781
23169
|
] });
|
|
22782
23170
|
}
|
|
22783
23171
|
const display = typeof prop.default === "string" && prop.default !== "" ? prop.default : "(unset)";
|
|
22784
|
-
return /* @__PURE__ */
|
|
23172
|
+
return /* @__PURE__ */ jsx51(DefaultValueRow, { display, active });
|
|
22785
23173
|
}
|
|
22786
23174
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
22787
23175
|
if (active) {
|
|
22788
|
-
return /* @__PURE__ */
|
|
22789
|
-
/* @__PURE__ */
|
|
22790
|
-
/* @__PURE__ */
|
|
22791
|
-
/* @__PURE__ */
|
|
22792
|
-
/* @__PURE__ */
|
|
22793
|
-
/* @__PURE__ */
|
|
23176
|
+
return /* @__PURE__ */ jsxs46(Box45, { paddingLeft: 2, flexDirection: "row", children: [
|
|
23177
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "default:" }),
|
|
23178
|
+
/* @__PURE__ */ jsxs46(Box45, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
|
|
23179
|
+
/* @__PURE__ */ jsx51(Text48, { children: value.slice(0, textCursor) }),
|
|
23180
|
+
/* @__PURE__ */ jsx51(Text48, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
23181
|
+
/* @__PURE__ */ jsx51(Text48, { children: value.slice(textCursor + 1) })
|
|
22794
23182
|
] })
|
|
22795
23183
|
] });
|
|
22796
23184
|
}
|
|
22797
|
-
return /* @__PURE__ */
|
|
22798
|
-
/* @__PURE__ */
|
|
22799
|
-
/* @__PURE__ */
|
|
23185
|
+
return /* @__PURE__ */ jsxs46(Box45, { paddingLeft: 2, gap: 1, children: [
|
|
23186
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "default:" }),
|
|
23187
|
+
/* @__PURE__ */ jsx51(Text48, { color: value ? PALETTE.inverse : void 0, dimColor: !value, children: value || "(none)" })
|
|
22800
23188
|
] });
|
|
22801
23189
|
}
|
|
22802
23190
|
function PropRow({
|
|
@@ -22814,28 +23202,28 @@ function PropRow({
|
|
|
22814
23202
|
}) {
|
|
22815
23203
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
22816
23204
|
const descActive = activeField === "description";
|
|
22817
|
-
return /* @__PURE__ */
|
|
22818
|
-
/* @__PURE__ */
|
|
22819
|
-
/* @__PURE__ */
|
|
22820
|
-
/* @__PURE__ */
|
|
22821
|
-
activeField === "type" ? /* @__PURE__ */
|
|
22822
|
-
activeField === "category" && /* @__PURE__ */
|
|
22823
|
-
/* @__PURE__ */
|
|
22824
|
-
activeField === "required" ? /* @__PURE__ */
|
|
22825
|
-
prop.type === "enum" && /* @__PURE__ */
|
|
22826
|
-
/* @__PURE__ */
|
|
22827
|
-
/* @__PURE__ */
|
|
23205
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", width, children: [
|
|
23206
|
+
/* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
|
|
23207
|
+
/* @__PURE__ */ jsx51(RowLabel, { name: prop.name, selected }),
|
|
23208
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: !selected, children: "type:" }),
|
|
23209
|
+
activeField === "type" ? /* @__PURE__ */ jsx51(Picker, { value: prop.type, active: true }) : /* @__PURE__ */ jsx51(Text48, { color: selected ? PALETTE.warning : PALETTE.inverse, children: prop.type }),
|
|
23210
|
+
activeField === "category" && /* @__PURE__ */ jsx51(Picker, { value: prop.category, active: true }),
|
|
23211
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: !selected, children: "req:" }),
|
|
23212
|
+
activeField === "required" ? /* @__PURE__ */ jsx51(Toggle, { value: prop.required, active: true }) : /* @__PURE__ */ jsx51(Toggle, { value: prop.required, active: false }),
|
|
23213
|
+
prop.type === "enum" && /* @__PURE__ */ jsxs46(Fragment14, { children: [
|
|
23214
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: !selected, children: "values:" }),
|
|
23215
|
+
/* @__PURE__ */ jsxs46(Text48, { color: selected ? PALETTE.warning : PALETTE.inverse, children: [
|
|
22828
23216
|
"[",
|
|
22829
23217
|
prop.values.join(", "),
|
|
22830
23218
|
"]"
|
|
22831
23219
|
] })
|
|
22832
23220
|
] }),
|
|
22833
|
-
prop.type === "token" && /* @__PURE__ */
|
|
22834
|
-
/* @__PURE__ */
|
|
22835
|
-
activeField === "tokenKind" ? /* @__PURE__ */
|
|
23221
|
+
prop.type === "token" && /* @__PURE__ */ jsxs46(Fragment14, { children: [
|
|
23222
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: !selected, children: "kind:" }),
|
|
23223
|
+
activeField === "tokenKind" ? /* @__PURE__ */ jsx51(Picker, { value: prop.tokenKind || DESIGN_TOKEN_TYPES2[0], active: true }) : /* @__PURE__ */ jsx51(Text48, { color: selected ? PALETTE.success : PALETTE.inverse, children: prop.tokenKind || "\u2014" })
|
|
22836
23224
|
] })
|
|
22837
23225
|
] }),
|
|
22838
|
-
selected && /* @__PURE__ */
|
|
23226
|
+
selected && /* @__PURE__ */ jsx51(
|
|
22839
23227
|
DefaultSubRow,
|
|
22840
23228
|
{
|
|
22841
23229
|
prop,
|
|
@@ -22844,33 +23232,33 @@ function PropRow({
|
|
|
22844
23232
|
cursorVisible
|
|
22845
23233
|
}
|
|
22846
23234
|
),
|
|
22847
|
-
selected && descActive && /* @__PURE__ */
|
|
22848
|
-
/* @__PURE__ */
|
|
22849
|
-
/* @__PURE__ */
|
|
22850
|
-
/* @__PURE__ */
|
|
22851
|
-
/* @__PURE__ */
|
|
22852
|
-
/* @__PURE__ */
|
|
23235
|
+
selected && descActive && /* @__PURE__ */ jsxs46(Box45, { paddingLeft: 2, flexDirection: "row", children: [
|
|
23236
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "desc:" }),
|
|
23237
|
+
/* @__PURE__ */ jsxs46(Box45, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
|
|
23238
|
+
/* @__PURE__ */ jsx51(Text48, { children: prop.description.slice(0, textCursor) }),
|
|
23239
|
+
/* @__PURE__ */ jsx51(Text48, { inverse: cursorVisible, children: prop.description[textCursor] ?? cursor }),
|
|
23240
|
+
/* @__PURE__ */ jsx51(Text48, { children: prop.description.slice(textCursor + 1) })
|
|
22853
23241
|
] })
|
|
22854
23242
|
] }),
|
|
22855
|
-
selected && !descActive && /* @__PURE__ */
|
|
22856
|
-
/* @__PURE__ */
|
|
22857
|
-
/* @__PURE__ */
|
|
23243
|
+
selected && !descActive && /* @__PURE__ */ jsxs46(Box45, { paddingLeft: 2, gap: 1, children: [
|
|
23244
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "desc:" }),
|
|
23245
|
+
/* @__PURE__ */ jsx51(Text48, { color: PALETTE.success, children: prop.description || "\u2014" })
|
|
22858
23246
|
] }),
|
|
22859
|
-
selected && prop.type === "token" && prop.category === "design" && /* @__PURE__ */
|
|
22860
|
-
/* @__PURE__ */
|
|
22861
|
-
activeField === "allowed" ? /* @__PURE__ */
|
|
23247
|
+
selected && prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs46(Box45, { paddingLeft: 2, flexDirection: "row", gap: 1, children: [
|
|
23248
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "allowed:" }),
|
|
23249
|
+
activeField === "allowed" ? /* @__PURE__ */ jsx51(Box45, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: /* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "press [t] to edit allowed tokens" }) }) : /* @__PURE__ */ jsx51(Text48, { color: prop.allowed.length > 0 ? PALETTE.info : void 0, dimColor: prop.allowed.length === 0, children: prop.allowed.length > 0 ? prop.allowed.join(", ") : "(any)" })
|
|
22862
23250
|
] }),
|
|
22863
|
-
selected && rationale && rationale.trim().length > 0 && /* @__PURE__ */
|
|
23251
|
+
selected && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx51(Box45, { paddingLeft: 2, children: /* @__PURE__ */ jsx51(Text48, { dimColor: true, children: (() => {
|
|
22864
23252
|
const max = Math.max(8, width - 8);
|
|
22865
23253
|
const text = `~ ${rationale}`;
|
|
22866
23254
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
22867
23255
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
22868
|
-
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */
|
|
22869
|
-
/* @__PURE__ */
|
|
22870
|
-
/* @__PURE__ */
|
|
22871
|
-
activeField === "values" && /* @__PURE__ */
|
|
23256
|
+
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs46(Box45, { paddingLeft: 2, flexDirection: "column", children: [
|
|
23257
|
+
/* @__PURE__ */ jsxs46(Box45, { children: [
|
|
23258
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "values:" }),
|
|
23259
|
+
activeField === "values" && /* @__PURE__ */ jsx51(Text48, { dimColor: true, children: " [a]dd [e]dit [r]emove [\u2191\u2193] navigate [K/J] reorder" })
|
|
22872
23260
|
] }),
|
|
22873
|
-
/* @__PURE__ */
|
|
23261
|
+
/* @__PURE__ */ jsx51(
|
|
22874
23262
|
EditableValueList,
|
|
22875
23263
|
{
|
|
22876
23264
|
values: prop.values,
|
|
@@ -22900,22 +23288,22 @@ function SlotRow({
|
|
|
22900
23288
|
pickerCursor
|
|
22901
23289
|
}) {
|
|
22902
23290
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
22903
|
-
return /* @__PURE__ */
|
|
22904
|
-
/* @__PURE__ */
|
|
22905
|
-
/* @__PURE__ */
|
|
22906
|
-
/* @__PURE__ */
|
|
22907
|
-
activeField === "required" ? /* @__PURE__ */
|
|
23291
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", width, children: [
|
|
23292
|
+
/* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
|
|
23293
|
+
/* @__PURE__ */ jsx51(RowLabel, { name: slot.name, selected }),
|
|
23294
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: !selected, children: "req:" }),
|
|
23295
|
+
activeField === "required" ? /* @__PURE__ */ jsx51(Toggle, { value: slot.required, active: true }) : /* @__PURE__ */ jsx51(Toggle, { value: slot.required, active: false })
|
|
22908
23296
|
] }),
|
|
22909
|
-
!selected && /* @__PURE__ */
|
|
22910
|
-
/* @__PURE__ */
|
|
22911
|
-
slot.allowedComponents.length === 0 ? /* @__PURE__ */
|
|
23297
|
+
!selected && /* @__PURE__ */ jsxs46(Box45, { paddingLeft: 2, gap: 1, children: [
|
|
23298
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "allowed:" }),
|
|
23299
|
+
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "(any)" }) : /* @__PURE__ */ jsx51(Text48, { color: PALETTE.info, children: slot.allowedComponents.join(", ") })
|
|
22912
23300
|
] }),
|
|
22913
|
-
selected && /* @__PURE__ */
|
|
22914
|
-
/* @__PURE__ */
|
|
22915
|
-
/* @__PURE__ */
|
|
22916
|
-
activeField === "allowedComponents" && /* @__PURE__ */
|
|
23301
|
+
selected && /* @__PURE__ */ jsxs46(Box45, { paddingLeft: 2, flexDirection: "column", children: [
|
|
23302
|
+
/* @__PURE__ */ jsxs46(Box45, { children: [
|
|
23303
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "allowed:" }),
|
|
23304
|
+
activeField === "allowedComponents" && /* @__PURE__ */ jsx51(Text48, { dimColor: true, children: slot.allowedComponents.length > 0 ? " [a]dd [e]dit [r]emove [\u2190\u2192] cycle [\u2191\u2193] navigate [K/J] reorder" : " [a]dd [e]dit [r]emove [\u2191\u2193] navigate [K/J] reorder" })
|
|
22917
23305
|
] }),
|
|
22918
|
-
/* @__PURE__ */
|
|
23306
|
+
/* @__PURE__ */ jsx51(
|
|
22919
23307
|
EditableValueList,
|
|
22920
23308
|
{
|
|
22921
23309
|
values: slot.allowedComponents,
|
|
@@ -22929,36 +23317,36 @@ function SlotRow({
|
|
|
22929
23317
|
showAddInput: activeField === "allowedComponents"
|
|
22930
23318
|
}
|
|
22931
23319
|
),
|
|
22932
|
-
editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */
|
|
23320
|
+
editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx51(Box45, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "(no valid components to add \u2014 all remaining candidates would create cycles)" }) : (() => {
|
|
22933
23321
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
22934
23322
|
if (filtered.length === 0) {
|
|
22935
|
-
return /* @__PURE__ */
|
|
23323
|
+
return /* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
22936
23324
|
}
|
|
22937
23325
|
const cursor2 = pickerCursor % filtered.length;
|
|
22938
23326
|
const MAX_VISIBLE = 5;
|
|
22939
23327
|
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor2 - 2));
|
|
22940
23328
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
22941
|
-
return /* @__PURE__ */
|
|
22942
|
-
/* @__PURE__ */
|
|
23329
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", children: [
|
|
23330
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
22943
23331
|
slice.map((name, i) => {
|
|
22944
23332
|
const absIdx = start + i;
|
|
22945
23333
|
const isCursor = absIdx === cursor2;
|
|
22946
|
-
return /* @__PURE__ */
|
|
23334
|
+
return /* @__PURE__ */ jsx51(Text48, { color: isCursor ? PALETTE.info : void 0, dimColor: !isCursor, children: isCursor ? ` \u25B6 ${name}` : ` ${name}` }, name);
|
|
22947
23335
|
})
|
|
22948
23336
|
] });
|
|
22949
23337
|
})() })
|
|
22950
23338
|
] }),
|
|
22951
|
-
selected && activeField === "description" && /* @__PURE__ */
|
|
22952
|
-
/* @__PURE__ */
|
|
22953
|
-
/* @__PURE__ */
|
|
22954
|
-
/* @__PURE__ */
|
|
22955
|
-
/* @__PURE__ */
|
|
22956
|
-
/* @__PURE__ */
|
|
23339
|
+
selected && activeField === "description" && /* @__PURE__ */ jsxs46(Box45, { paddingLeft: 2, flexDirection: "row", children: [
|
|
23340
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "desc:" }),
|
|
23341
|
+
/* @__PURE__ */ jsxs46(Box45, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
|
|
23342
|
+
/* @__PURE__ */ jsx51(Text48, { children: slot.description.slice(0, textCursor) }),
|
|
23343
|
+
/* @__PURE__ */ jsx51(Text48, { inverse: cursorVisible, children: slot.description[textCursor] ?? cursor }),
|
|
23344
|
+
/* @__PURE__ */ jsx51(Text48, { children: slot.description.slice(textCursor + 1) })
|
|
22957
23345
|
] })
|
|
22958
23346
|
] }),
|
|
22959
|
-
selected && activeField !== "description" && /* @__PURE__ */
|
|
22960
|
-
/* @__PURE__ */
|
|
22961
|
-
/* @__PURE__ */
|
|
23347
|
+
selected && activeField !== "description" && /* @__PURE__ */ jsxs46(Box45, { paddingLeft: 2, gap: 1, children: [
|
|
23348
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "desc:" }),
|
|
23349
|
+
/* @__PURE__ */ jsx51(Text48, { color: PALETTE.success, children: slot.description || "\u2014" })
|
|
22962
23350
|
] })
|
|
22963
23351
|
] });
|
|
22964
23352
|
}
|
|
@@ -23074,8 +23462,8 @@ function FieldEditor({
|
|
|
23074
23462
|
showHiddenProps = true
|
|
23075
23463
|
}) {
|
|
23076
23464
|
const { state: initialState, error: parseError } = parseToState(value);
|
|
23077
|
-
const [editorState, setEditorState] =
|
|
23078
|
-
const [parseErr] =
|
|
23465
|
+
const [editorState, setEditorState] = useState25(initialState);
|
|
23466
|
+
const [parseErr] = useState25(parseError);
|
|
23079
23467
|
const initialFocus = (() => {
|
|
23080
23468
|
if (initialFocusTarget?.kind === "description") {
|
|
23081
23469
|
return {
|
|
@@ -23142,42 +23530,42 @@ function FieldEditor({
|
|
|
23142
23530
|
textCursor: 0
|
|
23143
23531
|
};
|
|
23144
23532
|
})();
|
|
23145
|
-
const [focusLevel, setFocusLevel] =
|
|
23146
|
-
const [propIdx, setPropIdx] =
|
|
23147
|
-
const [slotIdx, setSlotIdx] =
|
|
23148
|
-
const [inSlots, setInSlots] =
|
|
23149
|
-
const [inComponentDesc, setInComponentDesc] =
|
|
23150
|
-
const [activeField, setActiveField] =
|
|
23151
|
-
const [textCursor, setTextCursor] =
|
|
23152
|
-
const [valueCursor, setValueCursor] =
|
|
23153
|
-
const [editingValue, setEditingValue] =
|
|
23154
|
-
const [valueText, setValueText] =
|
|
23155
|
-
const [pickerCursor, setPickerCursor] =
|
|
23156
|
-
const [validationError, setValidationError] =
|
|
23157
|
-
const [cursorVisible] =
|
|
23158
|
-
const [sourceOpen, setSourceOpen] =
|
|
23159
|
-
const [rationaleOpen, setRationaleOpen] =
|
|
23160
|
-
const [rationaleScrollOffset, setRationaleScrollOffset] =
|
|
23161
|
-
const [showHelp, setShowHelp] =
|
|
23533
|
+
const [focusLevel, setFocusLevel] = useState25(initialFocus.focusLevel);
|
|
23534
|
+
const [propIdx, setPropIdx] = useState25(initialFocus.propIdx);
|
|
23535
|
+
const [slotIdx, setSlotIdx] = useState25(initialFocus.slotIdx);
|
|
23536
|
+
const [inSlots, setInSlots] = useState25(initialFocus.inSlots);
|
|
23537
|
+
const [inComponentDesc, setInComponentDesc] = useState25(initialFocus.focusLevel === "componentDescription");
|
|
23538
|
+
const [activeField, setActiveField] = useState25(initialFocus.activeField);
|
|
23539
|
+
const [textCursor, setTextCursor] = useState25(initialFocus.textCursor);
|
|
23540
|
+
const [valueCursor, setValueCursor] = useState25(0);
|
|
23541
|
+
const [editingValue, setEditingValue] = useState25(null);
|
|
23542
|
+
const [valueText, setValueText] = useState25("");
|
|
23543
|
+
const [pickerCursor, setPickerCursor] = useState25(0);
|
|
23544
|
+
const [validationError, setValidationError] = useState25(null);
|
|
23545
|
+
const [cursorVisible] = useState25(true);
|
|
23546
|
+
const [sourceOpen, setSourceOpen] = useState25(false);
|
|
23547
|
+
const [rationaleOpen, setRationaleOpen] = useState25(false);
|
|
23548
|
+
const [rationaleScrollOffset, setRationaleScrollOffset] = useState25(0);
|
|
23549
|
+
const [showHelp, setShowHelp] = useState25(false);
|
|
23162
23550
|
const props = editorState.props;
|
|
23163
23551
|
const slots = editorState.slots;
|
|
23164
|
-
const contentPropIndexes =
|
|
23552
|
+
const contentPropIndexes = React22.useMemo(
|
|
23165
23553
|
() => props.flatMap((prop, index) => prop.category === "content" ? [index] : []),
|
|
23166
23554
|
[props]
|
|
23167
23555
|
);
|
|
23168
|
-
const designPropIndexes =
|
|
23556
|
+
const designPropIndexes = React22.useMemo(
|
|
23169
23557
|
() => props.flatMap((prop, index) => prop.category === "design" ? [index] : []),
|
|
23170
23558
|
[props]
|
|
23171
23559
|
);
|
|
23172
|
-
const hiddenPropIndexes =
|
|
23560
|
+
const hiddenPropIndexes = React22.useMemo(
|
|
23173
23561
|
() => showHiddenProps ? props.flatMap((prop, index) => prop.category === "state" || prop.category === "unattached" ? [index] : []) : [],
|
|
23174
23562
|
[props, showHiddenProps]
|
|
23175
23563
|
);
|
|
23176
|
-
const visiblePropIndexes =
|
|
23564
|
+
const visiblePropIndexes = React22.useMemo(
|
|
23177
23565
|
() => [...contentPropIndexes, ...designPropIndexes, ...hiddenPropIndexes],
|
|
23178
23566
|
[contentPropIndexes, designPropIndexes, hiddenPropIndexes]
|
|
23179
23567
|
);
|
|
23180
|
-
const propGroups =
|
|
23568
|
+
const propGroups = React22.useMemo(
|
|
23181
23569
|
() => [
|
|
23182
23570
|
{ kind: "content", label: "\u2500\u2500 CONTENT PROPERTIES", indexes: contentPropIndexes },
|
|
23183
23571
|
{ kind: "design", label: "\u2500\u2500 DESIGN PROPERTIES", indexes: designPropIndexes },
|
|
@@ -23185,7 +23573,7 @@ function FieldEditor({
|
|
|
23185
23573
|
],
|
|
23186
23574
|
[contentPropIndexes, designPropIndexes, hiddenPropIndexes]
|
|
23187
23575
|
);
|
|
23188
|
-
const selectableRows =
|
|
23576
|
+
const selectableRows = React22.useMemo(
|
|
23189
23577
|
() => [
|
|
23190
23578
|
...contentPropIndexes.map((idx) => ({ kind: "prop", idx })),
|
|
23191
23579
|
...designPropIndexes.map((idx) => ({ kind: "prop", idx })),
|
|
@@ -23195,7 +23583,7 @@ function FieldEditor({
|
|
|
23195
23583
|
[contentPropIndexes, designPropIndexes, hiddenPropIndexes, slots]
|
|
23196
23584
|
);
|
|
23197
23585
|
const visiblePropPosition = visiblePropIndexes.indexOf(propIdx);
|
|
23198
|
-
const selectedSelectableIndex =
|
|
23586
|
+
const selectedSelectableIndex = React22.useMemo(
|
|
23199
23587
|
() => selectableRows.findIndex(
|
|
23200
23588
|
(row) => inSlots ? row.kind === "slot" && row.idx === slotIdx : row.kind === "prop" && row.idx === propIdx
|
|
23201
23589
|
),
|
|
@@ -23214,12 +23602,12 @@ function FieldEditor({
|
|
|
23214
23602
|
}
|
|
23215
23603
|
};
|
|
23216
23604
|
const textEntryActive = focusLevel === "field" && activeField === "description" || focusLevel === "field" && activeField === "default" && (editorState.props[propIdx]?.type === "string" || editorState.props[propIdx]?.type === "token") || editingValue != null;
|
|
23217
|
-
|
|
23605
|
+
React22.useEffect(() => {
|
|
23218
23606
|
onTextEntryActiveChange?.(textEntryActive);
|
|
23219
23607
|
}, [textEntryActive, onTextEntryActiveChange]);
|
|
23220
23608
|
const currentProp = props[propIdx] ?? null;
|
|
23221
23609
|
const currentSlot = slots[slotIdx] ?? null;
|
|
23222
|
-
|
|
23610
|
+
React22.useEffect(() => {
|
|
23223
23611
|
if (showHiddenProps || inSlots || inComponentDesc || visiblePropPosition >= 0) return;
|
|
23224
23612
|
if (visiblePropIndexes.length > 0) {
|
|
23225
23613
|
setPropIdx(visiblePropIndexes[0]);
|
|
@@ -23238,24 +23626,24 @@ function FieldEditor({
|
|
|
23238
23626
|
setEditorState(next);
|
|
23239
23627
|
onChange(serializeState(next, value));
|
|
23240
23628
|
};
|
|
23241
|
-
const canonicalize =
|
|
23629
|
+
const canonicalize = React22.useCallback((json) => {
|
|
23242
23630
|
try {
|
|
23243
23631
|
return JSON.stringify(JSON.parse(json));
|
|
23244
23632
|
} catch {
|
|
23245
23633
|
return `__unparseable__:${json}`;
|
|
23246
23634
|
}
|
|
23247
23635
|
}, []);
|
|
23248
|
-
const initialStateRef =
|
|
23249
|
-
const [baselineCanonical, setBaselineCanonical] =
|
|
23636
|
+
const initialStateRef = React22.useRef(initialState);
|
|
23637
|
+
const [baselineCanonical, setBaselineCanonical] = useState25(
|
|
23250
23638
|
() => canonicalize(serializeState(initialState, value))
|
|
23251
23639
|
);
|
|
23252
23640
|
const currentCanonical = canonicalize(serializeState(editorState, value));
|
|
23253
23641
|
const isDirty = currentCanonical !== baselineCanonical;
|
|
23254
|
-
|
|
23642
|
+
React22.useEffect(() => {
|
|
23255
23643
|
onDirtyChange?.(isDirty);
|
|
23256
23644
|
}, [isDirty, onDirtyChange]);
|
|
23257
|
-
const lastDiscardTriggerRef =
|
|
23258
|
-
|
|
23645
|
+
const lastDiscardTriggerRef = React22.useRef(discardTrigger);
|
|
23646
|
+
React22.useEffect(() => {
|
|
23259
23647
|
if (discardTrigger === void 0) return;
|
|
23260
23648
|
if (discardTrigger === lastDiscardTriggerRef.current) return;
|
|
23261
23649
|
lastDiscardTriggerRef.current = discardTrigger;
|
|
@@ -23386,8 +23774,8 @@ function FieldEditor({
|
|
|
23386
23774
|
return;
|
|
23387
23775
|
}
|
|
23388
23776
|
if (rationaleOpen && !onTogglePropRationale) {
|
|
23389
|
-
const
|
|
23390
|
-
const next = computeNextScrollOffset(rationaleScrollOffset, input, key, 9999,
|
|
23777
|
+
const PANEL_HEIGHT3 = 12;
|
|
23778
|
+
const next = computeNextScrollOffset(rationaleScrollOffset, input, key, 9999, PANEL_HEIGHT3);
|
|
23391
23779
|
if (next !== null) {
|
|
23392
23780
|
setRationaleScrollOffset(() => next);
|
|
23393
23781
|
return;
|
|
@@ -23742,18 +24130,18 @@ function FieldEditor({
|
|
|
23742
24130
|
});
|
|
23743
24131
|
const innerWidth = Math.max(1, width - 2);
|
|
23744
24132
|
if (parseErr) {
|
|
23745
|
-
return /* @__PURE__ */
|
|
23746
|
-
/* @__PURE__ */
|
|
23747
|
-
/* @__PURE__ */
|
|
23748
|
-
/* @__PURE__ */
|
|
24133
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.error, children: [
|
|
24134
|
+
/* @__PURE__ */ jsx51(Text48, { bold: true, color: PALETTE.error, children: "FIELD EDITOR \u2014 parse error" }),
|
|
24135
|
+
/* @__PURE__ */ jsx51(Text48, { color: PALETTE.error, children: parseErr }),
|
|
24136
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "Cannot display structured editor. Fix the JSON first." })
|
|
23749
24137
|
] });
|
|
23750
24138
|
}
|
|
23751
24139
|
if (props.length === 0 && slots.length === 0) {
|
|
23752
|
-
return /* @__PURE__ */
|
|
23753
|
-
/* @__PURE__ */
|
|
23754
|
-
/* @__PURE__ */
|
|
23755
|
-
/* @__PURE__ */
|
|
23756
|
-
/* @__PURE__ */
|
|
24140
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.warning, children: [
|
|
24141
|
+
/* @__PURE__ */ jsx51(Text48, { bold: true, color: PALETTE.warning, children: "FIELD EDITOR \u2014 no fields" }),
|
|
24142
|
+
/* @__PURE__ */ jsx51(Text48, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
|
|
24143
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "You can add fields manually below or reject this component." }),
|
|
24144
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "Ctrl+S to save \xB7 Esc to discard" })
|
|
23757
24145
|
] });
|
|
23758
24146
|
}
|
|
23759
24147
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
@@ -23804,26 +24192,26 @@ function FieldEditor({
|
|
|
23804
24192
|
const visibleRows = Math.max(1, height - 3);
|
|
23805
24193
|
const scrollStart = selectedRowIdx < 0 ? 0 : Math.max(0, Math.min(selectedRowIdx, rows.length - visibleRows));
|
|
23806
24194
|
const visibleRowSlice = rows.slice(scrollStart, scrollStart + visibleRows);
|
|
23807
|
-
return /* @__PURE__ */
|
|
23808
|
-
|
|
24195
|
+
return /* @__PURE__ */ jsxs46(
|
|
24196
|
+
Box45,
|
|
23809
24197
|
{
|
|
23810
24198
|
flexDirection: "column",
|
|
23811
24199
|
width,
|
|
23812
24200
|
borderStyle: "single",
|
|
23813
24201
|
borderColor: hasEmptyProperties ? PALETTE.warning : PALETTE.info,
|
|
23814
24202
|
children: [
|
|
23815
|
-
hasEmptyProperties && /* @__PURE__ */
|
|
23816
|
-
/* @__PURE__ */
|
|
24203
|
+
hasEmptyProperties && /* @__PURE__ */ jsx51(Text48, { 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." }),
|
|
24204
|
+
/* @__PURE__ */ jsx51(Box45, { flexDirection: "column", width: innerWidth, children: visibleRowSlice.map((row, i) => {
|
|
23817
24205
|
if (row.kind === "header") {
|
|
23818
|
-
return /* @__PURE__ */
|
|
24206
|
+
return /* @__PURE__ */ jsx51(Text48, { bold: true, color: PALETTE.success, children: row.label }, `header-${i}`);
|
|
23819
24207
|
}
|
|
23820
24208
|
if (row.kind === "component-description") {
|
|
23821
24209
|
const isSelected2 = inComponentDesc;
|
|
23822
24210
|
const isEditing = isSelected2 && focusLevel === "field" && activeField === "description";
|
|
23823
24211
|
const desc = editorState.componentDescription;
|
|
23824
|
-
return /* @__PURE__ */
|
|
23825
|
-
/* @__PURE__ */
|
|
23826
|
-
|
|
24212
|
+
return /* @__PURE__ */ jsx51(Box45, { flexDirection: "column", children: /* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
|
|
24213
|
+
/* @__PURE__ */ jsx51(
|
|
24214
|
+
Text48,
|
|
23827
24215
|
{
|
|
23828
24216
|
color: isSelected2 ? PALETTE.inverse : PALETTE.info,
|
|
23829
24217
|
bold: isSelected2,
|
|
@@ -23831,18 +24219,18 @@ function FieldEditor({
|
|
|
23831
24219
|
children: " description: "
|
|
23832
24220
|
}
|
|
23833
24221
|
),
|
|
23834
|
-
isEditing ? /* @__PURE__ */
|
|
23835
|
-
/* @__PURE__ */
|
|
23836
|
-
/* @__PURE__ */
|
|
23837
|
-
/* @__PURE__ */
|
|
23838
|
-
] }) : /* @__PURE__ */
|
|
24222
|
+
isEditing ? /* @__PURE__ */ jsxs46(Box45, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
|
|
24223
|
+
/* @__PURE__ */ jsx51(Text48, { children: desc.slice(0, textCursor) }),
|
|
24224
|
+
/* @__PURE__ */ jsx51(Text48, { inverse: cursorVisible, children: desc[textCursor] ?? (cursorVisible ? "\u2588" : " ") }),
|
|
24225
|
+
/* @__PURE__ */ jsx51(Text48, { children: desc.slice(textCursor + 1) })
|
|
24226
|
+
] }) : /* @__PURE__ */ jsx51(Text48, { color: isSelected2 ? PALETTE.warning : PALETTE.inverse, dimColor: !desc, children: desc || "(none \u2014 Return to edit)" })
|
|
23839
24227
|
] }) }, `component-description-${i}`);
|
|
23840
24228
|
}
|
|
23841
24229
|
if (row.kind === "prop") {
|
|
23842
24230
|
const p = props[row.idx];
|
|
23843
24231
|
const isSelected2 = !inSlots && !inComponentDesc && row.idx === propIdx;
|
|
23844
24232
|
const propMeta = metadata?.props?.[p.name];
|
|
23845
|
-
return /* @__PURE__ */
|
|
24233
|
+
return /* @__PURE__ */ jsx51(
|
|
23846
24234
|
PropRow,
|
|
23847
24235
|
{
|
|
23848
24236
|
prop: p,
|
|
@@ -23863,7 +24251,7 @@ function FieldEditor({
|
|
|
23863
24251
|
const s = slots[row.idx];
|
|
23864
24252
|
const isSelected = inSlots && row.idx === slotIdx;
|
|
23865
24253
|
const slotPickerCandidates = isSelected && editingValue?.mode === "add" && activeField === "allowedComponents" && projectSlotGraph && currentComponentName ? computeAllowedComponentCandidates(projectSlotGraph, currentComponentName, slots, s.name) : null;
|
|
23866
|
-
return /* @__PURE__ */
|
|
24254
|
+
return /* @__PURE__ */ jsx51(
|
|
23867
24255
|
SlotRow,
|
|
23868
24256
|
{
|
|
23869
24257
|
slot: s,
|
|
@@ -23889,50 +24277,50 @@ function FieldEditor({
|
|
|
23889
24277
|
const src = metadata?.componentSource ?? null;
|
|
23890
24278
|
const headerPath = path ?? "<unknown source path>";
|
|
23891
24279
|
if (!start || !end || !src) {
|
|
23892
|
-
return /* @__PURE__ */
|
|
23893
|
-
/* @__PURE__ */
|
|
23894
|
-
/* @__PURE__ */
|
|
23895
|
-
/* @__PURE__ */
|
|
24280
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
24281
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, bold: true, children: `source: ${headerPath}` }),
|
|
24282
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "(no source location captured for this prop)" }),
|
|
24283
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "[s] close" })
|
|
23896
24284
|
] });
|
|
23897
24285
|
}
|
|
23898
24286
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end);
|
|
23899
|
-
return /* @__PURE__ */
|
|
23900
|
-
/* @__PURE__ */
|
|
23901
|
-
lines.map((ln, i) => /* @__PURE__ */
|
|
23902
|
-
/* @__PURE__ */
|
|
24287
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
24288
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, bold: true, children: `${headerPath}: lines ${start}\u2013${end}` }),
|
|
24289
|
+
lines.map((ln, i) => /* @__PURE__ */ jsx51(Text48, { dimColor: true, children: ln }, `source-line-${i}`)),
|
|
24290
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "[s] close \xB7 [Esc] close" })
|
|
23903
24291
|
] });
|
|
23904
24292
|
})(),
|
|
23905
|
-
showHelp && /* @__PURE__ */
|
|
23906
|
-
/* @__PURE__ */
|
|
23907
|
-
/* @__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__ */
|
|
24293
|
+
showHelp && /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
|
|
24294
|
+
/* @__PURE__ */ jsx51(Text48, { bold: true, color: PALETTE.info, children: "Keybindings" }),
|
|
24295
|
+
/* @__PURE__ */ jsx51(Text48, { children: " " }),
|
|
24296
|
+
/* @__PURE__ */ jsx51(Text48, { bold: true, children: "Row navigation" }),
|
|
24297
|
+
/* @__PURE__ */ jsx51(Text48, { children: " \u2191/\u2193 or j/k move between rows" }),
|
|
24298
|
+
/* @__PURE__ */ jsx51(Text48, { children: " Enter edit fields on the current row" }),
|
|
24299
|
+
/* @__PURE__ */ jsx51(Text48, { children: " Esc exit the panel" }),
|
|
24300
|
+
/* @__PURE__ */ jsx51(Text48, { children: " " }),
|
|
24301
|
+
/* @__PURE__ */ jsx51(Text48, { bold: true, children: "Field editing" }),
|
|
24302
|
+
/* @__PURE__ */ jsx51(Text48, { children: " \u2191/\u2193 or j/k cycle through fields (j/k literal in text inputs)" }),
|
|
24303
|
+
/* @__PURE__ */ jsx51(Text48, { children: " \u2190/\u2192 cycle picker values \xB7 move cursor in text inputs" }),
|
|
24304
|
+
/* @__PURE__ */ jsx51(Text48, { children: " Space/Enter toggle required" }),
|
|
24305
|
+
/* @__PURE__ */ jsx51(Text48, { children: " Type edit description / string default" }),
|
|
24306
|
+
/* @__PURE__ */ jsx51(Text48, { children: " Ctrl+S save changes" }),
|
|
24307
|
+
/* @__PURE__ */ jsx51(Text48, { children: " Esc exit field-edit back to the row" }),
|
|
24308
|
+
/* @__PURE__ */ jsx51(Text48, { children: " " }),
|
|
24309
|
+
/* @__PURE__ */ jsx51(Text48, { bold: true, children: "Values / allowedComponents" }),
|
|
24310
|
+
/* @__PURE__ */ jsx51(Text48, { children: " a / e / r add \xB7 edit \xB7 remove" }),
|
|
24311
|
+
/* @__PURE__ */ jsx51(Text48, { children: " \u2191\u2193 or j/k navigate the list" }),
|
|
24312
|
+
/* @__PURE__ */ jsx51(Text48, { children: " K / J reorder up \xB7 down" }),
|
|
24313
|
+
/* @__PURE__ */ jsx51(Text48, { children: " " }),
|
|
24314
|
+
/* @__PURE__ */ jsx51(Text48, { bold: true, children: "Panels" }),
|
|
24315
|
+
/* @__PURE__ */ jsx51(Text48, { children: " s toggle source-view for the current prop" }),
|
|
24316
|
+
/* @__PURE__ */ jsx51(Text48, { children: " " + propRationaleKey.padEnd(16) + " toggle prop rationale panel" }),
|
|
24317
|
+
/* @__PURE__ */ jsx51(Text48, { children: " " + componentRationaleKey.padEnd(16) + " toggle component rationale panel" }),
|
|
24318
|
+
/* @__PURE__ */ jsx51(Text48, { children: " ? toggle this overlay" }),
|
|
24319
|
+
/* @__PURE__ */ jsx51(Text48, { children: " " }),
|
|
24320
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "press ? or Esc to close" })
|
|
23933
24321
|
] }),
|
|
23934
|
-
validationError && /* @__PURE__ */
|
|
23935
|
-
/* @__PURE__ */
|
|
24322
|
+
validationError && /* @__PURE__ */ jsx51(Text48, { color: PALETTE.error, children: "\u2717 " + validationError }),
|
|
24323
|
+
/* @__PURE__ */ jsx51(Text48, { dimColor: true, children: modeLabel })
|
|
23936
24324
|
]
|
|
23937
24325
|
}
|
|
23938
24326
|
);
|
|
@@ -23987,23 +24375,23 @@ var init_wrap_text = __esm({
|
|
|
23987
24375
|
});
|
|
23988
24376
|
|
|
23989
24377
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/RationaleLine.tsx
|
|
23990
|
-
import { Box as
|
|
23991
|
-
import { jsx as
|
|
24378
|
+
import { Box as Box46, Text as Text49 } from "ink";
|
|
24379
|
+
import { jsx as jsx52, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
23992
24380
|
function RationaleLine({ line, active }) {
|
|
23993
24381
|
if (line.kind === "blank") {
|
|
23994
|
-
return /* @__PURE__ */
|
|
24382
|
+
return /* @__PURE__ */ jsx52(Box46, { children: /* @__PURE__ */ jsx52(Text49, { children: " " }) });
|
|
23995
24383
|
}
|
|
23996
24384
|
if (line.kind === "heading") {
|
|
23997
|
-
return /* @__PURE__ */
|
|
24385
|
+
return /* @__PURE__ */ jsx52(Box46, { children: /* @__PURE__ */ jsx52(Text49, { bold: true, color: PALETTE.info, dimColor: !active, children: line.text }) });
|
|
23998
24386
|
}
|
|
23999
24387
|
if (line.kind === "label") {
|
|
24000
|
-
return /* @__PURE__ */
|
|
24001
|
-
line.prefix && /* @__PURE__ */
|
|
24002
|
-
/* @__PURE__ */
|
|
24003
|
-
line.suffix && /* @__PURE__ */
|
|
24388
|
+
return /* @__PURE__ */ jsxs47(Box46, { children: [
|
|
24389
|
+
line.prefix && /* @__PURE__ */ jsx52(Text49, { children: line.prefix }),
|
|
24390
|
+
/* @__PURE__ */ jsx52(Text49, { bold: true, color: line.color, dimColor: !active, children: line.text }),
|
|
24391
|
+
line.suffix && /* @__PURE__ */ jsx52(Text49, { dimColor: true, children: line.suffix })
|
|
24004
24392
|
] });
|
|
24005
24393
|
}
|
|
24006
|
-
return /* @__PURE__ */
|
|
24394
|
+
return /* @__PURE__ */ jsx52(Box46, { children: /* @__PURE__ */ jsx52(Text49, { dimColor: !active || line.dim, children: line.text }) });
|
|
24007
24395
|
}
|
|
24008
24396
|
var init_RationaleLine = __esm({
|
|
24009
24397
|
"packages/experience-design-system-cli/src/analyze/select/tui/components/RationaleLine.tsx"() {
|
|
@@ -24013,8 +24401,8 @@ var init_RationaleLine = __esm({
|
|
|
24013
24401
|
});
|
|
24014
24402
|
|
|
24015
24403
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/ComponentRationalePanel.tsx
|
|
24016
|
-
import { Box as
|
|
24017
|
-
import { jsx as
|
|
24404
|
+
import { Box as Box47, Text as Text50 } from "ink";
|
|
24405
|
+
import { jsx as jsx53, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
24018
24406
|
function renderComponentRationaleLines(data, innerWidth) {
|
|
24019
24407
|
const out = [];
|
|
24020
24408
|
const pushSection = (heading, body) => {
|
|
@@ -24081,8 +24469,8 @@ function ComponentRationalePanel({
|
|
|
24081
24469
|
const overflowed = totalLines > contentHeight;
|
|
24082
24470
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
24083
24471
|
const visibleEnd = Math.min(totalLines, scrollOffset + contentHeight);
|
|
24084
|
-
return /* @__PURE__ */
|
|
24085
|
-
|
|
24472
|
+
return /* @__PURE__ */ jsxs48(
|
|
24473
|
+
Box47,
|
|
24086
24474
|
{
|
|
24087
24475
|
flexDirection: "column",
|
|
24088
24476
|
width,
|
|
@@ -24090,9 +24478,9 @@ function ComponentRationalePanel({
|
|
|
24090
24478
|
borderStyle: "single",
|
|
24091
24479
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
24092
24480
|
children: [
|
|
24093
|
-
/* @__PURE__ */
|
|
24094
|
-
visible.map((line, i) => /* @__PURE__ */
|
|
24095
|
-
/* @__PURE__ */
|
|
24481
|
+
/* @__PURE__ */ jsx53(Box47, { children: /* @__PURE__ */ jsx53(Text50, { bold: true, dimColor: !active, children: `Component rationale: ${data.name}` }) }),
|
|
24482
|
+
visible.map((line, i) => /* @__PURE__ */ jsx53(RationaleLine, { line, active }, i)),
|
|
24483
|
+
/* @__PURE__ */ jsx53(Box47, { children: overflowed ? /* @__PURE__ */ jsx53(Text50, { dimColor: true, children: `${visibleStart}-${visibleEnd}/${totalLines} [j/k] scroll [I/Esc] close` }) : /* @__PURE__ */ jsx53(Text50, { dimColor: true, children: "[I/Esc] close" }) })
|
|
24096
24484
|
]
|
|
24097
24485
|
}
|
|
24098
24486
|
);
|
|
@@ -24109,8 +24497,8 @@ var init_ComponentRationalePanel = __esm({
|
|
|
24109
24497
|
});
|
|
24110
24498
|
|
|
24111
24499
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/RationalePanel.tsx
|
|
24112
|
-
import { Text as
|
|
24113
|
-
import { jsx as
|
|
24500
|
+
import { Text as Text51 } from "ink";
|
|
24501
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
24114
24502
|
function renderRationaleLines(rows, innerWidth) {
|
|
24115
24503
|
const out = [];
|
|
24116
24504
|
rows.forEach((row, idx) => {
|
|
@@ -24143,10 +24531,10 @@ function RationalePanel({
|
|
|
24143
24531
|
const visible = allLines.slice(scrollOffset, scrollOffset + height);
|
|
24144
24532
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
24145
24533
|
const visibleEnd = Math.min(totalLines, scrollOffset + height);
|
|
24146
|
-
return /* @__PURE__ */
|
|
24534
|
+
return /* @__PURE__ */ jsx54(
|
|
24147
24535
|
ScrollablePanel,
|
|
24148
24536
|
{
|
|
24149
|
-
header: /* @__PURE__ */
|
|
24537
|
+
header: /* @__PURE__ */ jsx54(Text51, { bold: true, dimColor: !active, children: `RATIONALE \u2014 ${componentName}` }),
|
|
24150
24538
|
width,
|
|
24151
24539
|
height,
|
|
24152
24540
|
active,
|
|
@@ -24154,7 +24542,7 @@ function RationalePanel({
|
|
|
24154
24542
|
visibleStart,
|
|
24155
24543
|
visibleEnd,
|
|
24156
24544
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
24157
|
-
children: visible.map((line, i) => /* @__PURE__ */
|
|
24545
|
+
children: visible.map((line, i) => /* @__PURE__ */ jsx54(RationaleLine, { line, active }, i))
|
|
24158
24546
|
}
|
|
24159
24547
|
);
|
|
24160
24548
|
}
|
|
@@ -24169,8 +24557,8 @@ var init_RationalePanel = __esm({
|
|
|
24169
24557
|
});
|
|
24170
24558
|
|
|
24171
24559
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/TokenReviewPanel.tsx
|
|
24172
|
-
import { Box as
|
|
24173
|
-
import { jsx as
|
|
24560
|
+
import { Box as Box48, Text as Text52 } from "ink";
|
|
24561
|
+
import { jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
24174
24562
|
function collectTokenSuggestions(entry, availableTokens = []) {
|
|
24175
24563
|
return Object.entries(entry.$properties).filter(([, def]) => {
|
|
24176
24564
|
const rawKind = def["$token.kind"];
|
|
@@ -24204,8 +24592,8 @@ function TokenReviewPanel({
|
|
|
24204
24592
|
const scrollStart = Math.max(0, Math.min(editCursor - Math.floor(visibleCount / 2), maxStart));
|
|
24205
24593
|
const visiblePaths = current.paths.slice(scrollStart, scrollStart + visibleCount);
|
|
24206
24594
|
const rangeLabel = current.paths.length === 0 ? "no compatible tokens" : `${scrollStart + 1}-${scrollStart + visiblePaths.length} of ${current.paths.length}`;
|
|
24207
|
-
return /* @__PURE__ */
|
|
24208
|
-
|
|
24595
|
+
return /* @__PURE__ */ jsxs49(
|
|
24596
|
+
Box48,
|
|
24209
24597
|
{
|
|
24210
24598
|
flexDirection: "column",
|
|
24211
24599
|
width,
|
|
@@ -24213,25 +24601,25 @@ function TokenReviewPanel({
|
|
|
24213
24601
|
borderStyle: "single",
|
|
24214
24602
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
24215
24603
|
children: [
|
|
24216
|
-
/* @__PURE__ */
|
|
24217
|
-
/* @__PURE__ */
|
|
24218
|
-
/* @__PURE__ */
|
|
24219
|
-
current.paths.length === 0 && /* @__PURE__ */
|
|
24604
|
+
/* @__PURE__ */ jsx55(Text52, { bold: true, dimColor: !active, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
|
|
24605
|
+
/* @__PURE__ */ jsx55(Text52, { dimColor: true, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
|
|
24606
|
+
/* @__PURE__ */ jsx55(Text52, { children: " " }),
|
|
24607
|
+
current.paths.length === 0 && /* @__PURE__ */ jsx55(Text52, { dimColor: true, children: "(no compatible tokens found for this token kind)" }),
|
|
24220
24608
|
visiblePaths.map((path, i) => {
|
|
24221
24609
|
const pathIndex = scrollStart + i;
|
|
24222
24610
|
const checked = editSelection.has(path);
|
|
24223
24611
|
const focused = pathIndex === editCursor;
|
|
24224
|
-
return /* @__PURE__ */
|
|
24612
|
+
return /* @__PURE__ */ jsx55(Box48, { children: /* @__PURE__ */ jsx55(Text52, { color: focused ? PALETTE.info : void 0, bold: focused, dimColor: !active, wrap: "truncate", children: ` [${checked ? "x" : " "}] ${path}` }) }, path);
|
|
24225
24613
|
}),
|
|
24226
|
-
/* @__PURE__ */
|
|
24227
|
-
/* @__PURE__ */
|
|
24228
|
-
/* @__PURE__ */
|
|
24614
|
+
/* @__PURE__ */ jsx55(Text52, { children: " " }),
|
|
24615
|
+
/* @__PURE__ */ jsx55(Text52, { dimColor: true, wrap: "truncate", children: "[\u2191/\u2193] move [Space] toggle" }),
|
|
24616
|
+
/* @__PURE__ */ jsx55(Text52, { dimColor: true, wrap: "truncate", children: "[Ctrl+S] save [Esc] cancel" })
|
|
24229
24617
|
]
|
|
24230
24618
|
}
|
|
24231
24619
|
);
|
|
24232
24620
|
}
|
|
24233
|
-
return /* @__PURE__ */
|
|
24234
|
-
|
|
24621
|
+
return /* @__PURE__ */ jsxs49(
|
|
24622
|
+
Box48,
|
|
24235
24623
|
{
|
|
24236
24624
|
flexDirection: "column",
|
|
24237
24625
|
width,
|
|
@@ -24239,18 +24627,18 @@ function TokenReviewPanel({
|
|
|
24239
24627
|
borderStyle: "single",
|
|
24240
24628
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
24241
24629
|
children: [
|
|
24242
|
-
/* @__PURE__ */
|
|
24243
|
-
suggestions.length === 0 && /* @__PURE__ */
|
|
24630
|
+
/* @__PURE__ */ jsx55(Text52, { bold: true, dimColor: !active, children: `TOKEN REVIEW \u2014 ${componentName}` }),
|
|
24631
|
+
suggestions.length === 0 && /* @__PURE__ */ jsx55(Text52, { dimColor: true, children: "(no token suggestions for this component)" }),
|
|
24244
24632
|
suggestions.map((s, i) => {
|
|
24245
24633
|
const focused = i === selectedRow;
|
|
24246
|
-
return /* @__PURE__ */
|
|
24247
|
-
/* @__PURE__ */
|
|
24248
|
-
/* @__PURE__ */
|
|
24249
|
-
/* @__PURE__ */
|
|
24634
|
+
return /* @__PURE__ */ jsxs49(Box48, { flexDirection: "column", children: [
|
|
24635
|
+
/* @__PURE__ */ jsx55(Box48, { children: /* @__PURE__ */ jsx55(Text52, { color: focused ? PALETTE.info : void 0, bold: focused, dimColor: !active, children: `${focused ? "\u25B6" : " "} ${s.propName}` }) }),
|
|
24636
|
+
/* @__PURE__ */ jsx55(Text52, { dimColor: true, children: ` suggested: ${s.suggested.join(", ")}` }),
|
|
24637
|
+
/* @__PURE__ */ jsx55(Text52, { dimColor: true, children: ` allowed: ${s.allowed.join(", ")}` })
|
|
24250
24638
|
] }, s.propName);
|
|
24251
24639
|
}),
|
|
24252
|
-
/* @__PURE__ */
|
|
24253
|
-
/* @__PURE__ */
|
|
24640
|
+
/* @__PURE__ */ jsx55(Text52, { children: " " }),
|
|
24641
|
+
/* @__PURE__ */ jsx55(Text52, { dimColor: true, children: "[\u2191/\u2193] move [Enter] edit allowed [Esc] close" })
|
|
24254
24642
|
]
|
|
24255
24643
|
}
|
|
24256
24644
|
);
|
|
@@ -24263,8 +24651,8 @@ var init_TokenReviewPanel = __esm({
|
|
|
24263
24651
|
});
|
|
24264
24652
|
|
|
24265
24653
|
// packages/experience-design-system-cli/src/import/tui/steps/review-details-panel.tsx
|
|
24266
|
-
import { Box as
|
|
24267
|
-
import { Fragment as Fragment15, jsx as
|
|
24654
|
+
import { Box as Box49, Text as Text53 } from "ink";
|
|
24655
|
+
import { Fragment as Fragment15, jsx as jsx56, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
24268
24656
|
function ReviewDetailsPanel({
|
|
24269
24657
|
selectedKey,
|
|
24270
24658
|
panelOpen,
|
|
@@ -24298,7 +24686,7 @@ function ReviewDetailsPanel({
|
|
|
24298
24686
|
rationale: s.rationale ?? ""
|
|
24299
24687
|
}))
|
|
24300
24688
|
];
|
|
24301
|
-
return /* @__PURE__ */
|
|
24689
|
+
return /* @__PURE__ */ jsx56(
|
|
24302
24690
|
RationalePanel,
|
|
24303
24691
|
{
|
|
24304
24692
|
componentName: componentRationale?.name ?? selectedKey,
|
|
@@ -24311,7 +24699,7 @@ function ReviewDetailsPanel({
|
|
|
24311
24699
|
);
|
|
24312
24700
|
}
|
|
24313
24701
|
if (panelOpen === "component-rationale") {
|
|
24314
|
-
return /* @__PURE__ */
|
|
24702
|
+
return /* @__PURE__ */ jsx56(
|
|
24315
24703
|
ComponentRationalePanel,
|
|
24316
24704
|
{
|
|
24317
24705
|
data: componentRationale ?? {
|
|
@@ -24335,14 +24723,14 @@ function ReviewDetailsPanel({
|
|
|
24335
24723
|
const source = reviewMetadata?.componentSource ?? null;
|
|
24336
24724
|
const headerPath = path ?? "<unknown source path>";
|
|
24337
24725
|
const lines = source ? source.split("\n").slice(panelScrollOffset, panelScrollOffset + height) : [];
|
|
24338
|
-
return /* @__PURE__ */
|
|
24339
|
-
/* @__PURE__ */
|
|
24340
|
-
source ? lines.map((line, index) => /* @__PURE__ */
|
|
24341
|
-
/* @__PURE__ */
|
|
24726
|
+
return /* @__PURE__ */ jsxs50(Box49, { flexDirection: "column", width, borderStyle: "single", borderColor: sourceBorderColor, paddingX: 1, children: [
|
|
24727
|
+
/* @__PURE__ */ jsx56(Text53, { dimColor: true, bold: true, children: `source: ${headerPath}` }),
|
|
24728
|
+
source ? lines.map((line, index) => /* @__PURE__ */ jsx56(Text53, { dimColor: true, children: line }, `source-line-${index}`)) : /* @__PURE__ */ jsx56(Text53, { dimColor: true, children: "(no source captured)" }),
|
|
24729
|
+
/* @__PURE__ */ jsx56(Text53, { dimColor: true, children: "[s/Esc] close" })
|
|
24342
24730
|
] });
|
|
24343
24731
|
}
|
|
24344
24732
|
if (panelOpen === "token-review") {
|
|
24345
|
-
return /* @__PURE__ */
|
|
24733
|
+
return /* @__PURE__ */ jsx56(
|
|
24346
24734
|
TokenReviewPanel,
|
|
24347
24735
|
{
|
|
24348
24736
|
componentName: selectedKey,
|
|
@@ -24358,7 +24746,7 @@ function ReviewDetailsPanel({
|
|
|
24358
24746
|
);
|
|
24359
24747
|
}
|
|
24360
24748
|
if (showJson) {
|
|
24361
|
-
return /* @__PURE__ */
|
|
24749
|
+
return /* @__PURE__ */ jsx56(
|
|
24362
24750
|
JsonPanel,
|
|
24363
24751
|
{
|
|
24364
24752
|
label: "GENERATED DEFINITION (read-only)",
|
|
@@ -24370,7 +24758,7 @@ function ReviewDetailsPanel({
|
|
|
24370
24758
|
}
|
|
24371
24759
|
);
|
|
24372
24760
|
}
|
|
24373
|
-
return /* @__PURE__ */
|
|
24761
|
+
return /* @__PURE__ */ jsx56(Fragment15, { children: editor });
|
|
24374
24762
|
}
|
|
24375
24763
|
var init_review_details_panel = __esm({
|
|
24376
24764
|
"packages/experience-design-system-cli/src/import/tui/steps/review-details-panel.tsx"() {
|
|
@@ -24383,7 +24771,7 @@ var init_review_details_panel = __esm({
|
|
|
24383
24771
|
});
|
|
24384
24772
|
|
|
24385
24773
|
// packages/experience-design-system-cli/src/import/tui/components/ReviewDetailsEditor.tsx
|
|
24386
|
-
import { jsx as
|
|
24774
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
24387
24775
|
import { createElement as createElement7 } from "react";
|
|
24388
24776
|
function toFieldEditorMetadata(reviewMetadata) {
|
|
24389
24777
|
if (!reviewMetadata) return void 0;
|
|
@@ -24416,7 +24804,7 @@ function ReviewDetailsEditor({
|
|
|
24416
24804
|
jsonScrollOffset,
|
|
24417
24805
|
currentTokenSuggestions
|
|
24418
24806
|
} = reviewEditor;
|
|
24419
|
-
return /* @__PURE__ */
|
|
24807
|
+
return /* @__PURE__ */ jsx57(
|
|
24420
24808
|
ReviewDetailsPanel,
|
|
24421
24809
|
{
|
|
24422
24810
|
selectedKey,
|
|
@@ -24459,8 +24847,8 @@ var init_ReviewDetailsEditor = __esm({
|
|
|
24459
24847
|
});
|
|
24460
24848
|
|
|
24461
24849
|
// packages/experience-design-system-cli/src/import/tui/components/ReviewComponentPanel.tsx
|
|
24462
|
-
import { Box as
|
|
24463
|
-
import { Fragment as Fragment16, jsx as
|
|
24850
|
+
import { Box as Box50, Text as Text54 } from "ink";
|
|
24851
|
+
import { Fragment as Fragment16, jsx as jsx58, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
24464
24852
|
function buildReviewFieldEditor(reviewEditor, selectedJson, onExit, overrides = {}) {
|
|
24465
24853
|
return {
|
|
24466
24854
|
value: reviewEditor.draftValue || selectedJson,
|
|
@@ -24500,17 +24888,17 @@ function ReviewEmptyComponentsWarning({
|
|
|
24500
24888
|
hidden
|
|
24501
24889
|
}) {
|
|
24502
24890
|
if (hidden || count === 0) return null;
|
|
24503
|
-
return /* @__PURE__ */
|
|
24891
|
+
return /* @__PURE__ */ jsx58(Text54, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
|
|
24504
24892
|
}
|
|
24505
24893
|
function ReviewNoSelection() {
|
|
24506
|
-
return /* @__PURE__ */
|
|
24894
|
+
return /* @__PURE__ */ jsx58(Box50, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx58(Text54, { dimColor: true, children: "No component selected" }) });
|
|
24507
24895
|
}
|
|
24508
24896
|
function ReviewFinalizeError({
|
|
24509
24897
|
message,
|
|
24510
24898
|
hidden
|
|
24511
24899
|
}) {
|
|
24512
24900
|
if (hidden || !message) return null;
|
|
24513
|
-
return /* @__PURE__ */
|
|
24901
|
+
return /* @__PURE__ */ jsx58(Text54, { color: PALETTE.error, children: `\u26A0 ${message}` });
|
|
24514
24902
|
}
|
|
24515
24903
|
function ReviewPanelFooter({
|
|
24516
24904
|
reviewEditor,
|
|
@@ -24519,10 +24907,10 @@ function ReviewPanelFooter({
|
|
|
24519
24907
|
livePreview,
|
|
24520
24908
|
livePreviewSpinner
|
|
24521
24909
|
}) {
|
|
24522
|
-
return /* @__PURE__ */
|
|
24910
|
+
return /* @__PURE__ */ jsxs51(Fragment16, { children: [
|
|
24523
24911
|
reviewEditor.panelOpen === "token-review" ? " [\u2191/\u2193] move [Enter] edit allowed [Esc] close" : sidebarFocused ? sidebarFooter : reviewEditor.showJson ? " [j/k] 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" : ""),
|
|
24524
|
-
livePreview.status === "running" && /* @__PURE__ */
|
|
24525
|
-
livePreview.disabled && /* @__PURE__ */
|
|
24912
|
+
livePreview.status === "running" && /* @__PURE__ */ jsx58(Text54, { children: ` ${livePreviewSpinner} live preview` }),
|
|
24913
|
+
livePreview.disabled && /* @__PURE__ */ jsx58(Text54, { children: " \xB7 live preview disabled" })
|
|
24526
24914
|
] });
|
|
24527
24915
|
}
|
|
24528
24916
|
function ReviewComponentPanel({
|
|
@@ -24544,11 +24932,11 @@ function ReviewComponentPanel({
|
|
|
24544
24932
|
}) {
|
|
24545
24933
|
const propCount = Object.keys(selectedEntry.$properties).length;
|
|
24546
24934
|
const slotCount = selectedEntry.$slots ? Object.keys(selectedEntry.$slots).length : 0;
|
|
24547
|
-
return /* @__PURE__ */
|
|
24548
|
-
/* @__PURE__ */
|
|
24549
|
-
/* @__PURE__ */
|
|
24550
|
-
/* @__PURE__ */
|
|
24551
|
-
/* @__PURE__ */
|
|
24935
|
+
return /* @__PURE__ */ jsxs51(Box50, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: [
|
|
24936
|
+
/* @__PURE__ */ jsxs51(Box50, { children: [
|
|
24937
|
+
/* @__PURE__ */ jsx58(Text54, { bold: true, children: selectedKey }),
|
|
24938
|
+
/* @__PURE__ */ jsx58(Box50, { flexGrow: 1 }),
|
|
24939
|
+
/* @__PURE__ */ jsxs51(Text54, { dimColor: true, children: [
|
|
24552
24940
|
propCount,
|
|
24553
24941
|
" prop",
|
|
24554
24942
|
propCount !== 1 ? "s" : "",
|
|
@@ -24557,7 +24945,7 @@ function ReviewComponentPanel({
|
|
|
24557
24945
|
sidebarFocused ? "[Tab] focus panel" : "[Tab] focus list"
|
|
24558
24946
|
] })
|
|
24559
24947
|
] }),
|
|
24560
|
-
/* @__PURE__ */
|
|
24948
|
+
/* @__PURE__ */ jsx58(
|
|
24561
24949
|
ReviewDetailsEditor,
|
|
24562
24950
|
{
|
|
24563
24951
|
selectedKey,
|
|
@@ -24572,8 +24960,8 @@ function ReviewComponentPanel({
|
|
|
24572
24960
|
fieldEditor
|
|
24573
24961
|
}
|
|
24574
24962
|
),
|
|
24575
|
-
saveError && /* @__PURE__ */
|
|
24576
|
-
/* @__PURE__ */
|
|
24963
|
+
saveError && /* @__PURE__ */ jsx58(Text54, { color: PALETTE.error, children: "\u2717 " + saveError }),
|
|
24964
|
+
/* @__PURE__ */ jsx58(Text54, { dimColor: true, children: /* @__PURE__ */ jsx58(
|
|
24577
24965
|
ReviewPanelFooter,
|
|
24578
24966
|
{
|
|
24579
24967
|
reviewEditor,
|
|
@@ -24595,8 +24983,8 @@ var init_ReviewComponentPanel = __esm({
|
|
|
24595
24983
|
});
|
|
24596
24984
|
|
|
24597
24985
|
// packages/experience-design-system-cli/src/import/tui/components/ReviewStatus.tsx
|
|
24598
|
-
import { Box as
|
|
24599
|
-
import { jsx as
|
|
24986
|
+
import { Box as Box51, Text as Text55 } from "ink";
|
|
24987
|
+
import { jsx as jsx59, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
24600
24988
|
function countReviewStatuses(entries) {
|
|
24601
24989
|
return entries.reduce(
|
|
24602
24990
|
(counts, entry) => {
|
|
@@ -24614,7 +25002,7 @@ function ReviewStatusBar({
|
|
|
24614
25002
|
onFinalize
|
|
24615
25003
|
}) {
|
|
24616
25004
|
const { accepted, rejected, needsReview } = countReviewStatuses(entries);
|
|
24617
|
-
return /* @__PURE__ */
|
|
25005
|
+
return /* @__PURE__ */ jsx59(
|
|
24618
25006
|
StatusBar,
|
|
24619
25007
|
{
|
|
24620
25008
|
accepted,
|
|
@@ -24627,13 +25015,13 @@ function ReviewStatusBar({
|
|
|
24627
25015
|
);
|
|
24628
25016
|
}
|
|
24629
25017
|
function ReviewLoadingState() {
|
|
24630
|
-
return /* @__PURE__ */
|
|
25018
|
+
return /* @__PURE__ */ jsx59(Box51, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx59(Text55, { dimColor: true, children: "Loading generated definitions..." }) });
|
|
24631
25019
|
}
|
|
24632
25020
|
function ReviewLoadError({ message }) {
|
|
24633
|
-
return /* @__PURE__ */
|
|
24634
|
-
/* @__PURE__ */
|
|
24635
|
-
/* @__PURE__ */
|
|
24636
|
-
/* @__PURE__ */
|
|
25021
|
+
return /* @__PURE__ */ jsxs52(Box51, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
25022
|
+
/* @__PURE__ */ jsx59(Text55, { color: PALETTE.error, children: message }),
|
|
25023
|
+
/* @__PURE__ */ jsx59(Text55, { children: " " }),
|
|
25024
|
+
/* @__PURE__ */ jsx59(Text55, { dimColor: true, children: "[q / Enter / Esc] Quit" })
|
|
24637
25025
|
] });
|
|
24638
25026
|
}
|
|
24639
25027
|
var init_ReviewStatus = __esm({
|
|
@@ -24704,7 +25092,7 @@ var init_history = __esm({
|
|
|
24704
25092
|
});
|
|
24705
25093
|
|
|
24706
25094
|
// packages/experience-design-system-cli/src/import/tui/hooks/useReviewSession.ts
|
|
24707
|
-
import { useCallback as useCallback4, useEffect as useEffect8, useRef as useRef6, useState as
|
|
25095
|
+
import { useCallback as useCallback4, useEffect as useEffect8, useRef as useRef6, useState as useState26 } from "react";
|
|
24708
25096
|
function loadReviewSessionState({
|
|
24709
25097
|
extractSessionId,
|
|
24710
25098
|
tokenSessionId,
|
|
@@ -24750,10 +25138,10 @@ function useReviewSession({
|
|
|
24750
25138
|
tokensPath,
|
|
24751
25139
|
onExtraLoaded
|
|
24752
25140
|
}) {
|
|
24753
|
-
const [components, setComponents] =
|
|
24754
|
-
const [loading, setLoading] =
|
|
24755
|
-
const [loadError, setLoadError] =
|
|
24756
|
-
const [availableTokens, setAvailableTokens] =
|
|
25141
|
+
const [components, setComponents] = useState26([]);
|
|
25142
|
+
const [loading, setLoading] = useState26(true);
|
|
25143
|
+
const [loadError, setLoadError] = useState26(null);
|
|
25144
|
+
const [availableTokens, setAvailableTokens] = useState26([]);
|
|
24757
25145
|
const loadInitialState = useCallback4(async () => {
|
|
24758
25146
|
const result = loadSession();
|
|
24759
25147
|
if (result.error || !tokensPath) return { result, catalog: result.tokens };
|
|
@@ -24814,8 +25202,8 @@ function useReviewSession({
|
|
|
24814
25202
|
};
|
|
24815
25203
|
}
|
|
24816
25204
|
function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
|
|
24817
|
-
const [reviewMetadata, setReviewMetadata] =
|
|
24818
|
-
const [componentRationale, setComponentRationale] =
|
|
25205
|
+
const [reviewMetadata, setReviewMetadata] = useState26(null);
|
|
25206
|
+
const [componentRationale, setComponentRationale] = useState26(null);
|
|
24819
25207
|
useEffect8(() => {
|
|
24820
25208
|
const current = components[selectedIdx];
|
|
24821
25209
|
if (!current) {
|
|
@@ -24920,7 +25308,7 @@ var init_useReviewSession = __esm({
|
|
|
24920
25308
|
});
|
|
24921
25309
|
|
|
24922
25310
|
// packages/experience-design-system-cli/src/import/tui/hooks/useReviewEditor.ts
|
|
24923
|
-
import { useEffect as useEffect9, useRef as useRef7, useState as
|
|
25311
|
+
import { useEffect as useEffect9, useRef as useRef7, useState as useState27 } from "react";
|
|
24924
25312
|
function parseReviewEntry(draftValue) {
|
|
24925
25313
|
const parsed = JSON.parse(draftValue);
|
|
24926
25314
|
const keys = Object.keys(parsed);
|
|
@@ -24940,18 +25328,18 @@ function useReviewEditor({
|
|
|
24940
25328
|
onEditSaved,
|
|
24941
25329
|
onTokenSaved
|
|
24942
25330
|
}) {
|
|
24943
|
-
const [panelOpen, setPanelOpen] =
|
|
24944
|
-
const [panelScrollOffset, setPanelScrollOffset] =
|
|
24945
|
-
const [jsonScrollOffset, setJsonScrollOffset] =
|
|
24946
|
-
const [textEntryActive, setTextEntryActive] =
|
|
24947
|
-
const [showJson, setShowJson] =
|
|
24948
|
-
const [showHiddenProps, setShowHiddenProps] =
|
|
24949
|
-
const [draftValue, setDraftValue] =
|
|
24950
|
-
const [saveError, setSaveError] =
|
|
24951
|
-
const [tokenReviewRow, setTokenReviewRow] =
|
|
24952
|
-
const [tokenReviewEditing, setTokenReviewEditing] =
|
|
24953
|
-
const [tokenReviewEditCursor, setTokenReviewEditCursor] =
|
|
24954
|
-
const [tokenReviewEditSelection, setTokenReviewEditSelection] =
|
|
25331
|
+
const [panelOpen, setPanelOpen] = useState27("none");
|
|
25332
|
+
const [panelScrollOffset, setPanelScrollOffset] = useState27(0);
|
|
25333
|
+
const [jsonScrollOffset, setJsonScrollOffset] = useState27(0);
|
|
25334
|
+
const [textEntryActive, setTextEntryActive] = useState27(false);
|
|
25335
|
+
const [showJson, setShowJson] = useState27(false);
|
|
25336
|
+
const [showHiddenProps, setShowHiddenProps] = useState27(false);
|
|
25337
|
+
const [draftValue, setDraftValue] = useState27("");
|
|
25338
|
+
const [saveError, setSaveError] = useState27(null);
|
|
25339
|
+
const [tokenReviewRow, setTokenReviewRow] = useState27(0);
|
|
25340
|
+
const [tokenReviewEditing, setTokenReviewEditing] = useState27(false);
|
|
25341
|
+
const [tokenReviewEditCursor, setTokenReviewEditCursor] = useState27(0);
|
|
25342
|
+
const [tokenReviewEditSelection, setTokenReviewEditSelection] = useState27(/* @__PURE__ */ new Set());
|
|
24955
25343
|
const tokenReviewSuggestedRef = useRef7(/* @__PURE__ */ new Map());
|
|
24956
25344
|
const pendingGRef = useRef7(false);
|
|
24957
25345
|
useEffect9(() => {
|
|
@@ -25073,12 +25461,12 @@ var init_useReviewEditor = __esm({
|
|
|
25073
25461
|
});
|
|
25074
25462
|
|
|
25075
25463
|
// packages/experience-design-system-cli/src/import/tui/hooks/useReviewSurfaceState.ts
|
|
25076
|
-
import { useState as
|
|
25464
|
+
import { useState as useState28 } from "react";
|
|
25077
25465
|
function useReviewSurfaceState(initialFinalizeError = null) {
|
|
25078
|
-
const [sidebarFocused, setSidebarFocused] =
|
|
25079
|
-
const [showFinalize, setShowFinalize] =
|
|
25080
|
-
const [showQuit, setShowQuit] =
|
|
25081
|
-
const [finalizeError, setFinalizeError] =
|
|
25466
|
+
const [sidebarFocused, setSidebarFocused] = useState28(true);
|
|
25467
|
+
const [showFinalize, setShowFinalize] = useState28(false);
|
|
25468
|
+
const [showQuit, setShowQuit] = useState28(false);
|
|
25469
|
+
const [finalizeError, setFinalizeError] = useState28(initialFinalizeError);
|
|
25082
25470
|
return {
|
|
25083
25471
|
sidebarFocused,
|
|
25084
25472
|
setSidebarFocused,
|
|
@@ -25097,8 +25485,8 @@ var init_useReviewSurfaceState = __esm({
|
|
|
25097
25485
|
});
|
|
25098
25486
|
|
|
25099
25487
|
// packages/experience-design-system-cli/src/import/tui/components/ReviewDialogs.tsx
|
|
25100
|
-
import { Box as
|
|
25101
|
-
import { Fragment as Fragment17, jsx as
|
|
25488
|
+
import { Box as Box52, Text as Text56 } from "ink";
|
|
25489
|
+
import { Fragment as Fragment17, jsx as jsx60, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
25102
25490
|
function ReviewFinalizeDialogs({
|
|
25103
25491
|
showFinalize,
|
|
25104
25492
|
showQuit,
|
|
@@ -25112,8 +25500,8 @@ function ReviewFinalizeDialogs({
|
|
|
25112
25500
|
onQuitCancel
|
|
25113
25501
|
}) {
|
|
25114
25502
|
const { accepted, rejected, needsReview } = countReviewStatuses(components);
|
|
25115
|
-
return /* @__PURE__ */
|
|
25116
|
-
showFinalize && /* @__PURE__ */
|
|
25503
|
+
return /* @__PURE__ */ jsxs53(Fragment17, { children: [
|
|
25504
|
+
showFinalize && /* @__PURE__ */ jsx60(
|
|
25117
25505
|
FinalizeDialog,
|
|
25118
25506
|
{
|
|
25119
25507
|
accepted,
|
|
@@ -25126,7 +25514,7 @@ function ReviewFinalizeDialogs({
|
|
|
25126
25514
|
onCancel: onFinalizeCancel
|
|
25127
25515
|
}
|
|
25128
25516
|
),
|
|
25129
|
-
showQuit && /* @__PURE__ */
|
|
25517
|
+
showQuit && /* @__PURE__ */ jsx60(QuitDialog, { hasUnsavedDrafts: false, onConfirm: onQuitConfirm, onCancel: onQuitCancel })
|
|
25130
25518
|
] });
|
|
25131
25519
|
}
|
|
25132
25520
|
function ReviewStepDialogs({
|
|
@@ -25136,7 +25524,7 @@ function ReviewStepDialogs({
|
|
|
25136
25524
|
onFinalize,
|
|
25137
25525
|
onQuit
|
|
25138
25526
|
}) {
|
|
25139
|
-
return /* @__PURE__ */
|
|
25527
|
+
return /* @__PURE__ */ jsx60(
|
|
25140
25528
|
ReviewFinalizeDialogs,
|
|
25141
25529
|
{
|
|
25142
25530
|
showFinalize: surfaceState.showFinalize,
|
|
@@ -25154,12 +25542,12 @@ function ReviewStepDialogs({
|
|
|
25154
25542
|
}
|
|
25155
25543
|
function ReviewReloadDialog({ open }) {
|
|
25156
25544
|
if (!open) return null;
|
|
25157
|
-
return /* @__PURE__ */
|
|
25158
|
-
/* @__PURE__ */
|
|
25159
|
-
/* @__PURE__ */
|
|
25160
|
-
/* @__PURE__ */
|
|
25161
|
-
/* @__PURE__ */
|
|
25162
|
-
/* @__PURE__ */
|
|
25545
|
+
return /* @__PURE__ */ jsxs53(Box52, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
25546
|
+
/* @__PURE__ */ jsx60(Text56, { bold: true, color: PALETTE.warning, children: "Reload from saved state?" }),
|
|
25547
|
+
/* @__PURE__ */ jsx60(Text56, { children: "Unsaved in-memory changes will be lost." }),
|
|
25548
|
+
/* @__PURE__ */ jsx60(Text56, { children: " " }),
|
|
25549
|
+
/* @__PURE__ */ jsx60(Text56, { children: " [Enter] Confirm" }),
|
|
25550
|
+
/* @__PURE__ */ jsx60(Text56, { children: " [Esc] Cancel" })
|
|
25163
25551
|
] });
|
|
25164
25552
|
}
|
|
25165
25553
|
var init_ReviewDialogs = __esm({
|
|
@@ -25402,11 +25790,11 @@ var init_preview_annotations = __esm({
|
|
|
25402
25790
|
});
|
|
25403
25791
|
|
|
25404
25792
|
// packages/experience-design-system-cli/src/import/tui/useLivePreview.ts
|
|
25405
|
-
import { useCallback as useCallback5, useEffect as useEffect10, useRef as useRef8, useState as
|
|
25793
|
+
import { useCallback as useCallback5, useEffect as useEffect10, useRef as useRef8, useState as useState29 } from "react";
|
|
25406
25794
|
function useLivePreview(opts) {
|
|
25407
25795
|
const debounceMs = opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
25408
|
-
const [status, setStatus] =
|
|
25409
|
-
const [disabled, setDisabled] =
|
|
25796
|
+
const [status, setStatus] = useState29("idle");
|
|
25797
|
+
const [disabled, setDisabled] = useState29(false);
|
|
25410
25798
|
const timerRef = useRef8(null);
|
|
25411
25799
|
const generationRef = useRef8(0);
|
|
25412
25800
|
const latestRef = useRef8(0);
|
|
@@ -25501,7 +25889,7 @@ var init_useLivePreview = __esm({
|
|
|
25501
25889
|
});
|
|
25502
25890
|
|
|
25503
25891
|
// packages/experience-design-system-cli/src/import/tui/hooks/useReviewPreview.ts
|
|
25504
|
-
import { useCallback as useCallback6, useEffect as useEffect11, useState as
|
|
25892
|
+
import { useCallback as useCallback6, useEffect as useEffect11, useState as useState30 } from "react";
|
|
25505
25893
|
function useReviewPreview({
|
|
25506
25894
|
components,
|
|
25507
25895
|
loading,
|
|
@@ -25516,8 +25904,8 @@ function useReviewPreview({
|
|
|
25516
25904
|
allowDeletions,
|
|
25517
25905
|
onResult
|
|
25518
25906
|
}) {
|
|
25519
|
-
const [previewAnnotations, setPreviewAnnotations] =
|
|
25520
|
-
const [removedComponents, setRemovedComponents] =
|
|
25907
|
+
const [previewAnnotations, setPreviewAnnotations] = useState30(/* @__PURE__ */ new Map());
|
|
25908
|
+
const [removedComponents, setRemovedComponents] = useState30([]);
|
|
25521
25909
|
const handleResult = useCallback6(
|
|
25522
25910
|
(response) => {
|
|
25523
25911
|
if (!response) return;
|
|
@@ -25544,7 +25932,7 @@ function useReviewPreview({
|
|
|
25544
25932
|
deleteAllComponents,
|
|
25545
25933
|
allowDeletions
|
|
25546
25934
|
});
|
|
25547
|
-
const [spinnerTick, setSpinnerTick] =
|
|
25935
|
+
const [spinnerTick, setSpinnerTick] = useState30(0);
|
|
25548
25936
|
useEffect11(() => {
|
|
25549
25937
|
if (livePreviewHook.status !== "running") return;
|
|
25550
25938
|
const id = setInterval(() => setSpinnerTick((tick) => tick + 1), 80);
|
|
@@ -25570,8 +25958,8 @@ var init_useReviewPreview = __esm({
|
|
|
25570
25958
|
});
|
|
25571
25959
|
|
|
25572
25960
|
// packages/experience-design-system-cli/src/import/tui/components/LivePreviewSummary.tsx
|
|
25573
|
-
import { Box as
|
|
25574
|
-
import { jsx as
|
|
25961
|
+
import { Box as Box53, Text as Text57 } from "ink";
|
|
25962
|
+
import { jsx as jsx61, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
25575
25963
|
function LivePreviewSummary({
|
|
25576
25964
|
enabled,
|
|
25577
25965
|
previewAnnotations,
|
|
@@ -25585,19 +25973,19 @@ function LivePreviewSummary({
|
|
|
25585
25973
|
const counts = { new: 0, changed: 0, removed: 0, breaking: 0 };
|
|
25586
25974
|
for (const annotation of previewAnnotations.values()) counts[annotation] += 1;
|
|
25587
25975
|
const hasCounts = counts.new + counts.changed + counts.removed + counts.breaking > 0;
|
|
25588
|
-
if (disabled) return /* @__PURE__ */
|
|
25589
|
-
if (status === "running" && !hasCounts) return /* @__PURE__ */
|
|
25976
|
+
if (disabled) return /* @__PURE__ */ jsx61(Text57, { dimColor: true, children: "Preview: disabled (creds rejected)" });
|
|
25977
|
+
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx61(Text57, { dimColor: true, children: `Preview: ${spinner} running...` });
|
|
25590
25978
|
if (!hasCounts) return null;
|
|
25591
|
-
return /* @__PURE__ */
|
|
25592
|
-
/* @__PURE__ */
|
|
25593
|
-
/* @__PURE__ */
|
|
25594
|
-
/* @__PURE__ */
|
|
25595
|
-
/* @__PURE__ */
|
|
25596
|
-
/* @__PURE__ */
|
|
25597
|
-
/* @__PURE__ */
|
|
25598
|
-
showRemovedListHint && removedCount > 0 && /* @__PURE__ */
|
|
25599
|
-
/* @__PURE__ */
|
|
25600
|
-
/* @__PURE__ */
|
|
25979
|
+
return /* @__PURE__ */ jsxs54(Box53, { children: [
|
|
25980
|
+
/* @__PURE__ */ jsx61(Text57, { children: "Preview: " }),
|
|
25981
|
+
/* @__PURE__ */ jsx61(Text57, { color: PALETTE.success, children: `${counts.new} new` }),
|
|
25982
|
+
/* @__PURE__ */ jsx61(Text57, { children: " \xB7 " }),
|
|
25983
|
+
/* @__PURE__ */ jsx61(Text57, { color: PALETTE.warning, children: `${counts.changed} changed` }),
|
|
25984
|
+
/* @__PURE__ */ jsx61(Text57, { children: " \xB7 " }),
|
|
25985
|
+
/* @__PURE__ */ jsx61(Text57, { dimColor: true, children: `${counts.removed} removed` }),
|
|
25986
|
+
showRemovedListHint && removedCount > 0 && /* @__PURE__ */ jsx61(Text57, { dimColor: true, children: " ([d] removed list)" }),
|
|
25987
|
+
/* @__PURE__ */ jsx61(Text57, { children: " \xB7 " }),
|
|
25988
|
+
/* @__PURE__ */ jsx61(Text57, { color: PALETTE.error, bold: true, children: `${counts.breaking} breaking` })
|
|
25601
25989
|
] });
|
|
25602
25990
|
}
|
|
25603
25991
|
var init_LivePreviewSummary = __esm({
|
|
@@ -25608,9 +25996,9 @@ var init_LivePreviewSummary = __esm({
|
|
|
25608
25996
|
});
|
|
25609
25997
|
|
|
25610
25998
|
// packages/experience-design-system-cli/src/import/tui/steps/GenerateReviewStep.tsx
|
|
25611
|
-
import { useCallback as useCallback7, useEffect as useEffect12, useMemo as
|
|
25612
|
-
import { Box as
|
|
25613
|
-
import { Fragment as Fragment18, jsx as
|
|
25999
|
+
import { useCallback as useCallback7, useEffect as useEffect12, useMemo as useMemo7, useRef as useRef9, useState as useState31 } from "react";
|
|
26000
|
+
import { Box as Box54, Text as Text58, useStdout as useStdout6 } from "ink";
|
|
26001
|
+
import { Fragment as Fragment18, jsx as jsx62, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
25614
26002
|
function sortComponentsForSidebar2(components, cycleParticipants) {
|
|
25615
26003
|
const isEmpty2 = (entry) => Object.keys(entry.$properties ?? {}).length === 0 && Object.keys(entry.$slots ?? {}).length === 0;
|
|
25616
26004
|
const tier = (c2) => {
|
|
@@ -25651,10 +26039,10 @@ function CyclePathLine({
|
|
|
25651
26039
|
highlightComponents = false,
|
|
25652
26040
|
highlightLine = false
|
|
25653
26041
|
}) {
|
|
25654
|
-
return /* @__PURE__ */
|
|
26042
|
+
return /* @__PURE__ */ jsxs55(Text58, { color: highlightLine ? PALETTE.warning : void 0, children: [
|
|
25655
26043
|
prefix,
|
|
25656
26044
|
segments.map(
|
|
25657
|
-
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */
|
|
26045
|
+
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx62(Text58, { color: PALETTE.info, children: segment.text }, index) : segment.kind === "arrow" ? /* @__PURE__ */ jsx62(Text58, { dimColor: true, children: segment.text }, index) : /* @__PURE__ */ jsx62(Text58, { color: highlightComponents ? PALETTE.warning : void 0, children: segment.text }, index)
|
|
25658
26046
|
)
|
|
25659
26047
|
] });
|
|
25660
26048
|
}
|
|
@@ -25713,9 +26101,9 @@ function GenerateReviewStep({
|
|
|
25713
26101
|
initialFinalizeError = null,
|
|
25714
26102
|
allowDeletions = false
|
|
25715
26103
|
}) {
|
|
25716
|
-
const { stdout } =
|
|
26104
|
+
const { stdout } = useStdout6();
|
|
25717
26105
|
const terminalWidth = stdout?.columns ?? 80;
|
|
25718
|
-
const [slotCycles, setSlotCycles] =
|
|
26106
|
+
const [slotCycles, setSlotCycles] = useState31([]);
|
|
25719
26107
|
const setLoadedSlotCycles = useCallback7((cycles) => {
|
|
25720
26108
|
setSlotCycles(cycles ?? []);
|
|
25721
26109
|
}, []);
|
|
@@ -25747,7 +26135,7 @@ function GenerateReviewStep({
|
|
|
25747
26135
|
tokensPath,
|
|
25748
26136
|
onExtraLoaded: setLoadedSlotCycles
|
|
25749
26137
|
});
|
|
25750
|
-
const [nav, setNav] =
|
|
26138
|
+
const [nav, setNav] = useState31({
|
|
25751
26139
|
cursorRowIdx: 0,
|
|
25752
26140
|
sidebarScrollOffset: 0
|
|
25753
26141
|
});
|
|
@@ -25763,10 +26151,10 @@ function GenerateReviewStep({
|
|
|
25763
26151
|
finalizeError,
|
|
25764
26152
|
setFinalizeError
|
|
25765
26153
|
} = reviewSurface;
|
|
25766
|
-
const [removedBannerCollapsed, setRemovedBannerCollapsed] =
|
|
26154
|
+
const [removedBannerCollapsed, setRemovedBannerCollapsed] = useState31(false);
|
|
25767
26155
|
const removedBannerDefaultedRef = useRef9(false);
|
|
25768
|
-
const [cyclePanelScroll, setCyclePanelScroll] =
|
|
25769
|
-
const [cyclesCursor, setCyclesCursor] =
|
|
26156
|
+
const [cyclePanelScroll, setCyclePanelScroll] = useState31(0);
|
|
26157
|
+
const [cyclesCursor, setCyclesCursor] = useState31(0);
|
|
25770
26158
|
const cyclePanel = useOverlayPanel({
|
|
25771
26159
|
toggleKey: "c",
|
|
25772
26160
|
onClose: () => {
|
|
@@ -25781,9 +26169,9 @@ function GenerateReviewStep({
|
|
|
25781
26169
|
setBreakConfirm(false);
|
|
25782
26170
|
}
|
|
25783
26171
|
});
|
|
25784
|
-
const [breakCursor, setBreakCursor] =
|
|
25785
|
-
const [breakConfirm, setBreakConfirm] =
|
|
25786
|
-
const [expandedGroups, setExpandedGroups] =
|
|
26172
|
+
const [breakCursor, setBreakCursor] = useState31(0);
|
|
26173
|
+
const [breakConfirm, setBreakConfirm] = useState31(false);
|
|
26174
|
+
const [expandedGroups, setExpandedGroups] = useState31(/* @__PURE__ */ new Set());
|
|
25787
26175
|
const seededGroupsRef = useRef9(false);
|
|
25788
26176
|
const {
|
|
25789
26177
|
searchOpen,
|
|
@@ -25802,20 +26190,20 @@ function GenerateReviewStep({
|
|
|
25802
26190
|
setShowHelp
|
|
25803
26191
|
} = useSidebarSearchState();
|
|
25804
26192
|
const lineagePanel = useOverlayPanel({ toggleKey: "l" });
|
|
25805
|
-
const [lineageCursor, setLineageCursor] =
|
|
26193
|
+
const [lineageCursor, setLineageCursor] = useState31(0);
|
|
25806
26194
|
const breakingPanel = useOverlayPanel({ toggleKey: "b", onClose: () => setBreakingDetailOpen(false) });
|
|
25807
|
-
const [breakingChanges, setBreakingChanges] =
|
|
25808
|
-
const [breakingCursor, setBreakingCursor] =
|
|
25809
|
-
const [breakingDetailOpen, setBreakingDetailOpen] =
|
|
25810
|
-
const [pendingEditorFocus, setPendingEditorFocus] =
|
|
25811
|
-
const [autoRejected, setAutoRejected] =
|
|
25812
|
-
const [undoSnapshot, setUndoSnapshot] =
|
|
26195
|
+
const [breakingChanges, setBreakingChanges] = useState31([]);
|
|
26196
|
+
const [breakingCursor, setBreakingCursor] = useState31(0);
|
|
26197
|
+
const [breakingDetailOpen, setBreakingDetailOpen] = useState31(false);
|
|
26198
|
+
const [pendingEditorFocus, setPendingEditorFocus] = useState31(null);
|
|
26199
|
+
const [autoRejected, setAutoRejected] = useState31([]);
|
|
26200
|
+
const [undoSnapshot, setUndoSnapshot] = useState31(null);
|
|
25813
26201
|
const autoRejectFiredRef = useRef9(false);
|
|
25814
|
-
const [editorDirty, setEditorDirty] =
|
|
25815
|
-
const [showUnsavedWarning, setShowUnsavedWarning] =
|
|
25816
|
-
const [pendingFocusAway, setPendingFocusAway] =
|
|
25817
|
-
const [discardTrigger, setDiscardTrigger] =
|
|
25818
|
-
const [showReloadDialog, setShowReloadDialog] =
|
|
26202
|
+
const [editorDirty, setEditorDirty] = useState31(false);
|
|
26203
|
+
const [showUnsavedWarning, setShowUnsavedWarning] = useState31(false);
|
|
26204
|
+
const [pendingFocusAway, setPendingFocusAway] = useState31(null);
|
|
26205
|
+
const [discardTrigger, setDiscardTrigger] = useState31(0);
|
|
26206
|
+
const [showReloadDialog, setShowReloadDialog] = useState31(false);
|
|
25819
26207
|
const acceptedCountForPreview = components.filter((c2) => c2.status === "accepted").length;
|
|
25820
26208
|
const { previewAnnotations, removedComponents, livePreviewHook, livePreviewSpinner } = useReviewPreview({
|
|
25821
26209
|
components,
|
|
@@ -25876,12 +26264,12 @@ function GenerateReviewStep({
|
|
|
25876
26264
|
} catch {
|
|
25877
26265
|
}
|
|
25878
26266
|
};
|
|
25879
|
-
const componentGraph =
|
|
25880
|
-
const sidebarGraph =
|
|
26267
|
+
const componentGraph = useMemo7(() => buildComponentGraph(components), [components]);
|
|
26268
|
+
const sidebarGraph = useMemo7(
|
|
25881
26269
|
() => buildComponentGraph(components, { stripRejectedEdges: true }),
|
|
25882
26270
|
[components]
|
|
25883
26271
|
);
|
|
25884
|
-
const closures =
|
|
26272
|
+
const closures = useMemo7(() => computeAllClosures(componentGraph), [componentGraph]);
|
|
25885
26273
|
useEffect12(() => {
|
|
25886
26274
|
if (seededGroupsRef.current) return;
|
|
25887
26275
|
if (closures.size === 0 && slotCycles.length === 0) return;
|
|
@@ -25893,14 +26281,14 @@ function GenerateReviewStep({
|
|
|
25893
26281
|
)
|
|
25894
26282
|
);
|
|
25895
26283
|
}, [closures, slotCycles]);
|
|
25896
|
-
const directIssues =
|
|
26284
|
+
const directIssues = useMemo7(() => {
|
|
25897
26285
|
const m = /* @__PURE__ */ new Map();
|
|
25898
26286
|
for (const c2 of components) {
|
|
25899
26287
|
if (c2.status === "rejected") m.set(c2.key, "error");
|
|
25900
26288
|
}
|
|
25901
26289
|
return m;
|
|
25902
26290
|
}, [components]);
|
|
25903
|
-
const cycleView =
|
|
26291
|
+
const cycleView = useMemo7(() => computeCycleView(components), [components]);
|
|
25904
26292
|
useEffect12(() => {
|
|
25905
26293
|
const decision = computeAutoRejectDecision({
|
|
25906
26294
|
loading,
|
|
@@ -25971,7 +26359,7 @@ function GenerateReviewStep({
|
|
|
25971
26359
|
reviewEditor.setSaveError(null);
|
|
25972
26360
|
setFinalizeError(null);
|
|
25973
26361
|
};
|
|
25974
|
-
const groupedItemsMemo =
|
|
26362
|
+
const groupedItemsMemo = useMemo7(
|
|
25975
26363
|
() => components.map((c2) => ({
|
|
25976
26364
|
key: c2.key,
|
|
25977
26365
|
entry: c2.entry,
|
|
@@ -25979,12 +26367,12 @@ function GenerateReviewStep({
|
|
|
25979
26367
|
})),
|
|
25980
26368
|
[components, directIssues]
|
|
25981
26369
|
);
|
|
25982
|
-
const brokenKeys =
|
|
26370
|
+
const brokenKeys = useMemo7(
|
|
25983
26371
|
() => new Set(breakingChanges.map((b) => b.componentName)),
|
|
25984
26372
|
[breakingChanges]
|
|
25985
26373
|
);
|
|
25986
|
-
const breakingRows =
|
|
25987
|
-
const filterVisibleKeys =
|
|
26374
|
+
const breakingRows = useMemo7(() => buildBreakingRows(breakingChanges), [breakingChanges]);
|
|
26375
|
+
const filterVisibleKeys = useMemo7(() => {
|
|
25988
26376
|
if (jumpFilterTarget) {
|
|
25989
26377
|
return findAllAncestors2(jumpFilterTarget, sidebarGraph);
|
|
25990
26378
|
}
|
|
@@ -26000,7 +26388,7 @@ function GenerateReviewStep({
|
|
|
26000
26388
|
})();
|
|
26001
26389
|
return intersectFilterKeys(categoryKeys, searchKeys);
|
|
26002
26390
|
}, [jumpFilterTarget, activeFilters, cycleView, brokenKeys, searchQuery, groupedItemsMemo, sidebarGraph]);
|
|
26003
|
-
const visibleRowsMemo =
|
|
26391
|
+
const visibleRowsMemo = useMemo7(
|
|
26004
26392
|
() => buildVisibleRows({
|
|
26005
26393
|
items: groupedItemsMemo,
|
|
26006
26394
|
cycleParticipants: cycleView.structural,
|
|
@@ -26011,7 +26399,7 @@ function GenerateReviewStep({
|
|
|
26011
26399
|
}),
|
|
26012
26400
|
[groupedItemsMemo, cycleView, expandedGroups, columnOneView, sidebarGraph, filterVisibleKeys]
|
|
26013
26401
|
);
|
|
26014
|
-
const selectableRowPositions =
|
|
26402
|
+
const selectableRowPositions = useMemo7(() => {
|
|
26015
26403
|
const out = [];
|
|
26016
26404
|
for (let i = 0; i < visibleRowsMemo.length; i++) {
|
|
26017
26405
|
if (visibleRowsMemo[i].itemIdx >= 0) out.push(i);
|
|
@@ -26057,7 +26445,7 @@ function GenerateReviewStep({
|
|
|
26057
26445
|
selectedIdx,
|
|
26058
26446
|
extractSessionId
|
|
26059
26447
|
});
|
|
26060
|
-
const renderStatusByKey =
|
|
26448
|
+
const renderStatusByKey = useMemo7(() => {
|
|
26061
26449
|
const merged = /* @__PURE__ */ new Map();
|
|
26062
26450
|
for (const closure of closures.values()) {
|
|
26063
26451
|
const per = computeRenderStatuses(closure, directIssues);
|
|
@@ -26070,7 +26458,7 @@ function GenerateReviewStep({
|
|
|
26070
26458
|
}
|
|
26071
26459
|
return merged;
|
|
26072
26460
|
}, [closures, directIssues]);
|
|
26073
|
-
const selectionStateByKey =
|
|
26461
|
+
const selectionStateByKey = useMemo7(() => {
|
|
26074
26462
|
const map = /* @__PURE__ */ new Map();
|
|
26075
26463
|
for (const c2 of components) {
|
|
26076
26464
|
if (c2.status === "accepted") map.set(c2.key, "accepted");
|
|
@@ -26079,7 +26467,7 @@ function GenerateReviewStep({
|
|
|
26079
26467
|
}
|
|
26080
26468
|
return map;
|
|
26081
26469
|
}, [components]);
|
|
26082
|
-
const searchMatches =
|
|
26470
|
+
const searchMatches = useMemo7(() => {
|
|
26083
26471
|
if (!searchQuery) return [];
|
|
26084
26472
|
const out = [];
|
|
26085
26473
|
for (const pos of selectableRowPositions) {
|
|
@@ -26089,7 +26477,7 @@ function GenerateReviewStep({
|
|
|
26089
26477
|
}
|
|
26090
26478
|
return out;
|
|
26091
26479
|
}, [searchQuery, selectableRowPositions, visibleRowsMemo, components]);
|
|
26092
|
-
const searchMatchCount =
|
|
26480
|
+
const searchMatchCount = useMemo7(() => {
|
|
26093
26481
|
if (searchMatches.length === 0) return 0;
|
|
26094
26482
|
const seen = /* @__PURE__ */ new Set();
|
|
26095
26483
|
for (const pos of searchMatches) {
|
|
@@ -26098,7 +26486,7 @@ function GenerateReviewStep({
|
|
|
26098
26486
|
}
|
|
26099
26487
|
return seen.size;
|
|
26100
26488
|
}, [searchMatches, visibleRowsMemo]);
|
|
26101
|
-
const dimPredicate =
|
|
26489
|
+
const dimPredicate = useMemo7(
|
|
26102
26490
|
() => buildFlatDimPredicate({
|
|
26103
26491
|
viewMode: columnOneView,
|
|
26104
26492
|
searchQuery,
|
|
@@ -26129,7 +26517,7 @@ function GenerateReviewStep({
|
|
|
26129
26517
|
}
|
|
26130
26518
|
}
|
|
26131
26519
|
};
|
|
26132
|
-
const breakEdges =
|
|
26520
|
+
const breakEdges = useMemo7(() => {
|
|
26133
26521
|
const cycle = slotCycles[cyclesCursor];
|
|
26134
26522
|
if (!cycle) return [];
|
|
26135
26523
|
return enumerateCycleBreaks(cycle, components);
|
|
@@ -26571,30 +26959,30 @@ function GenerateReviewStep({
|
|
|
26571
26959
|
}
|
|
26572
26960
|
});
|
|
26573
26961
|
if (loading) {
|
|
26574
|
-
return /* @__PURE__ */
|
|
26962
|
+
return /* @__PURE__ */ jsx62(ReviewLoadingState, {});
|
|
26575
26963
|
}
|
|
26576
26964
|
if (loadError) {
|
|
26577
|
-
return /* @__PURE__ */
|
|
26965
|
+
return /* @__PURE__ */ jsx62(ReviewLoadError, { message: loadError });
|
|
26578
26966
|
}
|
|
26579
26967
|
if (showHelp) {
|
|
26580
|
-
return /* @__PURE__ */
|
|
26968
|
+
return /* @__PURE__ */ jsx62(HelpOverlay, { sections: HELP_SECTIONS2, onClose: () => setShowHelp(false) });
|
|
26581
26969
|
}
|
|
26582
26970
|
const renderBreakOverlay = (width) => {
|
|
26583
26971
|
const highlightedCycle = slotCycles[cyclesCursor];
|
|
26584
|
-
return /* @__PURE__ */
|
|
26585
|
-
/* @__PURE__ */
|
|
26586
|
-
highlightedCycle && /* @__PURE__ */
|
|
26587
|
-
/* @__PURE__ */
|
|
26588
|
-
/* @__PURE__ */
|
|
26589
|
-
breakEdges.length > 0 && /* @__PURE__ */
|
|
26972
|
+
return /* @__PURE__ */ jsxs55(Box54, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, width, children: [
|
|
26973
|
+
/* @__PURE__ */ jsx62(Text58, { bold: true, color: PALETTE.warning, children: `BREAK CYCLE ${cyclesCursor + 1} \u2014 remove a slot edge or reject a member` }),
|
|
26974
|
+
highlightedCycle && /* @__PURE__ */ jsx62(CyclePathLine, { segments: formatCyclePathSegments(highlightedCycle), prefix: " ", highlightComponents: true }),
|
|
26975
|
+
/* @__PURE__ */ jsx62(Text58, { dimColor: true, children: highlightedCycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
|
|
26976
|
+
/* @__PURE__ */ jsx62(Text58, { children: " " }),
|
|
26977
|
+
breakEdges.length > 0 && /* @__PURE__ */ jsx62(Text58, { dimColor: true, children: "remove slot edge:" }),
|
|
26590
26978
|
breakEdges.map((edge, idx) => {
|
|
26591
26979
|
const isCursor = idx === breakCursor;
|
|
26592
|
-
return /* @__PURE__ */
|
|
26980
|
+
return /* @__PURE__ */ jsx62(Text58, { inverse: isCursor, children: `${isCursor ? "\u25B6" : " "} remove '${edge.toComponent}' from ${edge.fromComponent}.$slots.${edge.slotName}.$allowedComponents` }, `break-${idx}`);
|
|
26593
26981
|
}),
|
|
26594
|
-
breakConfirm ? /* @__PURE__ */
|
|
26595
|
-
/* @__PURE__ */
|
|
26596
|
-
/* @__PURE__ */
|
|
26597
|
-
] }) : /* @__PURE__ */
|
|
26982
|
+
breakConfirm ? /* @__PURE__ */ jsxs55(Fragment18, { children: [
|
|
26983
|
+
/* @__PURE__ */ jsx62(Text58, { children: " " }),
|
|
26984
|
+
/* @__PURE__ */ jsx62(Text58, { bold: true, color: PALETTE.warning, children: "Delete this slot edge? [y] confirm [n] cancel" })
|
|
26985
|
+
] }) : /* @__PURE__ */ jsx62(Text58, { dimColor: true, children: "[\u2191\u2193/j/k] move [Enter] delete [x/Esc] close" })
|
|
26598
26986
|
] });
|
|
26599
26987
|
};
|
|
26600
26988
|
const breakOverlayFullScreen = breakPanel.isOpen && shouldBreakOverlayGoFullScreen({
|
|
@@ -26638,8 +27026,8 @@ function GenerateReviewStep({
|
|
|
26638
27026
|
for (const c2 of closures.values()) if (c2.nodes.length > 1) return true;
|
|
26639
27027
|
return false;
|
|
26640
27028
|
})();
|
|
26641
|
-
return /* @__PURE__ */
|
|
26642
|
-
/* @__PURE__ */
|
|
27029
|
+
return /* @__PURE__ */ jsxs55(Box54, { flexDirection: "column", children: [
|
|
27030
|
+
/* @__PURE__ */ jsx62(
|
|
26643
27031
|
ReviewStepDialogs,
|
|
26644
27032
|
{
|
|
26645
27033
|
surfaceState: reviewSurface,
|
|
@@ -26649,24 +27037,24 @@ function GenerateReviewStep({
|
|
|
26649
27037
|
onQuit
|
|
26650
27038
|
}
|
|
26651
27039
|
),
|
|
26652
|
-
showUnsavedWarning && !dialogOpen && /* @__PURE__ */
|
|
26653
|
-
/* @__PURE__ */
|
|
26654
|
-
/* @__PURE__ */
|
|
26655
|
-
/* @__PURE__ */
|
|
26656
|
-
/* @__PURE__ */
|
|
26657
|
-
/* @__PURE__ */
|
|
26658
|
-
/* @__PURE__ */
|
|
27040
|
+
showUnsavedWarning && !dialogOpen && /* @__PURE__ */ jsxs55(Box54, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
27041
|
+
/* @__PURE__ */ jsx62(Text58, { bold: true, color: PALETTE.warning, children: "Unsaved changes" }),
|
|
27042
|
+
/* @__PURE__ */ jsx62(Text58, { children: "You have unsaved edits in the current field editor." }),
|
|
27043
|
+
/* @__PURE__ */ jsx62(Text58, { children: " " }),
|
|
27044
|
+
/* @__PURE__ */ jsx62(Text58, { children: " [Enter] Save and continue" }),
|
|
27045
|
+
/* @__PURE__ */ jsx62(Text58, { children: " [Esc] Discard changes and continue" }),
|
|
27046
|
+
/* @__PURE__ */ jsx62(Text58, { children: " [Tab] Stay in the panel" })
|
|
26659
27047
|
] }),
|
|
26660
|
-
/* @__PURE__ */
|
|
26661
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */
|
|
26662
|
-
/* @__PURE__ */
|
|
26663
|
-
!removedBannerCollapsed && /* @__PURE__ */
|
|
26664
|
-
/* @__PURE__ */
|
|
26665
|
-
removedComponents.map((rc) => /* @__PURE__ */
|
|
27048
|
+
/* @__PURE__ */ jsx62(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
27049
|
+
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs55(Box54, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
27050
|
+
/* @__PURE__ */ jsx62(Text58, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
|
|
27051
|
+
!removedBannerCollapsed && /* @__PURE__ */ jsxs55(Fragment18, { children: [
|
|
27052
|
+
/* @__PURE__ */ jsx62(Text58, { children: " " }),
|
|
27053
|
+
removedComponents.map((rc) => /* @__PURE__ */ jsx62(Text58, { children: removedComponentLine(rc) }, rc.id))
|
|
26666
27054
|
] })
|
|
26667
27055
|
] }),
|
|
26668
|
-
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */
|
|
26669
|
-
|
|
27056
|
+
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx62(Box54, { paddingX: 1, children: /* @__PURE__ */ jsx62(
|
|
27057
|
+
Text58,
|
|
26670
27058
|
{
|
|
26671
27059
|
color: PALETTE.warning,
|
|
26672
27060
|
children: `[b] ${breakingChanges.length} breaking change${breakingChanges.length === 1 ? "" : "s"}`
|
|
@@ -26676,32 +27064,32 @@ function GenerateReviewStep({
|
|
|
26676
27064
|
const row = breakingRows[breakingCursor];
|
|
26677
27065
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
26678
27066
|
if (!comp) return null;
|
|
26679
|
-
return /* @__PURE__ */
|
|
26680
|
-
/* @__PURE__ */
|
|
26681
|
-
comp.impact && /* @__PURE__ */
|
|
26682
|
-
comp.changes.length === 0 ? /* @__PURE__ */
|
|
26683
|
-
/* @__PURE__ */
|
|
27067
|
+
return /* @__PURE__ */ jsxs55(Box54, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
27068
|
+
/* @__PURE__ */ jsx62(Text58, { bold: true, color: PALETTE.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
|
|
27069
|
+
comp.impact && /* @__PURE__ */ jsx62(Text58, { dimColor: true, children: ` affects ${comp.impact.affectedExperiences} experience${comp.impact.affectedExperiences === 1 ? "" : "s"}, ${comp.impact.affectedFragments} fragment${comp.impact.affectedFragments === 1 ? "" : "s"}` }),
|
|
27070
|
+
comp.changes.length === 0 ? /* @__PURE__ */ jsx62(Text58, { dimColor: true, children: " (no enumerated changes)" }) : comp.changes.map((change, ci) => /* @__PURE__ */ jsx62(Text58, { children: ` \u2022 ${formatBreakingChange(change, comp.current)}` }, `bd-detail-${ci}`)),
|
|
27071
|
+
/* @__PURE__ */ jsx62(Text58, { dimColor: true, children: "[D/Esc] close detail" })
|
|
26684
27072
|
] });
|
|
26685
27073
|
})(),
|
|
26686
27074
|
cyclePanel.isOpen && !dialogOpen && (() => {
|
|
26687
27075
|
const PANEL_H = 20;
|
|
26688
27076
|
const lines = [];
|
|
26689
27077
|
lines.push(
|
|
26690
|
-
/* @__PURE__ */
|
|
27078
|
+
/* @__PURE__ */ jsx62(Text58, { bold: true, color: PALETTE.warning, children: `SLOT DEPENDENCY CYCLES (${slotCycles.length})` }, "cyc-title")
|
|
26691
27079
|
);
|
|
26692
27080
|
lines.push(
|
|
26693
|
-
/* @__PURE__ */
|
|
27081
|
+
/* @__PURE__ */ jsx62(Text58, { dimColor: true, children: "push will fail until these are resolved" }, "cyc-sub")
|
|
26694
27082
|
);
|
|
26695
27083
|
lines.push(
|
|
26696
|
-
/* @__PURE__ */
|
|
27084
|
+
/* @__PURE__ */ jsx62(Text58, { dimColor: true, children: "To fix: reject a cycle member, or break the cycle by removing a slot edge." }, "cyc-guide")
|
|
26697
27085
|
);
|
|
26698
|
-
lines.push(/* @__PURE__ */
|
|
27086
|
+
lines.push(/* @__PURE__ */ jsx62(Text58, { children: " " }, "cyc-space"));
|
|
26699
27087
|
slotCycles.forEach((cycle, idx) => {
|
|
26700
27088
|
const nodeCount = new Set(cycle.path).size;
|
|
26701
27089
|
const isCursor = idx === cyclesCursor;
|
|
26702
27090
|
lines.push(
|
|
26703
|
-
/* @__PURE__ */
|
|
26704
|
-
|
|
27091
|
+
/* @__PURE__ */ jsx62(
|
|
27092
|
+
Text58,
|
|
26705
27093
|
{
|
|
26706
27094
|
bold: true,
|
|
26707
27095
|
inverse: isCursor,
|
|
@@ -26711,23 +27099,23 @@ function GenerateReviewStep({
|
|
|
26711
27099
|
)
|
|
26712
27100
|
);
|
|
26713
27101
|
lines.push(
|
|
26714
|
-
/* @__PURE__ */
|
|
27102
|
+
/* @__PURE__ */ jsx62(CyclePathLine, { segments: formatCyclePathSegments(cycle, 16), prefix: " " }, `cyc-p-${idx}`)
|
|
26715
27103
|
);
|
|
26716
27104
|
if (cycle.suggestedBreak) {
|
|
26717
27105
|
const b = cycle.suggestedBreak;
|
|
26718
27106
|
lines.push(
|
|
26719
|
-
/* @__PURE__ */
|
|
27107
|
+
/* @__PURE__ */ jsx62(Text58, { dimColor: true, children: ` Suggested fix: remove '${b.toComponent}' from ${b.fromComponent}.$slots.${b.slotName}.$allowedComponents` }, `cyc-f-${idx}`)
|
|
26720
27108
|
);
|
|
26721
27109
|
}
|
|
26722
|
-
lines.push(/* @__PURE__ */
|
|
27110
|
+
lines.push(/* @__PURE__ */ jsx62(Text58, { children: " " }, `cyc-s-${idx}`));
|
|
26723
27111
|
});
|
|
26724
27112
|
const visible = lines.slice(cyclePanelScroll, cyclePanelScroll + PANEL_H);
|
|
26725
|
-
return /* @__PURE__ */
|
|
27113
|
+
return /* @__PURE__ */ jsxs55(Box54, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
26726
27114
|
visible,
|
|
26727
|
-
/* @__PURE__ */
|
|
27115
|
+
/* @__PURE__ */ jsx62(Text58, { dimColor: true, children: "[\u2191\u2193/j/k] move [Enter] jump [x] break cycle [c/q/Esc] close" })
|
|
26728
27116
|
] });
|
|
26729
27117
|
})(),
|
|
26730
|
-
!dialogOpen && /* @__PURE__ */
|
|
27118
|
+
!dialogOpen && /* @__PURE__ */ jsx62(
|
|
26731
27119
|
LivePreviewSummary,
|
|
26732
27120
|
{
|
|
26733
27121
|
enabled: livePreview,
|
|
@@ -26746,17 +27134,17 @@ function GenerateReviewStep({
|
|
|
26746
27134
|
const participantSet = cycleView.structural;
|
|
26747
27135
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
26748
27136
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
26749
|
-
return /* @__PURE__ */
|
|
26750
|
-
/* @__PURE__ */
|
|
26751
|
-
members.length > 0 && /* @__PURE__ */
|
|
26752
|
-
ancestors.length > 0 && /* @__PURE__ */
|
|
26753
|
-
/* @__PURE__ */
|
|
27137
|
+
return /* @__PURE__ */ jsxs55(Box54, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
27138
|
+
/* @__PURE__ */ jsx62(Text58, { color: PALETTE.error, bold: true, children: `Cyclic manifest \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
|
|
27139
|
+
members.length > 0 && /* @__PURE__ */ jsx62(Text58, { color: PALETTE.error, children: ` Cycle members: ${members.join(", ")}` }),
|
|
27140
|
+
ancestors.length > 0 && /* @__PURE__ */ jsx62(Text58, { color: PALETTE.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
|
|
27141
|
+
/* @__PURE__ */ jsx62(Text58, { dimColor: true, children: undoSnapshot ? " [Ctrl+Z] undo \xB7 [r]/[a] manually toggle \xB7 [F] continue" : " [r]/[a] manually toggle \xB7 [F] continue" })
|
|
26754
27142
|
] });
|
|
26755
27143
|
})(),
|
|
26756
|
-
/* @__PURE__ */
|
|
26757
|
-
/* @__PURE__ */
|
|
26758
|
-
!dialogOpen && /* @__PURE__ */
|
|
26759
|
-
breakingPanel.isOpen ? /* @__PURE__ */
|
|
27144
|
+
/* @__PURE__ */ jsx62(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
|
|
27145
|
+
/* @__PURE__ */ jsx62(ReviewFinalizeError, { message: finalizeError, hidden: dialogOpen }),
|
|
27146
|
+
!dialogOpen && /* @__PURE__ */ jsxs55(Box54, { children: [
|
|
27147
|
+
breakingPanel.isOpen ? /* @__PURE__ */ jsx62(
|
|
26760
27148
|
GotoBanner,
|
|
26761
27149
|
{
|
|
26762
27150
|
title: "Breaking changes",
|
|
@@ -26769,7 +27157,7 @@ function GenerateReviewStep({
|
|
|
26769
27157
|
width: sidebarWidth,
|
|
26770
27158
|
footerHint: "[\u2191/\u2193] move \xB7 [Enter] jump \xB7 [D] detail \xB7 [Esc] close"
|
|
26771
27159
|
}
|
|
26772
|
-
) : lineagePanel.isOpen && focusedComponentKey ? /* @__PURE__ */
|
|
27160
|
+
) : lineagePanel.isOpen && focusedComponentKey ? /* @__PURE__ */ jsx62(
|
|
26773
27161
|
LineagePanel,
|
|
26774
27162
|
{
|
|
26775
27163
|
focusedComponentKey,
|
|
@@ -26779,45 +27167,565 @@ function GenerateReviewStep({
|
|
|
26779
27167
|
maxRows: panelMaxRows,
|
|
26780
27168
|
width: sidebarWidth
|
|
26781
27169
|
}
|
|
26782
|
-
) : /* @__PURE__ */
|
|
27170
|
+
) : /* @__PURE__ */ jsx62(
|
|
26783
27171
|
GroupedSidebar,
|
|
26784
27172
|
{
|
|
26785
|
-
items: groupedItems,
|
|
26786
|
-
cycleParticipants: cycleParticipantSet,
|
|
26787
|
-
selectedIdx,
|
|
26788
|
-
selectedRowIdx: cursorRowIdx,
|
|
26789
|
-
onSelect: (idx) => {
|
|
26790
|
-
for (let i = 0; i < visibleRowsMemo.length; i++) {
|
|
26791
|
-
if (visibleRowsMemo[i].itemIdx === idx) {
|
|
26792
|
-
jumpCursorToRow(i);
|
|
26793
|
-
return;
|
|
26794
|
-
}
|
|
26795
|
-
}
|
|
26796
|
-
reviewEditor.setJsonScrollOffset(0);
|
|
26797
|
-
},
|
|
26798
|
-
expandedGroups,
|
|
26799
|
-
onToggleExpanded: (rootName) => {
|
|
26800
|
-
setExpandedGroups((prev) => {
|
|
26801
|
-
const next = new Set(prev);
|
|
26802
|
-
if (next.has(rootName)) next.delete(rootName);
|
|
26803
|
-
else next.add(rootName);
|
|
26804
|
-
return next;
|
|
26805
|
-
});
|
|
26806
|
-
},
|
|
26807
|
-
width: sidebarWidth,
|
|
27173
|
+
items: groupedItems,
|
|
27174
|
+
cycleParticipants: cycleParticipantSet,
|
|
27175
|
+
selectedIdx,
|
|
27176
|
+
selectedRowIdx: cursorRowIdx,
|
|
27177
|
+
onSelect: (idx) => {
|
|
27178
|
+
for (let i = 0; i < visibleRowsMemo.length; i++) {
|
|
27179
|
+
if (visibleRowsMemo[i].itemIdx === idx) {
|
|
27180
|
+
jumpCursorToRow(i);
|
|
27181
|
+
return;
|
|
27182
|
+
}
|
|
27183
|
+
}
|
|
27184
|
+
reviewEditor.setJsonScrollOffset(0);
|
|
27185
|
+
},
|
|
27186
|
+
expandedGroups,
|
|
27187
|
+
onToggleExpanded: (rootName) => {
|
|
27188
|
+
setExpandedGroups((prev) => {
|
|
27189
|
+
const next = new Set(prev);
|
|
27190
|
+
if (next.has(rootName)) next.delete(rootName);
|
|
27191
|
+
else next.add(rootName);
|
|
27192
|
+
return next;
|
|
27193
|
+
});
|
|
27194
|
+
},
|
|
27195
|
+
width: sidebarWidth,
|
|
27196
|
+
focused: sidebarFocused,
|
|
27197
|
+
renderStatusByKey,
|
|
27198
|
+
previewAnnotationByKey,
|
|
27199
|
+
selectionStateByKey,
|
|
27200
|
+
scrollOffset: sidebarScrollOffset,
|
|
27201
|
+
visibleCount,
|
|
27202
|
+
dimPredicate,
|
|
27203
|
+
visibleRows: visibleRowsMemo,
|
|
27204
|
+
viewMode: columnOneView,
|
|
27205
|
+
graph: sidebarGraph
|
|
27206
|
+
}
|
|
27207
|
+
),
|
|
27208
|
+
selected ? /* @__PURE__ */ jsx62(
|
|
27209
|
+
ReviewComponentPanel,
|
|
27210
|
+
{
|
|
27211
|
+
selectedKey: selected.key,
|
|
27212
|
+
selectedEntry: selected.entry,
|
|
27213
|
+
componentRationale,
|
|
27214
|
+
reviewMetadata,
|
|
27215
|
+
reviewEditor,
|
|
27216
|
+
width: panelWidth,
|
|
27217
|
+
height: PANEL_HEIGHT,
|
|
27218
|
+
jsonValue: visibleJsonPanelValue,
|
|
27219
|
+
sidebarFocused,
|
|
27220
|
+
fieldEditor: buildReviewFieldEditor(reviewEditor, selectedJson, () => setSidebarFocused(true), {
|
|
27221
|
+
key: pendingEditorFocus && pendingEditorFocus.componentName === selected.key ? `${selected.key}::${pendingEditorFocus.target.kind}:${pendingEditorFocus.target.name}` : selected.key,
|
|
27222
|
+
propRationaleKey: "p",
|
|
27223
|
+
componentRationaleKey: "P",
|
|
27224
|
+
projectSlotGraph,
|
|
27225
|
+
currentComponentName: selected.key,
|
|
27226
|
+
onDirtyChange: setEditorDirty,
|
|
27227
|
+
discardTrigger,
|
|
27228
|
+
initialFocusTarget: pendingEditorFocus && pendingEditorFocus.componentName === selected.key ? pendingEditorFocus.target : { kind: "description" }
|
|
27229
|
+
}),
|
|
27230
|
+
saveError: reviewEditor.saveError,
|
|
27231
|
+
sidebarFooter: hasGroupRoots ? " [Space] expand/collapse group [E/C] expand/collapse all" : "",
|
|
27232
|
+
livePreview: livePreviewHook,
|
|
27233
|
+
livePreviewSpinner
|
|
27234
|
+
}
|
|
27235
|
+
) : /* @__PURE__ */ jsx62(ReviewNoSelection, {})
|
|
27236
|
+
] }),
|
|
27237
|
+
breakPanel.isOpen && !breakOverlayFullScreen && !dialogOpen && renderBreakOverlay(),
|
|
27238
|
+
!dialogOpen && slotCycles.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs55(Box54, { flexDirection: "column", children: [
|
|
27239
|
+
/* @__PURE__ */ jsx62(Text58, { color: PALETTE.warning, children: `\u26A0 ${slotCycles.length} slot dependency cycle${slotCycles.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
27240
|
+
slotCycles.slice(0, 3).map((cycle, idx) => {
|
|
27241
|
+
return /* @__PURE__ */ jsx62(
|
|
27242
|
+
CyclePathLine,
|
|
27243
|
+
{
|
|
27244
|
+
segments: formatCyclePathSegments(cycle),
|
|
27245
|
+
prefix: " Cycle: ",
|
|
27246
|
+
highlightComponents: true,
|
|
27247
|
+
highlightLine: true
|
|
27248
|
+
},
|
|
27249
|
+
`cyc-banner-${idx}`
|
|
27250
|
+
);
|
|
27251
|
+
}),
|
|
27252
|
+
slotCycles.length > 3 && /* @__PURE__ */ jsx62(Text58, { color: PALETTE.warning, children: ` \u2026${slotCycles.length - 3} more` }),
|
|
27253
|
+
/* @__PURE__ */ jsx62(Text58, { dimColor: true, children: " press [c] for detail" })
|
|
27254
|
+
] }),
|
|
27255
|
+
/* @__PURE__ */ jsx62(
|
|
27256
|
+
SearchMatchSummary,
|
|
27257
|
+
{
|
|
27258
|
+
open: searchOpen,
|
|
27259
|
+
query: searchQuery,
|
|
27260
|
+
matches: searchMatchCount,
|
|
27261
|
+
total: components.length,
|
|
27262
|
+
autocompleteCandidates,
|
|
27263
|
+
hidden: dialogOpen
|
|
27264
|
+
}
|
|
27265
|
+
),
|
|
27266
|
+
!dialogOpen && sidebarFocused && /* @__PURE__ */ jsx62(Box54, { columnGap: 2, flexWrap: "wrap", children: reviewEditor.panelOpen === "token-review" ? /* @__PURE__ */ jsxs55(Fragment18, { children: [
|
|
27267
|
+
legendEntry("[\u2191/\u2193]", "move"),
|
|
27268
|
+
legendEntry("[Enter]", "edit allowed"),
|
|
27269
|
+
legendEntry("[Esc]", "close")
|
|
27270
|
+
] }) : /* @__PURE__ */ jsxs55(Fragment18, { children: [
|
|
27271
|
+
legendEntry("[j/k]", "move"),
|
|
27272
|
+
legendEntry("[a]", "accept"),
|
|
27273
|
+
legendEntry("[r]", "reject"),
|
|
27274
|
+
legendEntry("[A]", "accept all"),
|
|
27275
|
+
legendEntry("[F]", "finalize"),
|
|
27276
|
+
legendEntry("[L]", "flat", columnOneView === "flat"),
|
|
27277
|
+
legendEntry("[l]", "lineage", lineagePanel.isOpen),
|
|
27278
|
+
legendEntry("[i]", "focus lineage", jumpFilterTarget !== null),
|
|
27279
|
+
legendEntry("[w]", "only breaking", activeFilters.has("broken")),
|
|
27280
|
+
slotCycles.length > 0 && legendEntry("[o]", "only cycles", activeFilters.has("cycles")),
|
|
27281
|
+
slotCycles.length > 0 && legendEntry("[c]", "cycle list", cyclePanel.isOpen),
|
|
27282
|
+
legendEntry("[p]", "prop rationale", reviewEditor.panelOpen === "prop-rationale"),
|
|
27283
|
+
legendEntry("[P]", "component rationale", reviewEditor.panelOpen === "component-rationale"),
|
|
27284
|
+
legendEntry("[s]", "source", reviewEditor.panelOpen === "source"),
|
|
27285
|
+
reviewEditor.currentTokenSuggestions().length > 0 && legendEntry("[t]", "token review"),
|
|
27286
|
+
legendEntry("[J]", reviewEditor.showJson ? "hide JSON" : "show JSON", reviewEditor.showJson),
|
|
27287
|
+
legendEntry(
|
|
27288
|
+
"[H]",
|
|
27289
|
+
reviewEditor.showHiddenProps ? "hide state/unattached" : "show state/unattached",
|
|
27290
|
+
reviewEditor.showHiddenProps
|
|
27291
|
+
),
|
|
27292
|
+
breakingChanges.length > 0 && legendEntry("[b]", "see breaking changes", breakingPanel.isOpen),
|
|
27293
|
+
removedComponents.length > 0 && legendEntry("[d]", removedBannerCollapsed ? "show removed" : "hide removed", !removedBannerCollapsed),
|
|
27294
|
+
legendEntry("[/]", "search", searchOpen || searchQuery.length > 0),
|
|
27295
|
+
legendEntry("[Tab]", "focus panel"),
|
|
27296
|
+
legendEntry("[Ctrl+Z]", "undo"),
|
|
27297
|
+
legendEntry("[Ctrl+Y]", "redo"),
|
|
27298
|
+
legendEntry("[Ctrl+R]", "reload"),
|
|
27299
|
+
legendEntry("[?]", "help"),
|
|
27300
|
+
legendEntry("[q]", "quit")
|
|
27301
|
+
] }) }),
|
|
27302
|
+
!dialogOpen && /* @__PURE__ */ jsx62(
|
|
27303
|
+
ReviewStatusBar,
|
|
27304
|
+
{
|
|
27305
|
+
entries: components,
|
|
27306
|
+
onApproveAll: () => {
|
|
27307
|
+
setComponents((prev) => prev.map((c2) => c2.status === "needs-review" ? { ...c2, status: "accepted" } : c2));
|
|
27308
|
+
},
|
|
27309
|
+
onFinalize: () => setShowFinalize(true)
|
|
27310
|
+
}
|
|
27311
|
+
)
|
|
27312
|
+
] });
|
|
27313
|
+
}
|
|
27314
|
+
var PANEL_HEIGHT, HELP_SECTIONS2;
|
|
27315
|
+
var init_GenerateReviewStep = __esm({
|
|
27316
|
+
"packages/experience-design-system-cli/src/import/tui/steps/GenerateReviewStep.tsx"() {
|
|
27317
|
+
"use strict";
|
|
27318
|
+
init_theme();
|
|
27319
|
+
init_review_json_panel();
|
|
27320
|
+
init_GroupedSidebar();
|
|
27321
|
+
init_composite_closure();
|
|
27322
|
+
init_slot_graph();
|
|
27323
|
+
init_cycle_view();
|
|
27324
|
+
init_issue_inheritance();
|
|
27325
|
+
init_removed_components_text();
|
|
27326
|
+
init_useImmediateInput();
|
|
27327
|
+
init_db();
|
|
27328
|
+
init_cycle_detection();
|
|
27329
|
+
init_cycle_panel_scroll();
|
|
27330
|
+
init_useFinalizePreview();
|
|
27331
|
+
init_fuzzy_search();
|
|
27332
|
+
init_search_neighborhood();
|
|
27333
|
+
init_sidebar_width();
|
|
27334
|
+
init_selection_cascade();
|
|
27335
|
+
init_useLineage();
|
|
27336
|
+
init_cycle_auto_reject();
|
|
27337
|
+
init_useOverlayPanel();
|
|
27338
|
+
init_LineagePanel();
|
|
27339
|
+
init_GotoBanner();
|
|
27340
|
+
init_lineage_layout();
|
|
27341
|
+
init_HelpOverlay();
|
|
27342
|
+
init_LegendEntry();
|
|
27343
|
+
init_auto_reject_decision();
|
|
27344
|
+
init_breaking_change_format();
|
|
27345
|
+
init_enumerate_cycle_breaks();
|
|
27346
|
+
init_group_collapse();
|
|
27347
|
+
init_step_filters();
|
|
27348
|
+
init_sidebar_help();
|
|
27349
|
+
init_sidebar_input();
|
|
27350
|
+
init_sidebar_navigation();
|
|
27351
|
+
init_lineage_input();
|
|
27352
|
+
init_sidebar_search_state();
|
|
27353
|
+
init_SearchMatchSummary();
|
|
27354
|
+
init_ReviewComponentPanel();
|
|
27355
|
+
init_ReviewStatus();
|
|
27356
|
+
init_useReviewSession();
|
|
27357
|
+
init_useReviewEditor();
|
|
27358
|
+
init_useReviewSurfaceState();
|
|
27359
|
+
init_ReviewDialogs();
|
|
27360
|
+
init_review_input();
|
|
27361
|
+
init_useReviewPreview();
|
|
27362
|
+
init_LivePreviewSummary();
|
|
27363
|
+
init_cycle_auto_reject();
|
|
27364
|
+
PANEL_HEIGHT = 22;
|
|
27365
|
+
HELP_SECTIONS2 = [
|
|
27366
|
+
{
|
|
27367
|
+
title: "Navigation",
|
|
27368
|
+
entries: [
|
|
27369
|
+
{ keys: "j / k / \u2191 / \u2193", label: "Move cursor" },
|
|
27370
|
+
{ keys: "Tab", label: "Toggle sidebar/panel" },
|
|
27371
|
+
{ keys: "Enter", label: "Drill to source" }
|
|
27372
|
+
]
|
|
27373
|
+
},
|
|
27374
|
+
{
|
|
27375
|
+
title: "Selection",
|
|
27376
|
+
entries: [
|
|
27377
|
+
{ keys: "a", label: "Accept" },
|
|
27378
|
+
{ keys: "r", label: "Reject" },
|
|
27379
|
+
{ keys: "A", label: "Accept all" },
|
|
27380
|
+
{ keys: "F", label: "Finalize" }
|
|
27381
|
+
]
|
|
27382
|
+
},
|
|
27383
|
+
createSidebarViewsHelpSection(true),
|
|
27384
|
+
{
|
|
27385
|
+
title: "Panels",
|
|
27386
|
+
entries: [
|
|
27387
|
+
{ keys: "c", label: "Cycle list" },
|
|
27388
|
+
{ keys: "p", label: "Prop rationale" },
|
|
27389
|
+
{ keys: "P", label: "Component rationale" },
|
|
27390
|
+
{ keys: "s", label: "Source" },
|
|
27391
|
+
{ keys: "J", label: "Toggle JSON" }
|
|
27392
|
+
]
|
|
27393
|
+
},
|
|
27394
|
+
{
|
|
27395
|
+
title: "Resolving cycles",
|
|
27396
|
+
entries: [
|
|
27397
|
+
{ keys: "r", label: "Reject a cycle member (drops it from the push), or" },
|
|
27398
|
+
{ keys: "", label: "break the cycle by removing a slot's" },
|
|
27399
|
+
{ keys: "", label: "$allowedComponents edge (see [c] suggested fix)." },
|
|
27400
|
+
{ keys: "x", label: "Break cycle (from [c]): delete a slot edge." }
|
|
27401
|
+
]
|
|
27402
|
+
},
|
|
27403
|
+
{
|
|
27404
|
+
title: "Search",
|
|
27405
|
+
entries: [{ keys: "/", label: "Search" }]
|
|
27406
|
+
},
|
|
27407
|
+
{
|
|
27408
|
+
title: "History",
|
|
27409
|
+
entries: [
|
|
27410
|
+
{ keys: "Ctrl+Z", label: "Undo" },
|
|
27411
|
+
{ keys: "Ctrl+Y", label: "Redo" },
|
|
27412
|
+
{ keys: "Ctrl+R", label: "Reload from save" }
|
|
27413
|
+
]
|
|
27414
|
+
},
|
|
27415
|
+
{
|
|
27416
|
+
title: "General",
|
|
27417
|
+
entries: [
|
|
27418
|
+
{ keys: "?", label: "Close help" },
|
|
27419
|
+
{ keys: "q", label: "Quit" }
|
|
27420
|
+
]
|
|
27421
|
+
}
|
|
27422
|
+
];
|
|
27423
|
+
}
|
|
27424
|
+
});
|
|
27425
|
+
|
|
27426
|
+
// packages/experience-design-system-cli/src/import/tui/steps/AtomicGenerateReviewStep.tsx
|
|
27427
|
+
import { useCallback as useCallback8, useState as useState32 } from "react";
|
|
27428
|
+
import { Box as Box55, Text as Text59 } from "ink";
|
|
27429
|
+
import { jsx as jsx63, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
27430
|
+
function sortComponentsForSidebar3(components) {
|
|
27431
|
+
return [...components].sort((a, b) => {
|
|
27432
|
+
const aEmpty = Object.keys(a.entry.$properties ?? {}).length === 0;
|
|
27433
|
+
const bEmpty = Object.keys(b.entry.$properties ?? {}).length === 0;
|
|
27434
|
+
if (aEmpty !== bEmpty) return aEmpty ? -1 : 1;
|
|
27435
|
+
return a.key.localeCompare(b.key);
|
|
27436
|
+
});
|
|
27437
|
+
}
|
|
27438
|
+
function AtomicGenerateReviewStep({
|
|
27439
|
+
extractSessionId,
|
|
27440
|
+
tokenSessionId,
|
|
27441
|
+
onFinalize,
|
|
27442
|
+
onQuit,
|
|
27443
|
+
livePreview = true,
|
|
27444
|
+
spaceId = "",
|
|
27445
|
+
environmentId = "",
|
|
27446
|
+
cmaToken = "",
|
|
27447
|
+
host = "",
|
|
27448
|
+
tokensPath = "",
|
|
27449
|
+
initialFinalizeError = null
|
|
27450
|
+
}) {
|
|
27451
|
+
const terminalWidth = useTerminalColumns();
|
|
27452
|
+
const loadSessionState = useCallback8(
|
|
27453
|
+
() => loadReviewSessionState({
|
|
27454
|
+
extractSessionId,
|
|
27455
|
+
tokenSessionId,
|
|
27456
|
+
sortEntries: (entries) => sortComponentsForSidebar3(entries)
|
|
27457
|
+
}),
|
|
27458
|
+
[extractSessionId, tokenSessionId]
|
|
27459
|
+
);
|
|
27460
|
+
const reviewSurface = useReviewSurfaceState(initialFinalizeError);
|
|
27461
|
+
const {
|
|
27462
|
+
components,
|
|
27463
|
+
setComponents,
|
|
27464
|
+
loading,
|
|
27465
|
+
loadError,
|
|
27466
|
+
availableTokens,
|
|
27467
|
+
reloadFromSave: reloadSessionFromSave
|
|
27468
|
+
} = useReviewSession({
|
|
27469
|
+
loadSession: loadSessionState,
|
|
27470
|
+
tokensPath
|
|
27471
|
+
});
|
|
27472
|
+
const [selectedIdx, setSelectedIdx] = useState32(0);
|
|
27473
|
+
const [sidebarScrollOffset, setSidebarScrollOffset] = useState32(0);
|
|
27474
|
+
const {
|
|
27475
|
+
sidebarFocused,
|
|
27476
|
+
setSidebarFocused,
|
|
27477
|
+
showFinalize,
|
|
27478
|
+
setShowFinalize,
|
|
27479
|
+
showQuit,
|
|
27480
|
+
setShowQuit,
|
|
27481
|
+
finalizeError,
|
|
27482
|
+
setFinalizeError
|
|
27483
|
+
} = reviewSurface;
|
|
27484
|
+
const [showRemovedPanel, setShowRemovedPanel] = useState32(false);
|
|
27485
|
+
const [showReloadDialog, setShowReloadDialog] = useState32(false);
|
|
27486
|
+
const applyHistorySnapshot = (snapshot) => {
|
|
27487
|
+
setComponents(
|
|
27488
|
+
snapshot.components.map((component) => ({
|
|
27489
|
+
key: component.key,
|
|
27490
|
+
entry: component.entry,
|
|
27491
|
+
status: component.status
|
|
27492
|
+
}))
|
|
27493
|
+
);
|
|
27494
|
+
};
|
|
27495
|
+
const { pushHistorySnapshot, handleUndo, handleRedo, resetHistory } = useReviewHistory({
|
|
27496
|
+
loading,
|
|
27497
|
+
components,
|
|
27498
|
+
createSnapshot: (entries) => createReviewHistorySnapshot(entries),
|
|
27499
|
+
applySnapshot: applyHistorySnapshot
|
|
27500
|
+
});
|
|
27501
|
+
const { previewAnnotations, removedComponents, livePreviewHook, livePreviewSpinner } = useReviewPreview({
|
|
27502
|
+
components,
|
|
27503
|
+
loading,
|
|
27504
|
+
livePreview,
|
|
27505
|
+
sessionId: extractSessionId,
|
|
27506
|
+
tokensPath,
|
|
27507
|
+
spaceId,
|
|
27508
|
+
environmentId,
|
|
27509
|
+
cmaToken,
|
|
27510
|
+
host
|
|
27511
|
+
});
|
|
27512
|
+
const reviewEditor = useReviewEditor({
|
|
27513
|
+
components,
|
|
27514
|
+
selectedIdx,
|
|
27515
|
+
extractSessionId,
|
|
27516
|
+
availableTokens,
|
|
27517
|
+
setComponents,
|
|
27518
|
+
pushHistorySnapshot,
|
|
27519
|
+
onEditSaved: () => livePreviewHook.trigger(),
|
|
27520
|
+
onTokenSaved: () => livePreviewHook.trigger()
|
|
27521
|
+
});
|
|
27522
|
+
const reloadFromSave = () => {
|
|
27523
|
+
const result = reloadSessionFromSave();
|
|
27524
|
+
if (!result) return;
|
|
27525
|
+
resetHistory(createReviewHistorySnapshot(result.entries));
|
|
27526
|
+
};
|
|
27527
|
+
const { reviewMetadata, componentRationale } = useReviewMetadata({
|
|
27528
|
+
components,
|
|
27529
|
+
selectedIdx,
|
|
27530
|
+
extractSessionId
|
|
27531
|
+
});
|
|
27532
|
+
const updateStatus = (idx, status) => {
|
|
27533
|
+
setComponents((prev) => {
|
|
27534
|
+
const next = prev.map((c2, i) => i === idx ? { ...c2, status } : c2);
|
|
27535
|
+
pushHistorySnapshot(next, `status:${status}`);
|
|
27536
|
+
return next;
|
|
27537
|
+
});
|
|
27538
|
+
};
|
|
27539
|
+
const acceptAll = () => {
|
|
27540
|
+
setComponents((prev) => {
|
|
27541
|
+
const next = prev.map((c2) => c2.status === "needs-review" ? { ...c2, status: "accepted" } : c2);
|
|
27542
|
+
pushHistorySnapshot(next, "accept-all");
|
|
27543
|
+
return next;
|
|
27544
|
+
});
|
|
27545
|
+
};
|
|
27546
|
+
const finalizePreview = useReviewFinalizePreview({
|
|
27547
|
+
open: showFinalize,
|
|
27548
|
+
extractSessionId,
|
|
27549
|
+
tokensPath,
|
|
27550
|
+
spaceId,
|
|
27551
|
+
environmentId,
|
|
27552
|
+
cmaToken,
|
|
27553
|
+
host,
|
|
27554
|
+
components
|
|
27555
|
+
});
|
|
27556
|
+
const handleFinalizeConfirm = () => {
|
|
27557
|
+
const counts = finalizeReviewSession(extractSessionId, components);
|
|
27558
|
+
onFinalize(counts.accepted, counts.rejected, counts.unresolved);
|
|
27559
|
+
};
|
|
27560
|
+
const dialogOpen = showFinalize || showQuit;
|
|
27561
|
+
useImmediateInput((input, key) => {
|
|
27562
|
+
if (handleReviewOverlayInput(input, key, {
|
|
27563
|
+
loading,
|
|
27564
|
+
loadError,
|
|
27565
|
+
showFinalize,
|
|
27566
|
+
dialogOpen,
|
|
27567
|
+
showReloadDialog,
|
|
27568
|
+
finalizePreview,
|
|
27569
|
+
reloadFromSave,
|
|
27570
|
+
setShowReloadDialog,
|
|
27571
|
+
onQuit,
|
|
27572
|
+
handleUndo,
|
|
27573
|
+
handleRedo
|
|
27574
|
+
}))
|
|
27575
|
+
return;
|
|
27576
|
+
if (showRemovedPanel) {
|
|
27577
|
+
if (input === "d" || key.escape) {
|
|
27578
|
+
setShowRemovedPanel(false);
|
|
27579
|
+
}
|
|
27580
|
+
return;
|
|
27581
|
+
}
|
|
27582
|
+
if (input === "d" && sidebarFocused && livePreview && removedComponents.length > 0) {
|
|
27583
|
+
setShowRemovedPanel(true);
|
|
27584
|
+
return;
|
|
27585
|
+
}
|
|
27586
|
+
if (handleReviewPanelShortcuts(input, key, { ...reviewEditor, propKey: "i", componentKey: "I" })) return;
|
|
27587
|
+
if (key.tab) {
|
|
27588
|
+
setSidebarFocused((prev) => !prev);
|
|
27589
|
+
return;
|
|
27590
|
+
}
|
|
27591
|
+
if (input === "e" && sidebarFocused) {
|
|
27592
|
+
setSidebarFocused(false);
|
|
27593
|
+
return;
|
|
27594
|
+
}
|
|
27595
|
+
const current = components[selectedIdx];
|
|
27596
|
+
if (handleJsonPanelInput(input, key, {
|
|
27597
|
+
...reviewEditor,
|
|
27598
|
+
sidebarFocused,
|
|
27599
|
+
showJson: reviewEditor.showJson,
|
|
27600
|
+
jsonValue: getReviewJsonPanelValue(current ?? null, reviewEditor.showHiddenProps),
|
|
27601
|
+
height: PANEL_HEIGHT2
|
|
27602
|
+
}))
|
|
27603
|
+
return;
|
|
27604
|
+
if (!sidebarFocused) return;
|
|
27605
|
+
if (input === "q") {
|
|
27606
|
+
setShowQuit(true);
|
|
27607
|
+
return;
|
|
27608
|
+
}
|
|
27609
|
+
if (input === "F") {
|
|
27610
|
+
setShowFinalize(true);
|
|
27611
|
+
return;
|
|
27612
|
+
}
|
|
27613
|
+
if (input === "a") {
|
|
27614
|
+
updateStatus(selectedIdx, "accepted");
|
|
27615
|
+
setFinalizeError(null);
|
|
27616
|
+
return;
|
|
27617
|
+
}
|
|
27618
|
+
if (input === "r") {
|
|
27619
|
+
updateStatus(selectedIdx, "rejected");
|
|
27620
|
+
return;
|
|
27621
|
+
}
|
|
27622
|
+
if (input === "A") {
|
|
27623
|
+
acceptAll();
|
|
27624
|
+
setFinalizeError(null);
|
|
27625
|
+
return;
|
|
27626
|
+
}
|
|
27627
|
+
if (handleReviewViewToggleInput(input, reviewEditor)) return;
|
|
27628
|
+
if (key.upArrow || input === "k") {
|
|
27629
|
+
setSelectedIdx((prev) => {
|
|
27630
|
+
const newIdx = Math.max(0, prev - 1);
|
|
27631
|
+
setSidebarScrollOffset((off) => Math.min(off, newIdx));
|
|
27632
|
+
return newIdx;
|
|
27633
|
+
});
|
|
27634
|
+
reviewEditor.setJsonScrollOffset(0);
|
|
27635
|
+
reviewEditor.setDraftValue("");
|
|
27636
|
+
reviewEditor.setSaveError(null);
|
|
27637
|
+
} else if (key.downArrow || input === "j") {
|
|
27638
|
+
setSelectedIdx((prev) => {
|
|
27639
|
+
const newIdx = Math.min(components.length - 1, prev + 1);
|
|
27640
|
+
setSidebarScrollOffset((off) => newIdx >= off + VISIBLE_COUNT3 ? newIdx - VISIBLE_COUNT3 + 1 : off);
|
|
27641
|
+
return newIdx;
|
|
27642
|
+
});
|
|
27643
|
+
reviewEditor.setJsonScrollOffset(0);
|
|
27644
|
+
reviewEditor.setDraftValue("");
|
|
27645
|
+
reviewEditor.setSaveError(null);
|
|
27646
|
+
}
|
|
27647
|
+
});
|
|
27648
|
+
if (loading) {
|
|
27649
|
+
return /* @__PURE__ */ jsx63(ReviewLoadingState, {});
|
|
27650
|
+
}
|
|
27651
|
+
if (loadError) {
|
|
27652
|
+
return /* @__PURE__ */ jsx63(ReviewLoadError, { message: loadError });
|
|
27653
|
+
}
|
|
27654
|
+
const { selected, selectedJson, visibleJsonPanelValue } = getReviewSelectionState(
|
|
27655
|
+
components,
|
|
27656
|
+
selectedIdx,
|
|
27657
|
+
reviewEditor.showHiddenProps
|
|
27658
|
+
);
|
|
27659
|
+
const isEmpty2 = (c2) => Object.keys(c2.entry.$properties).length === 0;
|
|
27660
|
+
const emptyCount = components.filter(isEmpty2).length;
|
|
27661
|
+
const sidebarItems = components.map((c2) => ({
|
|
27662
|
+
id: c2.key,
|
|
27663
|
+
name: isEmpty2(c2) ? `${c2.key} (empty)` : c2.key,
|
|
27664
|
+
status: c2.status,
|
|
27665
|
+
previewAnnotation: previewAnnotations.get(c2.key),
|
|
27666
|
+
extractionConfidence: null,
|
|
27667
|
+
needsReview: false,
|
|
27668
|
+
validationErrorCount: 0,
|
|
27669
|
+
validationWarningCount: isEmpty2(c2) ? 1 : 0
|
|
27670
|
+
}));
|
|
27671
|
+
const longestName = components.reduce((m, c2) => Math.max(m, c2.key.length + (isEmpty2(c2) ? " (empty)".length : 0)), 0);
|
|
27672
|
+
const sidebarWidth = Math.min(Math.max(longestName + 5, 14), 30);
|
|
27673
|
+
const panelWidth = Math.max(10, terminalWidth - sidebarWidth - 4);
|
|
27674
|
+
return /* @__PURE__ */ jsxs56(Box55, { flexDirection: "column", children: [
|
|
27675
|
+
/* @__PURE__ */ jsx63(
|
|
27676
|
+
ReviewStepDialogs,
|
|
27677
|
+
{
|
|
27678
|
+
surfaceState: reviewSurface,
|
|
27679
|
+
components,
|
|
27680
|
+
finalizePreview,
|
|
27681
|
+
onFinalize: handleFinalizeConfirm,
|
|
27682
|
+
onQuit
|
|
27683
|
+
}
|
|
27684
|
+
),
|
|
27685
|
+
/* @__PURE__ */ jsx63(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
27686
|
+
showRemovedPanel && !dialogOpen && /* @__PURE__ */ jsxs56(Box55, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
|
|
27687
|
+
/* @__PURE__ */ jsx63(Text59, { bold: true, color: PALETTE.info, children: `Removed components (${removedComponents.length})` }),
|
|
27688
|
+
/* @__PURE__ */ jsx63(Text59, { dimColor: true, children: "these will be DELETED from the target space" }),
|
|
27689
|
+
/* @__PURE__ */ jsx63(Text59, { children: " " }),
|
|
27690
|
+
removedComponents.map((rc) => /* @__PURE__ */ jsx63(Text59, { children: `- ${rc.name}${rc.id ? ` (${rc.id})` : ""}` }, rc.id)),
|
|
27691
|
+
/* @__PURE__ */ jsx63(Text59, { children: " " }),
|
|
27692
|
+
/* @__PURE__ */ jsx63(Text59, { dimColor: true, children: "press d or Esc to close" })
|
|
27693
|
+
] }),
|
|
27694
|
+
!dialogOpen && /* @__PURE__ */ jsx63(
|
|
27695
|
+
LivePreviewSummary,
|
|
27696
|
+
{
|
|
27697
|
+
enabled: livePreview,
|
|
27698
|
+
previewAnnotations,
|
|
27699
|
+
status: livePreviewHook.status,
|
|
27700
|
+
disabled: livePreviewHook.disabled,
|
|
27701
|
+
spinner: livePreviewSpinner,
|
|
27702
|
+
removedCount: removedComponents.length,
|
|
27703
|
+
showRemovedListHint: true
|
|
27704
|
+
}
|
|
27705
|
+
),
|
|
27706
|
+
/* @__PURE__ */ jsx63(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
|
|
27707
|
+
/* @__PURE__ */ jsx63(ReviewFinalizeError, { message: finalizeError, hidden: dialogOpen }),
|
|
27708
|
+
!dialogOpen && /* @__PURE__ */ jsxs56(Box55, { children: [
|
|
27709
|
+
/* @__PURE__ */ jsx63(
|
|
27710
|
+
Sidebar,
|
|
27711
|
+
{
|
|
27712
|
+
components: sidebarItems,
|
|
27713
|
+
selectedId: selected?.key ?? null,
|
|
26808
27714
|
focused: sidebarFocused,
|
|
26809
|
-
renderStatusByKey,
|
|
26810
|
-
previewAnnotationByKey,
|
|
26811
|
-
selectionStateByKey,
|
|
26812
27715
|
scrollOffset: sidebarScrollOffset,
|
|
26813
|
-
visibleCount,
|
|
26814
|
-
|
|
26815
|
-
|
|
26816
|
-
|
|
26817
|
-
|
|
27716
|
+
visibleCount: VISIBLE_COUNT3,
|
|
27717
|
+
onSelect: (id) => {
|
|
27718
|
+
const idx = components.findIndex((c2) => c2.key === id);
|
|
27719
|
+
if (idx >= 0) {
|
|
27720
|
+
setSelectedIdx(idx);
|
|
27721
|
+
reviewEditor.setJsonScrollOffset(0);
|
|
27722
|
+
}
|
|
27723
|
+
},
|
|
27724
|
+
onScrollChange: setSidebarScrollOffset,
|
|
27725
|
+
width: sidebarWidth
|
|
26818
27726
|
}
|
|
26819
27727
|
),
|
|
26820
|
-
selected ? /* @__PURE__ */
|
|
27728
|
+
selected ? /* @__PURE__ */ jsx63(
|
|
26821
27729
|
ReviewComponentPanel,
|
|
26822
27730
|
{
|
|
26823
27731
|
selectedKey: selected.key,
|
|
@@ -26826,224 +27734,55 @@ function GenerateReviewStep({
|
|
|
26826
27734
|
reviewMetadata,
|
|
26827
27735
|
reviewEditor,
|
|
26828
27736
|
width: panelWidth,
|
|
26829
|
-
height:
|
|
27737
|
+
height: PANEL_HEIGHT2,
|
|
27738
|
+
sourceBorderColor: PALETTE.border,
|
|
26830
27739
|
jsonValue: visibleJsonPanelValue,
|
|
26831
27740
|
sidebarFocused,
|
|
26832
|
-
fieldEditor: buildReviewFieldEditor(reviewEditor, selectedJson, () => setSidebarFocused(true),
|
|
26833
|
-
key: pendingEditorFocus && pendingEditorFocus.componentName === selected.key ? `${selected.key}::${pendingEditorFocus.target.kind}:${pendingEditorFocus.target.name}` : selected.key,
|
|
26834
|
-
propRationaleKey: "p",
|
|
26835
|
-
componentRationaleKey: "P",
|
|
26836
|
-
projectSlotGraph,
|
|
26837
|
-
currentComponentName: selected.key,
|
|
26838
|
-
onDirtyChange: setEditorDirty,
|
|
26839
|
-
discardTrigger,
|
|
26840
|
-
initialFocusTarget: pendingEditorFocus && pendingEditorFocus.componentName === selected.key ? pendingEditorFocus.target : { kind: "description" }
|
|
26841
|
-
}),
|
|
27741
|
+
fieldEditor: buildReviewFieldEditor(reviewEditor, selectedJson, () => setSidebarFocused(true)),
|
|
26842
27742
|
saveError: reviewEditor.saveError,
|
|
26843
|
-
sidebarFooter:
|
|
27743
|
+
sidebarFooter: " [a] accept [r] reject [A] accept all [i] prop rationale [I] component rationale [s] source [J] " + (reviewEditor.showJson ? "hide JSON" : "show JSON") + " [H] " + (reviewEditor.showHiddenProps ? "hide state/unattached" : "show state/unattached") + (reviewEditor.currentTokenSuggestions().length > 0 ? " [t] token review" : "") + " [^z] undo [^y] redo [^r] reload [F] finalize [e/Tab] focus panel" + (livePreview && removedComponents.length > 0 ? " [d] removed list" : "") + " [q] quit",
|
|
26844
27744
|
livePreview: livePreviewHook,
|
|
26845
27745
|
livePreviewSpinner
|
|
26846
27746
|
}
|
|
26847
|
-
) : /* @__PURE__ */
|
|
26848
|
-
] }),
|
|
26849
|
-
breakPanel.isOpen && !breakOverlayFullScreen && !dialogOpen && renderBreakOverlay(),
|
|
26850
|
-
!dialogOpen && slotCycles.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs54(Box53, { flexDirection: "column", children: [
|
|
26851
|
-
/* @__PURE__ */ jsx61(Text57, { color: PALETTE.warning, children: `\u26A0 ${slotCycles.length} slot dependency cycle${slotCycles.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
26852
|
-
slotCycles.slice(0, 3).map((cycle, idx) => {
|
|
26853
|
-
return /* @__PURE__ */ jsx61(
|
|
26854
|
-
CyclePathLine,
|
|
26855
|
-
{
|
|
26856
|
-
segments: formatCyclePathSegments(cycle),
|
|
26857
|
-
prefix: " Cycle: ",
|
|
26858
|
-
highlightComponents: true,
|
|
26859
|
-
highlightLine: true
|
|
26860
|
-
},
|
|
26861
|
-
`cyc-banner-${idx}`
|
|
26862
|
-
);
|
|
26863
|
-
}),
|
|
26864
|
-
slotCycles.length > 3 && /* @__PURE__ */ jsx61(Text57, { color: PALETTE.warning, children: ` \u2026${slotCycles.length - 3} more` }),
|
|
26865
|
-
/* @__PURE__ */ jsx61(Text57, { dimColor: true, children: " press [c] for detail" })
|
|
27747
|
+
) : /* @__PURE__ */ jsx63(ReviewNoSelection, {})
|
|
26866
27748
|
] }),
|
|
26867
|
-
/* @__PURE__ */
|
|
26868
|
-
SearchMatchSummary,
|
|
26869
|
-
{
|
|
26870
|
-
open: searchOpen,
|
|
26871
|
-
query: searchQuery,
|
|
26872
|
-
matches: searchMatchCount,
|
|
26873
|
-
total: components.length,
|
|
26874
|
-
autocompleteCandidates,
|
|
26875
|
-
hidden: dialogOpen
|
|
26876
|
-
}
|
|
26877
|
-
),
|
|
26878
|
-
!dialogOpen && sidebarFocused && /* @__PURE__ */ jsx61(Box53, { columnGap: 2, flexWrap: "wrap", children: reviewEditor.panelOpen === "token-review" ? /* @__PURE__ */ jsxs54(Fragment18, { children: [
|
|
26879
|
-
legendEntry("[\u2191/\u2193]", "move"),
|
|
26880
|
-
legendEntry("[Enter]", "edit allowed"),
|
|
26881
|
-
legendEntry("[Esc]", "close")
|
|
26882
|
-
] }) : /* @__PURE__ */ jsxs54(Fragment18, { children: [
|
|
26883
|
-
legendEntry("[j/k]", "move"),
|
|
26884
|
-
legendEntry("[a]", "accept"),
|
|
26885
|
-
legendEntry("[r]", "reject"),
|
|
26886
|
-
legendEntry("[A]", "accept all"),
|
|
26887
|
-
legendEntry("[F]", "finalize"),
|
|
26888
|
-
legendEntry("[L]", "flat", columnOneView === "flat"),
|
|
26889
|
-
legendEntry("[l]", "lineage", lineagePanel.isOpen),
|
|
26890
|
-
legendEntry("[i]", "focus lineage", jumpFilterTarget !== null),
|
|
26891
|
-
legendEntry("[w]", "only breaking", activeFilters.has("broken")),
|
|
26892
|
-
slotCycles.length > 0 && legendEntry("[o]", "only cycles", activeFilters.has("cycles")),
|
|
26893
|
-
slotCycles.length > 0 && legendEntry("[c]", "cycle list", cyclePanel.isOpen),
|
|
26894
|
-
legendEntry("[p]", "prop rationale", reviewEditor.panelOpen === "prop-rationale"),
|
|
26895
|
-
legendEntry("[P]", "component rationale", reviewEditor.panelOpen === "component-rationale"),
|
|
26896
|
-
legendEntry("[s]", "source", reviewEditor.panelOpen === "source"),
|
|
26897
|
-
reviewEditor.currentTokenSuggestions().length > 0 && legendEntry("[t]", "token review"),
|
|
26898
|
-
legendEntry("[J]", reviewEditor.showJson ? "hide JSON" : "show JSON", reviewEditor.showJson),
|
|
26899
|
-
legendEntry(
|
|
26900
|
-
"[H]",
|
|
26901
|
-
reviewEditor.showHiddenProps ? "hide state/unattached" : "show state/unattached",
|
|
26902
|
-
reviewEditor.showHiddenProps
|
|
26903
|
-
),
|
|
26904
|
-
breakingChanges.length > 0 && legendEntry("[b]", "see breaking changes", breakingPanel.isOpen),
|
|
26905
|
-
removedComponents.length > 0 && legendEntry("[d]", removedBannerCollapsed ? "show removed" : "hide removed", !removedBannerCollapsed),
|
|
26906
|
-
legendEntry("[/]", "search", searchOpen || searchQuery.length > 0),
|
|
26907
|
-
legendEntry("[Tab]", "focus panel"),
|
|
26908
|
-
legendEntry("[Ctrl+Z]", "undo"),
|
|
26909
|
-
legendEntry("[Ctrl+Y]", "redo"),
|
|
26910
|
-
legendEntry("[Ctrl+R]", "reload"),
|
|
26911
|
-
legendEntry("[?]", "help"),
|
|
26912
|
-
legendEntry("[q]", "quit")
|
|
26913
|
-
] }) }),
|
|
26914
|
-
!dialogOpen && /* @__PURE__ */ jsx61(
|
|
26915
|
-
ReviewStatusBar,
|
|
26916
|
-
{
|
|
26917
|
-
entries: components,
|
|
26918
|
-
onApproveAll: () => {
|
|
26919
|
-
setComponents((prev) => prev.map((c2) => c2.status === "needs-review" ? { ...c2, status: "accepted" } : c2));
|
|
26920
|
-
},
|
|
26921
|
-
onFinalize: () => setShowFinalize(true)
|
|
26922
|
-
}
|
|
26923
|
-
)
|
|
27749
|
+
!dialogOpen && /* @__PURE__ */ jsx63(ReviewStatusBar, { entries: components, onApproveAll: acceptAll, onFinalize: () => setShowFinalize(true) })
|
|
26924
27750
|
] });
|
|
26925
27751
|
}
|
|
26926
|
-
var
|
|
26927
|
-
var
|
|
26928
|
-
"packages/experience-design-system-cli/src/import/tui/steps/
|
|
27752
|
+
var VISIBLE_COUNT3, PANEL_HEIGHT2;
|
|
27753
|
+
var init_AtomicGenerateReviewStep = __esm({
|
|
27754
|
+
"packages/experience-design-system-cli/src/import/tui/steps/AtomicGenerateReviewStep.tsx"() {
|
|
26929
27755
|
"use strict";
|
|
26930
|
-
|
|
26931
|
-
init_review_json_panel();
|
|
26932
|
-
init_GroupedSidebar();
|
|
26933
|
-
init_composite_closure();
|
|
26934
|
-
init_slot_graph();
|
|
26935
|
-
init_cycle_view();
|
|
26936
|
-
init_issue_inheritance();
|
|
26937
|
-
init_removed_components_text();
|
|
27756
|
+
init_Sidebar();
|
|
26938
27757
|
init_useImmediateInput();
|
|
26939
|
-
init_db();
|
|
26940
|
-
init_cycle_detection();
|
|
26941
|
-
init_cycle_panel_scroll();
|
|
26942
27758
|
init_useFinalizePreview();
|
|
26943
|
-
|
|
26944
|
-
init_search_neighborhood();
|
|
26945
|
-
init_sidebar_width();
|
|
26946
|
-
init_selection_cascade();
|
|
26947
|
-
init_useLineage();
|
|
26948
|
-
init_cycle_auto_reject();
|
|
26949
|
-
init_useOverlayPanel();
|
|
26950
|
-
init_LineagePanel();
|
|
26951
|
-
init_GotoBanner();
|
|
26952
|
-
init_lineage_layout();
|
|
26953
|
-
init_HelpOverlay();
|
|
26954
|
-
init_LegendEntry();
|
|
26955
|
-
init_auto_reject_decision();
|
|
26956
|
-
init_breaking_change_format();
|
|
26957
|
-
init_enumerate_cycle_breaks();
|
|
26958
|
-
init_group_collapse();
|
|
26959
|
-
init_step_filters();
|
|
26960
|
-
init_sidebar_help();
|
|
26961
|
-
init_sidebar_input();
|
|
26962
|
-
init_sidebar_navigation();
|
|
26963
|
-
init_lineage_input();
|
|
26964
|
-
init_sidebar_search_state();
|
|
26965
|
-
init_SearchMatchSummary();
|
|
27759
|
+
init_theme();
|
|
26966
27760
|
init_ReviewComponentPanel();
|
|
27761
|
+
init_review_json_panel();
|
|
27762
|
+
init_LivePreviewSummary();
|
|
26967
27763
|
init_ReviewStatus();
|
|
27764
|
+
init_review_input();
|
|
26968
27765
|
init_useReviewSession();
|
|
26969
27766
|
init_useReviewEditor();
|
|
26970
27767
|
init_useReviewSurfaceState();
|
|
26971
|
-
init_ReviewDialogs();
|
|
26972
|
-
init_review_input();
|
|
26973
27768
|
init_useReviewPreview();
|
|
26974
|
-
|
|
26975
|
-
|
|
26976
|
-
|
|
26977
|
-
|
|
26978
|
-
{
|
|
26979
|
-
title: "Navigation",
|
|
26980
|
-
entries: [
|
|
26981
|
-
{ keys: "j / k / \u2191 / \u2193", label: "Move cursor" },
|
|
26982
|
-
{ keys: "Tab", label: "Toggle sidebar/panel" },
|
|
26983
|
-
{ keys: "Enter", label: "Drill to source" }
|
|
26984
|
-
]
|
|
26985
|
-
},
|
|
26986
|
-
{
|
|
26987
|
-
title: "Selection",
|
|
26988
|
-
entries: [
|
|
26989
|
-
{ keys: "a", label: "Accept" },
|
|
26990
|
-
{ keys: "r", label: "Reject" },
|
|
26991
|
-
{ keys: "A", label: "Accept all" },
|
|
26992
|
-
{ keys: "F", label: "Finalize" }
|
|
26993
|
-
]
|
|
26994
|
-
},
|
|
26995
|
-
createSidebarViewsHelpSection(true),
|
|
26996
|
-
{
|
|
26997
|
-
title: "Panels",
|
|
26998
|
-
entries: [
|
|
26999
|
-
{ keys: "c", label: "Cycle list" },
|
|
27000
|
-
{ keys: "p", label: "Prop rationale" },
|
|
27001
|
-
{ keys: "P", label: "Component rationale" },
|
|
27002
|
-
{ keys: "s", label: "Source" },
|
|
27003
|
-
{ keys: "J", label: "Toggle JSON" }
|
|
27004
|
-
]
|
|
27005
|
-
},
|
|
27006
|
-
{
|
|
27007
|
-
title: "Resolving cycles",
|
|
27008
|
-
entries: [
|
|
27009
|
-
{ keys: "r", label: "Reject a cycle member (drops it from the push), or" },
|
|
27010
|
-
{ keys: "", label: "break the cycle by removing a slot's" },
|
|
27011
|
-
{ keys: "", label: "$allowedComponents edge (see [c] suggested fix)." },
|
|
27012
|
-
{ keys: "x", label: "Break cycle (from [c]): delete a slot edge." }
|
|
27013
|
-
]
|
|
27014
|
-
},
|
|
27015
|
-
{
|
|
27016
|
-
title: "Search",
|
|
27017
|
-
entries: [{ keys: "/", label: "Search" }]
|
|
27018
|
-
},
|
|
27019
|
-
{
|
|
27020
|
-
title: "History",
|
|
27021
|
-
entries: [
|
|
27022
|
-
{ keys: "Ctrl+Z", label: "Undo" },
|
|
27023
|
-
{ keys: "Ctrl+Y", label: "Redo" },
|
|
27024
|
-
{ keys: "Ctrl+R", label: "Reload from save" }
|
|
27025
|
-
]
|
|
27026
|
-
},
|
|
27027
|
-
{
|
|
27028
|
-
title: "General",
|
|
27029
|
-
entries: [
|
|
27030
|
-
{ keys: "?", label: "Close help" },
|
|
27031
|
-
{ keys: "q", label: "Quit" }
|
|
27032
|
-
]
|
|
27033
|
-
}
|
|
27034
|
-
];
|
|
27769
|
+
init_ReviewDialogs();
|
|
27770
|
+
init_useTerminalColumns();
|
|
27771
|
+
VISIBLE_COUNT3 = 20;
|
|
27772
|
+
PANEL_HEIGHT2 = 22;
|
|
27035
27773
|
}
|
|
27036
27774
|
});
|
|
27037
27775
|
|
|
27038
27776
|
// packages/experience-design-system-cli/src/import/tui/final-review-host.tsx
|
|
27039
|
-
import { Box as
|
|
27040
|
-
import
|
|
27041
|
-
import { jsx as
|
|
27777
|
+
import { Box as Box56, Text as Text60 } from "ink";
|
|
27778
|
+
import React25 from "react";
|
|
27779
|
+
import { jsx as jsx64, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
27042
27780
|
function FinalReviewHost({
|
|
27043
27781
|
extractSessionId,
|
|
27044
27782
|
tokenSessionId,
|
|
27045
27783
|
generatedCount,
|
|
27046
27784
|
autoAccept,
|
|
27785
|
+
compositionMode = "atomic",
|
|
27047
27786
|
onFinalize,
|
|
27048
27787
|
onQuit,
|
|
27049
27788
|
livePreview,
|
|
@@ -27056,13 +27795,14 @@ function FinalReviewHost({
|
|
|
27056
27795
|
allowDeletions
|
|
27057
27796
|
}) {
|
|
27058
27797
|
if (!extractSessionId) {
|
|
27059
|
-
return /* @__PURE__ */
|
|
27798
|
+
return /* @__PURE__ */ jsx64(Box56, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx64(Text60, { color: PALETTE.error, children: "Error: no session ID \u2014 cannot load generated definitions." }) });
|
|
27060
27799
|
}
|
|
27061
27800
|
if (autoAccept) {
|
|
27062
|
-
return /* @__PURE__ */
|
|
27801
|
+
return /* @__PURE__ */ jsx64(FinalReviewAutoAccept, { generatedCount, onFinalize });
|
|
27063
27802
|
}
|
|
27064
|
-
|
|
27065
|
-
|
|
27803
|
+
const StepComponent = compositionMode === "atomic" ? AtomicGenerateReviewStep : GenerateReviewStep;
|
|
27804
|
+
return /* @__PURE__ */ jsx64(
|
|
27805
|
+
StepComponent,
|
|
27066
27806
|
{
|
|
27067
27807
|
extractSessionId,
|
|
27068
27808
|
tokenSessionId,
|
|
@@ -27075,7 +27815,7 @@ function FinalReviewHost({
|
|
|
27075
27815
|
host,
|
|
27076
27816
|
tokensPath,
|
|
27077
27817
|
initialFinalizeError,
|
|
27078
|
-
allowDeletions
|
|
27818
|
+
...compositionMode !== "atomic" ? { allowDeletions } : {}
|
|
27079
27819
|
}
|
|
27080
27820
|
);
|
|
27081
27821
|
}
|
|
@@ -27083,10 +27823,10 @@ function FinalReviewAutoAccept({
|
|
|
27083
27823
|
generatedCount,
|
|
27084
27824
|
onFinalize
|
|
27085
27825
|
}) {
|
|
27086
|
-
|
|
27826
|
+
React25.useEffect(() => {
|
|
27087
27827
|
onFinalize(generatedCount, 0, 0);
|
|
27088
27828
|
}, []);
|
|
27089
|
-
return /* @__PURE__ */
|
|
27829
|
+
return /* @__PURE__ */ jsx64(Box56, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsxs57(Text60, { dimColor: true, children: [
|
|
27090
27830
|
"Auto-accepting ",
|
|
27091
27831
|
generatedCount,
|
|
27092
27832
|
" generated components..."
|
|
@@ -27097,6 +27837,7 @@ var init_final_review_host = __esm({
|
|
|
27097
27837
|
"use strict";
|
|
27098
27838
|
init_theme();
|
|
27099
27839
|
init_GenerateReviewStep();
|
|
27840
|
+
init_AtomicGenerateReviewStep();
|
|
27100
27841
|
}
|
|
27101
27842
|
});
|
|
27102
27843
|
|
|
@@ -27195,8 +27936,8 @@ __export(WizardApp_exports, {
|
|
|
27195
27936
|
parsePrintTokensCount: () => parsePrintTokensCount,
|
|
27196
27937
|
shouldRunMapTokens: () => shouldRunMapTokens
|
|
27197
27938
|
});
|
|
27198
|
-
import { useEffect as useEffect13, useRef as useRef10, useState as
|
|
27199
|
-
import { Box as
|
|
27939
|
+
import { useEffect as useEffect13, useRef as useRef10, useState as useState33 } from "react";
|
|
27940
|
+
import { Box as Box57, Text as Text61, useStdout as useStdout7 } from "ink";
|
|
27200
27941
|
import { join as join25, resolve as resolve25 } from "node:path";
|
|
27201
27942
|
import { appendFileSync as appendFileSync2, writeFileSync } from "node:fs";
|
|
27202
27943
|
import { access as access8, readFile as readFile23, stat as stat6 } from "node:fs/promises";
|
|
@@ -27204,7 +27945,7 @@ import { tmpdir } from "node:os";
|
|
|
27204
27945
|
import { execFile as execFile4, spawn as spawn4 } from "node:child_process";
|
|
27205
27946
|
import { mkdir as mkdir7 } from "node:fs/promises";
|
|
27206
27947
|
import { buildManifest as buildManifest4 } from "@contentful/experience-design-system-types";
|
|
27207
|
-
import { jsx as
|
|
27948
|
+
import { jsx as jsx65, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
27208
27949
|
function buildSelectAgentArgs(opts) {
|
|
27209
27950
|
const args = ["analyze", "select-agent", "--agent", opts.agent, "--session", opts.sessionId, "--exclude-invalid"];
|
|
27210
27951
|
if (opts.model) args.push("--model", opts.model);
|
|
@@ -27324,6 +28065,7 @@ function WizardApp({
|
|
|
27324
28065
|
host,
|
|
27325
28066
|
autoAcceptScope = false,
|
|
27326
28067
|
autoRejectCycles = false,
|
|
28068
|
+
compositionMode = "atomic",
|
|
27327
28069
|
compositionMap,
|
|
27328
28070
|
compositionAgent = false,
|
|
27329
28071
|
compositionAgentMode,
|
|
@@ -27352,7 +28094,7 @@ function WizardApp({
|
|
|
27352
28094
|
} = {}) {
|
|
27353
28095
|
const defaultConfiguredHost = toConfiguredHost(host || process.env["EDS_HOST"]) ?? DEFAULT_CONFIGURED_HOST;
|
|
27354
28096
|
const resolveWizardHost = (hostValue) => hostValue || defaultConfiguredHost;
|
|
27355
|
-
const { stdout } =
|
|
28097
|
+
const { stdout } = useStdout7();
|
|
27356
28098
|
const terminalWidth = stdout?.columns ?? 80;
|
|
27357
28099
|
const logInit = useRef10(false);
|
|
27358
28100
|
if (!logInit.current) {
|
|
@@ -27376,7 +28118,7 @@ function WizardApp({
|
|
|
27376
28118
|
const initialStepResolved = modifyEntryReady ? "final-review" : pushFromPickerReady ? "push-from-picker" : rawTokensEntryReady ? "generating-tokens" : initialProjectPath ? "token-input" : "welcome";
|
|
27377
28119
|
const initialOutDir = initialProjectPath ? join25(resolve25(initialProjectPath), ".contentful") : "";
|
|
27378
28120
|
const initialTokensPath = (modifyEntryReady || pushFromPickerReady) && initialOutDir && seedTokenSessionId ? join25(initialOutDir, "tokens.json") : "";
|
|
27379
|
-
const [state, setState] =
|
|
28121
|
+
const [state, setState] = useState33({
|
|
27380
28122
|
step: modifyEntryReady || rawTokensEntryReady || pushFromPickerReady ? initialStepResolved : initialRuns && initialRuns.length > 0 ? "run-picker" : initialStepResolved,
|
|
27381
28123
|
agent: initialAgent ?? "claude",
|
|
27382
28124
|
...initialModel ? { agentModel: initialModel } : {},
|
|
@@ -27622,14 +28364,17 @@ If you are using AWS Bedrock, run:
|
|
|
27622
28364
|
const outDir = join25(resolve25(projectPath), ".contentful");
|
|
27623
28365
|
update({ step: "extracting", outDir, extractProgress: null, compositionPhase: null });
|
|
27624
28366
|
const extractArgs = [findCliPath(), "analyze", "extract", "--project", projectPath];
|
|
27625
|
-
if (
|
|
27626
|
-
|
|
27627
|
-
|
|
27628
|
-
|
|
27629
|
-
|
|
27630
|
-
|
|
27631
|
-
|
|
27632
|
-
|
|
28367
|
+
if (compositionMode === "composite") {
|
|
28368
|
+
extractArgs.push("--composite");
|
|
28369
|
+
if (compositionMap) extractArgs.push("--composition-map", compositionMap);
|
|
28370
|
+
if (compositionAgent) extractArgs.push("--composition-agent");
|
|
28371
|
+
if (compositionAgentMode) extractArgs.push("--composition-agent-mode", compositionAgentMode);
|
|
28372
|
+
if (compositionRefresh) extractArgs.push("--composition-refresh");
|
|
28373
|
+
if (generateMap) extractArgs.push("--generate-map", generateMap);
|
|
28374
|
+
for (const p of promptOverrides ?? []) extractArgs.push("--prompt", p);
|
|
28375
|
+
if (state.agent) extractArgs.push("--agent", state.agent);
|
|
28376
|
+
if (state.bedrock) extractArgs.push("--bedrock");
|
|
28377
|
+
}
|
|
27633
28378
|
const r = await runSpawnedCli(extractArgs, (chunk) => {
|
|
27634
28379
|
for (const line of chunk.split("\n")) {
|
|
27635
28380
|
const scanMatch = /^progress=scan:(\d+)$/.exec(line.trim());
|
|
@@ -28472,7 +29217,8 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28472
29217
|
extractSessionId: state.extractSessionId ?? "",
|
|
28473
29218
|
generateSessionId: state.generateSessionId,
|
|
28474
29219
|
sourceFingerprint,
|
|
28475
|
-
savedFingerprint
|
|
29220
|
+
savedFingerprint,
|
|
29221
|
+
compositionMode
|
|
28476
29222
|
});
|
|
28477
29223
|
setState((prev) => ({ ...prev, lastRunId: record.id }));
|
|
28478
29224
|
} catch (err) {
|
|
@@ -28545,7 +29291,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28545
29291
|
const stepContent = (() => {
|
|
28546
29292
|
switch (state.step) {
|
|
28547
29293
|
case "run-picker":
|
|
28548
|
-
return /* @__PURE__ */
|
|
29294
|
+
return /* @__PURE__ */ jsx65(
|
|
28549
29295
|
RunPicker,
|
|
28550
29296
|
{
|
|
28551
29297
|
runs: initialRuns ?? [],
|
|
@@ -28560,7 +29306,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28560
29306
|
}
|
|
28561
29307
|
);
|
|
28562
29308
|
case "welcome":
|
|
28563
|
-
return /* @__PURE__ */
|
|
29309
|
+
return /* @__PURE__ */ jsx65(
|
|
28564
29310
|
WelcomeStep,
|
|
28565
29311
|
{
|
|
28566
29312
|
onContinue: (path) => {
|
|
@@ -28572,7 +29318,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28572
29318
|
}
|
|
28573
29319
|
);
|
|
28574
29320
|
case "token-input":
|
|
28575
|
-
return /* @__PURE__ */
|
|
29321
|
+
return /* @__PURE__ */ jsx65(
|
|
28576
29322
|
TokenInputStep,
|
|
28577
29323
|
{
|
|
28578
29324
|
onConfirm: (rawTokensPath) => {
|
|
@@ -28583,7 +29329,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28583
29329
|
}
|
|
28584
29330
|
);
|
|
28585
29331
|
case "token-reuse-gate":
|
|
28586
|
-
return /* @__PURE__ */
|
|
29332
|
+
return /* @__PURE__ */ jsx65(
|
|
28587
29333
|
GateStep,
|
|
28588
29334
|
{
|
|
28589
29335
|
successMessage: "Existing tokens.json found",
|
|
@@ -28605,7 +29351,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28605
29351
|
}
|
|
28606
29352
|
);
|
|
28607
29353
|
case "checking-claude-auth":
|
|
28608
|
-
return /* @__PURE__ */
|
|
29354
|
+
return /* @__PURE__ */ jsx65(
|
|
28609
29355
|
RunningStep,
|
|
28610
29356
|
{
|
|
28611
29357
|
stepNumber: state.authCheckStepNumber,
|
|
@@ -28615,7 +29361,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28615
29361
|
}
|
|
28616
29362
|
);
|
|
28617
29363
|
case "generating-tokens":
|
|
28618
|
-
return /* @__PURE__ */
|
|
29364
|
+
return /* @__PURE__ */ jsx65(
|
|
28619
29365
|
RunningStep,
|
|
28620
29366
|
{
|
|
28621
29367
|
stepNumber: 1,
|
|
@@ -28625,7 +29371,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28625
29371
|
}
|
|
28626
29372
|
);
|
|
28627
29373
|
case "path-validation":
|
|
28628
|
-
return /* @__PURE__ */
|
|
29374
|
+
return /* @__PURE__ */ jsx65(
|
|
28629
29375
|
PathValidationStep,
|
|
28630
29376
|
{
|
|
28631
29377
|
projectPath: state.projectPath,
|
|
@@ -28665,7 +29411,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28665
29411
|
if (phase === "done") return "Composition mapping resolved \u2713";
|
|
28666
29412
|
return `Composition: ${phase}`;
|
|
28667
29413
|
})();
|
|
28668
|
-
return /* @__PURE__ */
|
|
29414
|
+
return /* @__PURE__ */ jsx65(
|
|
28669
29415
|
RunningStep,
|
|
28670
29416
|
{
|
|
28671
29417
|
stepNumber: hasTokens ? 2 : 1,
|
|
@@ -28679,7 +29425,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28679
29425
|
}
|
|
28680
29426
|
case "scope-gate": {
|
|
28681
29427
|
if (!state.extractSessionId) {
|
|
28682
|
-
return /* @__PURE__ */
|
|
29428
|
+
return /* @__PURE__ */ jsx65(Box57, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx65(Text61, { color: PALETTE.error, children: "Error: extract session ID missing \u2014 please re-run." }) });
|
|
28683
29429
|
}
|
|
28684
29430
|
const sessionId2 = state.extractSessionId;
|
|
28685
29431
|
const db = openPipelineDb();
|
|
@@ -28690,11 +29436,12 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28690
29436
|
db.close();
|
|
28691
29437
|
}
|
|
28692
29438
|
components = mergeAiDecisions(components, state.aiDecisions);
|
|
28693
|
-
return /* @__PURE__ */
|
|
29439
|
+
return /* @__PURE__ */ jsx65(
|
|
28694
29440
|
ScopeGateHost,
|
|
28695
29441
|
{
|
|
28696
29442
|
components,
|
|
28697
29443
|
autoAccept: autoAcceptScope,
|
|
29444
|
+
compositionMode,
|
|
28698
29445
|
aiFilterStatus: state.aiFilterStatus,
|
|
28699
29446
|
aiFilterProgress: state.aiFilterProgress,
|
|
28700
29447
|
aiFilterError: state.aiFilterError,
|
|
@@ -28734,7 +29481,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28734
29481
|
const p = state.generateProgress;
|
|
28735
29482
|
const stepNum = hasTokens ? 4 : 3;
|
|
28736
29483
|
const progressDetail = p ? `[${p.done}/${p.total}] ${p.current} \u2014 this can take 10\u201330 minutes for large libraries` : `Starting up ${state.agent}... (this can take 10\u201330 minutes for large libraries \u2014 grab a coffee)`;
|
|
28737
|
-
return /* @__PURE__ */
|
|
29484
|
+
return /* @__PURE__ */ jsx65(
|
|
28738
29485
|
RunningStep,
|
|
28739
29486
|
{
|
|
28740
29487
|
stepNumber: stepNum,
|
|
@@ -28747,7 +29494,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28747
29494
|
}
|
|
28748
29495
|
case "mapping-tokens": {
|
|
28749
29496
|
const stepNum = hasTokens ? 5 : 4;
|
|
28750
|
-
return /* @__PURE__ */
|
|
29497
|
+
return /* @__PURE__ */ jsx65(
|
|
28751
29498
|
RunningStep,
|
|
28752
29499
|
{
|
|
28753
29500
|
stepNumber: stepNum,
|
|
@@ -28759,13 +29506,14 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28759
29506
|
);
|
|
28760
29507
|
}
|
|
28761
29508
|
case "final-review": {
|
|
28762
|
-
return /* @__PURE__ */
|
|
29509
|
+
return /* @__PURE__ */ jsx65(
|
|
28763
29510
|
FinalReviewHost,
|
|
28764
29511
|
{
|
|
28765
29512
|
extractSessionId: state.extractSessionId,
|
|
28766
29513
|
tokenSessionId: state.tokenSessionId,
|
|
28767
29514
|
generatedCount: state.generatedCount,
|
|
28768
29515
|
autoAccept: autoAcceptScope,
|
|
29516
|
+
compositionMode,
|
|
28769
29517
|
livePreview,
|
|
28770
29518
|
spaceId: state.spaceId,
|
|
28771
29519
|
environmentId: state.environmentId,
|
|
@@ -28906,7 +29654,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28906
29654
|
const files = [tokenDesc, compDesc].filter(Boolean).join(" and ");
|
|
28907
29655
|
const count = state.generatedAcceptedCount > 0 ? state.generatedAcceptedCount : state.generatedCount;
|
|
28908
29656
|
const summary = hasComponents ? `${count} component definition${count !== 1 ? "s" : ""} ready${hasTokens ? ", design tokens ready" : ""}.` : hasTokens ? "Design tokens ready." : "Ready to continue.";
|
|
28909
|
-
return /* @__PURE__ */
|
|
29657
|
+
return /* @__PURE__ */ jsx65(
|
|
28910
29658
|
PushDecisionGateStep,
|
|
28911
29659
|
{
|
|
28912
29660
|
summary,
|
|
@@ -28938,7 +29686,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28938
29686
|
);
|
|
28939
29687
|
}
|
|
28940
29688
|
case "credentials":
|
|
28941
|
-
return /* @__PURE__ */
|
|
29689
|
+
return /* @__PURE__ */ jsx65(
|
|
28942
29690
|
CredentialsStep,
|
|
28943
29691
|
{
|
|
28944
29692
|
initialSpaceId: state.spaceId,
|
|
@@ -28971,7 +29719,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28971
29719
|
);
|
|
28972
29720
|
case "push-from-picker":
|
|
28973
29721
|
case "previewing":
|
|
28974
|
-
return /* @__PURE__ */
|
|
29722
|
+
return /* @__PURE__ */ jsx65(
|
|
28975
29723
|
RunningStep,
|
|
28976
29724
|
{
|
|
28977
29725
|
stepNumber: totalSteps,
|
|
@@ -28984,7 +29732,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
28984
29732
|
const editableComponentCount = Object.keys(state.manifest?.componentsManifest ?? {}).filter(
|
|
28985
29733
|
(k) => k !== "$schema"
|
|
28986
29734
|
).length;
|
|
28987
|
-
return /* @__PURE__ */
|
|
29735
|
+
return /* @__PURE__ */ jsx65(
|
|
28988
29736
|
WizardPreviewStep,
|
|
28989
29737
|
{
|
|
28990
29738
|
preview: state.serverPreview,
|
|
@@ -29014,9 +29762,9 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
29014
29762
|
);
|
|
29015
29763
|
}
|
|
29016
29764
|
case "pushing":
|
|
29017
|
-
return /* @__PURE__ */
|
|
29765
|
+
return /* @__PURE__ */ jsx65(PushingStep, { stepNumber: totalSteps, totalSteps, progress: state.pushProgress });
|
|
29018
29766
|
case "path-prompt":
|
|
29019
|
-
return /* @__PURE__ */
|
|
29767
|
+
return /* @__PURE__ */ jsx65(
|
|
29020
29768
|
PathPrompt,
|
|
29021
29769
|
{
|
|
29022
29770
|
defaultPath: state.outDir,
|
|
@@ -29035,7 +29783,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
29035
29783
|
}
|
|
29036
29784
|
);
|
|
29037
29785
|
case "save-conflict-gate":
|
|
29038
|
-
return /* @__PURE__ */
|
|
29786
|
+
return /* @__PURE__ */ jsx65(
|
|
29039
29787
|
SaveConflictGate,
|
|
29040
29788
|
{
|
|
29041
29789
|
path: state.outDir,
|
|
@@ -29053,7 +29801,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
29053
29801
|
}
|
|
29054
29802
|
);
|
|
29055
29803
|
case "printing":
|
|
29056
|
-
return /* @__PURE__ */
|
|
29804
|
+
return /* @__PURE__ */ jsx65(
|
|
29057
29805
|
RunningStep,
|
|
29058
29806
|
{
|
|
29059
29807
|
stepNumber: totalSteps,
|
|
@@ -29064,7 +29812,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
29064
29812
|
);
|
|
29065
29813
|
case "print-gate": {
|
|
29066
29814
|
const teaser = buildRunTeaserLine(state.lastRunId);
|
|
29067
|
-
return /* @__PURE__ */
|
|
29815
|
+
return /* @__PURE__ */ jsx65(
|
|
29068
29816
|
GateStep,
|
|
29069
29817
|
{
|
|
29070
29818
|
successMessage: "Files saved",
|
|
@@ -29083,7 +29831,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
29083
29831
|
case "done": {
|
|
29084
29832
|
const totalFailed = state.pushResult.componentTypes.failed + state.pushResult.designTokens.failed;
|
|
29085
29833
|
const teaser = buildRunTeaserLine(state.lastRunId);
|
|
29086
|
-
return /* @__PURE__ */
|
|
29834
|
+
return /* @__PURE__ */ jsx65(
|
|
29087
29835
|
DoneStep,
|
|
29088
29836
|
{
|
|
29089
29837
|
componentTypes: state.pushResult.componentTypes,
|
|
@@ -29099,7 +29847,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
29099
29847
|
);
|
|
29100
29848
|
}
|
|
29101
29849
|
case "preview-validation-error": {
|
|
29102
|
-
return /* @__PURE__ */
|
|
29850
|
+
return /* @__PURE__ */ jsx65(
|
|
29103
29851
|
PreviewValidationErrorStep,
|
|
29104
29852
|
{
|
|
29105
29853
|
errors: state.previewValidationErrors,
|
|
@@ -29115,7 +29863,7 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
29115
29863
|
);
|
|
29116
29864
|
}
|
|
29117
29865
|
case "error":
|
|
29118
|
-
return /* @__PURE__ */
|
|
29866
|
+
return /* @__PURE__ */ jsx65(
|
|
29119
29867
|
ErrorStep,
|
|
29120
29868
|
{
|
|
29121
29869
|
stepName: state.errorStep,
|
|
@@ -29128,9 +29876,9 @@ If using a custom --host, make sure the space exists on that host.`
|
|
|
29128
29876
|
return null;
|
|
29129
29877
|
}
|
|
29130
29878
|
})();
|
|
29131
|
-
return /* @__PURE__ */
|
|
29132
|
-
/* @__PURE__ */
|
|
29133
|
-
/* @__PURE__ */
|
|
29879
|
+
return /* @__PURE__ */ jsxs58(Box57, { flexDirection: "column", width: terminalWidth, children: [
|
|
29880
|
+
/* @__PURE__ */ jsx65(TopBar, { subcommand: "import", hints }),
|
|
29881
|
+
/* @__PURE__ */ jsx65(CustomPromptBanner, { selectPromptPath, generatePromptPath }),
|
|
29134
29882
|
stepContent
|
|
29135
29883
|
] });
|
|
29136
29884
|
}
|
|
@@ -29318,15 +30066,15 @@ var push_creds_prompt_exports = {};
|
|
|
29318
30066
|
__export(push_creds_prompt_exports, {
|
|
29319
30067
|
promptForPushCredentials: () => promptForPushCredentials
|
|
29320
30068
|
});
|
|
29321
|
-
import
|
|
30069
|
+
import React27 from "react";
|
|
29322
30070
|
async function promptForPushCredentials(opts = {}) {
|
|
29323
|
-
const { render: render7, Box:
|
|
29324
|
-
const { useState:
|
|
30071
|
+
const { render: render7, Box: Box58, Text: Text62 } = await import("ink");
|
|
30072
|
+
const { useState: useState34 } = await import("react");
|
|
29325
30073
|
const { CredentialsStep: CredentialsStep2 } = await Promise.resolve().then(() => (init_CredentialsStep(), CredentialsStep_exports));
|
|
29326
30074
|
return new Promise((resolve29, reject) => {
|
|
29327
30075
|
let app = null;
|
|
29328
30076
|
function App2() {
|
|
29329
|
-
const [done, setDone] =
|
|
30077
|
+
const [done, setDone] = useState34(false);
|
|
29330
30078
|
const handle = (spaceId, environmentId, cmaToken, host) => {
|
|
29331
30079
|
if (done) return;
|
|
29332
30080
|
setDone(true);
|
|
@@ -29336,9 +30084,9 @@ async function promptForPushCredentials(opts = {}) {
|
|
|
29336
30084
|
});
|
|
29337
30085
|
};
|
|
29338
30086
|
if (done) {
|
|
29339
|
-
return
|
|
30087
|
+
return React27.createElement(Box58, null, React27.createElement(Text62, null, ""));
|
|
29340
30088
|
}
|
|
29341
|
-
return
|
|
30089
|
+
return React27.createElement(CredentialsStep2, {
|
|
29342
30090
|
summary: opts.summary ?? "Enter Contentful credentials to push this run. Press Enter on each field to advance.",
|
|
29343
30091
|
...opts.initialSpaceId !== void 0 ? { initialSpaceId: opts.initialSpaceId } : {},
|
|
29344
30092
|
...opts.initialEnvironmentId !== void 0 ? { initialEnvironmentId: opts.initialEnvironmentId } : {},
|
|
@@ -29352,7 +30100,7 @@ async function promptForPushCredentials(opts = {}) {
|
|
|
29352
30100
|
}
|
|
29353
30101
|
});
|
|
29354
30102
|
}
|
|
29355
|
-
app = render7(
|
|
30103
|
+
app = render7(React27.createElement(App2));
|
|
29356
30104
|
});
|
|
29357
30105
|
}
|
|
29358
30106
|
var init_push_creds_prompt = __esm({
|
|
@@ -29520,11 +30268,11 @@ init_db();
|
|
|
29520
30268
|
init_cache_keys();
|
|
29521
30269
|
|
|
29522
30270
|
// packages/experience-design-system-cli/src/helpers/read-existing-contentful-entities-from-session.ts
|
|
29523
|
-
import { readFile as
|
|
30271
|
+
import { readFile as readFile12 } from "node:fs/promises";
|
|
29524
30272
|
async function readExistingContentfulEntitiesFromSession(path) {
|
|
29525
30273
|
if (!path) return void 0;
|
|
29526
30274
|
try {
|
|
29527
|
-
const raw = await
|
|
30275
|
+
const raw = await readFile12(path, "utf8");
|
|
29528
30276
|
const parsed = JSON.parse(raw);
|
|
29529
30277
|
if (!Array.isArray(parsed.components) || !Array.isArray(parsed.tokens)) return void 0;
|
|
29530
30278
|
return parsed;
|
|
@@ -30515,6 +31263,7 @@ ${error instanceof Error ? error.message : String(error)}
|
|
|
30515
31263
|
// packages/experience-design-system-cli/src/analyze/command.ts
|
|
30516
31264
|
init_db();
|
|
30517
31265
|
init_cycle_detection();
|
|
31266
|
+
init_composition_mode();
|
|
30518
31267
|
|
|
30519
31268
|
// packages/experience-design-system-cli/src/analyze/composition/interchange-schema.ts
|
|
30520
31269
|
function validateInterchangeMap(input) {
|
|
@@ -31331,6 +32080,7 @@ async function resolvePromptOverride(override) {
|
|
|
31331
32080
|
|
|
31332
32081
|
// packages/experience-design-system-cli/src/analyze/command.ts
|
|
31333
32082
|
init_src();
|
|
32083
|
+
init_credentials_store();
|
|
31334
32084
|
|
|
31335
32085
|
// packages/experience-design-system-cli/src/analyze/build-analyze-view-rows.ts
|
|
31336
32086
|
var WARNING_PREFIX_SUFFIX = ":";
|
|
@@ -31470,6 +32220,13 @@ async function collectSourceFiles(directory, onProgress) {
|
|
|
31470
32220
|
await visit(directory);
|
|
31471
32221
|
return files.sort();
|
|
31472
32222
|
}
|
|
32223
|
+
async function safeReadCompositionMode() {
|
|
32224
|
+
try {
|
|
32225
|
+
return (await readExperiencesCredentials()).compositionMode;
|
|
32226
|
+
} catch {
|
|
32227
|
+
return void 0;
|
|
32228
|
+
}
|
|
32229
|
+
}
|
|
31473
32230
|
function componentsToInterchangeMap(components) {
|
|
31474
32231
|
const groups = {};
|
|
31475
32232
|
for (const c2 of components) {
|
|
@@ -31512,7 +32269,13 @@ function registerAnalyzeCommand(program) {
|
|
|
31512
32269
|
"--resolve-unreachable <mode>",
|
|
31513
32270
|
"Retry pass for unresolved Svelte Props types: 'auto' (default), 'always', or 'never'",
|
|
31514
32271
|
"auto"
|
|
31515
|
-
).option("--
|
|
32272
|
+
).option("--composite", "Resolve embedded-component composition (opt in; default is atomic)").option("--atomic", "Skip composition resolution \u2014 flat components only (default)").option("--composition-map <path>", "Consume a hand-authored parent\u2192children interchange map (implies --composite)").option(
|
|
32273
|
+
"--composition-agent",
|
|
32274
|
+
"Opt into agentic mapping resolution when deterministic sources find no groups (implies --composite)"
|
|
32275
|
+
).option(
|
|
32276
|
+
"--composition-refresh",
|
|
32277
|
+
"Force the mapping agent to run even where deterministic sources answered (implies --composite)"
|
|
32278
|
+
).option("--generate-map <path>", "Write a skeleton interchange map from resolved composition (implies --composite)").option(
|
|
31516
32279
|
"--prompt <stage=value>",
|
|
31517
32280
|
"Override a stage prompt (repeatable). value is a file path or literal text, e.g. --prompt composition=./p.md",
|
|
31518
32281
|
(v, acc) => [...acc, v],
|
|
@@ -31630,7 +32393,8 @@ function registerAnalyzeCommand(program) {
|
|
|
31630
32393
|
});
|
|
31631
32394
|
}
|
|
31632
32395
|
let validatedComponents = validateExtractedComponents(filteredComponents);
|
|
31633
|
-
|
|
32396
|
+
const compositionMode = resolveCompositionMode(opts, await safeReadCompositionMode() ?? void 0);
|
|
32397
|
+
if (compositionMode === "composite") {
|
|
31634
32398
|
const sources = resolveCompositionSources(opts);
|
|
31635
32399
|
const { overrides: promptOverrides, errors: promptErrors } = parsePromptOverrides(opts.prompt ?? []);
|
|
31636
32400
|
for (const err of promptErrors) {
|
|
@@ -34256,14 +35020,17 @@ async function runPipeline(opts, progressWriter, cliPathOverride) {
|
|
|
34256
35020
|
});
|
|
34257
35021
|
const t0 = Date.now();
|
|
34258
35022
|
const analyzeArgs = ["analyze", "extract", "--project", projectRoot];
|
|
34259
|
-
if (opts.
|
|
34260
|
-
|
|
34261
|
-
|
|
34262
|
-
|
|
34263
|
-
|
|
34264
|
-
|
|
34265
|
-
|
|
34266
|
-
|
|
35023
|
+
if (opts.compositionMode === "composite") {
|
|
35024
|
+
analyzeArgs.push("--composite");
|
|
35025
|
+
if (opts.compositionMap) analyzeArgs.push("--composition-map", opts.compositionMap);
|
|
35026
|
+
if (opts.compositionAgent) analyzeArgs.push("--composition-agent");
|
|
35027
|
+
if (opts.compositionAgentMode) analyzeArgs.push("--composition-agent-mode", opts.compositionAgentMode);
|
|
35028
|
+
if (opts.compositionRefresh) analyzeArgs.push("--composition-refresh");
|
|
35029
|
+
if (opts.generateMap) analyzeArgs.push("--generate-map", opts.generateMap);
|
|
35030
|
+
for (const p of opts.promptOverrides ?? []) analyzeArgs.push("--prompt", p);
|
|
35031
|
+
if (opts.agent) analyzeArgs.push("--agent", opts.agent);
|
|
35032
|
+
if (opts.bedrock) analyzeArgs.push("--bedrock");
|
|
35033
|
+
}
|
|
34267
35034
|
const r = await runStep(analyzeArgs, cliPath, sessionId2);
|
|
34268
35035
|
const durationMs = Date.now() - t0;
|
|
34269
35036
|
if (r.exitCode !== 0) {
|
|
@@ -34757,6 +35524,7 @@ function resolveModel(flagValue, storedValue) {
|
|
|
34757
35524
|
}
|
|
34758
35525
|
|
|
34759
35526
|
// packages/experience-design-system-cli/src/import/command.ts
|
|
35527
|
+
init_composition_mode();
|
|
34760
35528
|
init_command_options();
|
|
34761
35529
|
init_save_path_resolver();
|
|
34762
35530
|
init_credentials_store();
|
|
@@ -34846,6 +35614,7 @@ async function launchModifyWizard(input) {
|
|
|
34846
35614
|
initialStep: input.entryStep
|
|
34847
35615
|
};
|
|
34848
35616
|
applyWizardSeedProps(props, input);
|
|
35617
|
+
if (input.compositionMode) props.compositionMode = input.compositionMode;
|
|
34849
35618
|
if (input.saveMode === "overwrite") props.outDirOverride = input.savePath;
|
|
34850
35619
|
if (input.outDirOverride) props.outDirOverride = input.outDirOverride;
|
|
34851
35620
|
if (input.allowDeletions !== void 0) props.allowDeletions = input.allowDeletions;
|
|
@@ -34961,6 +35730,7 @@ async function modifyRun(opts) {
|
|
|
34961
35730
|
savePath: run.savePath,
|
|
34962
35731
|
entryStep: "final-review",
|
|
34963
35732
|
saveMode,
|
|
35733
|
+
...run.compositionMode ? { compositionMode: run.compositionMode } : {},
|
|
34964
35734
|
...opts.outDir ? { outDirOverride: resolve26(opts.outDir) } : {},
|
|
34965
35735
|
...mergedSpaceId ? { initialSpaceId: mergedSpaceId } : {},
|
|
34966
35736
|
...mergedEnvironmentId ? { initialEnvironmentId: mergedEnvironmentId } : {},
|
|
@@ -35164,14 +35934,21 @@ function registerImportCommand(program) {
|
|
|
35164
35934
|
"--print-prompt",
|
|
35165
35935
|
"Print the generate components prompt without invoking the agent. Replaces the legacy --dry-run prompt-print behaviour on this command."
|
|
35166
35936
|
).option("--auto-accept-scope", "Accept all extracted components without prompting (for scripted/non-TTY callers)");
|
|
35937
|
+
addCompositionOptions(cmd);
|
|
35167
35938
|
addAllowDeletionsOption(cmd);
|
|
35168
|
-
cmd.option("--composition-map <path>", "Consume a hand-authored parent\u2192children interchange map
|
|
35939
|
+
cmd.option("--composition-map <path>", "Consume a hand-authored parent\u2192children interchange map (implies --composite)").option(
|
|
35940
|
+
"--composition-agent",
|
|
35941
|
+
"Opt into agentic mapping resolution when deterministic sources find no groups (implies --composite)"
|
|
35942
|
+
).option(
|
|
35169
35943
|
"--composition-refresh",
|
|
35170
|
-
"Bypass the composition cache and re-resolve from scratch, forcing the agent to run"
|
|
35944
|
+
"Bypass the composition cache and re-resolve from scratch, forcing the agent to run (implies --composite)"
|
|
35171
35945
|
).option(
|
|
35172
35946
|
"--composition-agent-mode <mode>",
|
|
35173
35947
|
"Agent mode: 'parser' (agent writes a sandboxed parser, default) or 'edges' (agent lists edges)"
|
|
35174
|
-
).option(
|
|
35948
|
+
).option(
|
|
35949
|
+
"--generate-map <path>",
|
|
35950
|
+
"Also write a composition-map skeleton from resolved edges during extract (implies --composite)"
|
|
35951
|
+
).option(
|
|
35175
35952
|
"--prompt <stage=value>",
|
|
35176
35953
|
"Override a stage prompt (repeatable). value is a file path or literal text, e.g. --prompt composition=./p.md",
|
|
35177
35954
|
(v, acc) => [...acc, v],
|
|
@@ -35216,6 +35993,8 @@ function registerImportCommand(program) {
|
|
|
35216
35993
|
const interactiveTerminalSupported = getInteractiveTerminalSupport().supported;
|
|
35217
35994
|
if (opts.modify !== void 0 || opts.pushFromRun !== void 0) {
|
|
35218
35995
|
const passedCompositionFlags = [
|
|
35996
|
+
opts.composite ? "--composite" : null,
|
|
35997
|
+
opts.atomic ? "--atomic" : null,
|
|
35219
35998
|
opts.compositionMap ? "--composition-map" : null,
|
|
35220
35999
|
opts.compositionAgent ? "--composition-agent" : null,
|
|
35221
36000
|
opts.compositionAgentMode ? "--composition-agent-mode" : null,
|
|
@@ -35225,9 +36004,11 @@ function registerImportCommand(program) {
|
|
|
35225
36004
|
if (passedCompositionFlags.length > 0) {
|
|
35226
36005
|
const entry = opts.modify !== void 0 ? "--modify" : "--push-from-run";
|
|
35227
36006
|
process.stderr.write(
|
|
35228
|
-
`Note: ${passedCompositionFlags.join(", ")} ignored with ${entry} \u2014 composition
|
|
36007
|
+
`Note: ${passedCompositionFlags.join(", ")} ignored with ${entry} \u2014 composition mode comes from the recorded run.
|
|
35229
36008
|
`
|
|
35230
36009
|
);
|
|
36010
|
+
opts.composite = void 0;
|
|
36011
|
+
opts.atomic = void 0;
|
|
35231
36012
|
opts.compositionMap = void 0;
|
|
35232
36013
|
opts.compositionAgent = void 0;
|
|
35233
36014
|
opts.compositionAgentMode = void 0;
|
|
@@ -35380,6 +36161,7 @@ function registerImportCommand(program) {
|
|
|
35380
36161
|
const creds = await readExperiencesCredentials();
|
|
35381
36162
|
const resolvedAgent = resolveAgent(opts.agent, creds.agent);
|
|
35382
36163
|
const resolvedModel = resolveModel(opts.model, creds.agentModel);
|
|
36164
|
+
const resolvedCompositionMode = resolveCompositionMode(opts, creds.compositionMode);
|
|
35383
36165
|
if (opts.bedrock && !(isAgentName(resolvedAgent) && agentSupportsBedrock(resolvedAgent))) {
|
|
35384
36166
|
process.stderr.write(`Error: --bedrock is not supported for --agent ${resolvedAgent}
|
|
35385
36167
|
`);
|
|
@@ -35418,6 +36200,7 @@ function registerImportCommand(program) {
|
|
|
35418
36200
|
host: opts.host,
|
|
35419
36201
|
autoAcceptScope,
|
|
35420
36202
|
autoRejectCycles: opts.autoRejectCycles ?? false,
|
|
36203
|
+
compositionMode: resolvedCompositionMode,
|
|
35421
36204
|
...buildCompositionForwardingOptions(opts),
|
|
35422
36205
|
noCache: opts.cache === false,
|
|
35423
36206
|
skipMapTokens: opts.skipMapTokens ?? false,
|
|
@@ -35464,6 +36247,7 @@ function registerImportCommand(program) {
|
|
|
35464
36247
|
const headlessCreds = await readExperiencesCredentials();
|
|
35465
36248
|
const headlessAgent = resolveAgent(opts.agent, headlessCreds.agent);
|
|
35466
36249
|
const headlessModel = resolveModel(opts.model, headlessCreds.agentModel);
|
|
36250
|
+
const headlessCompositionMode = resolveCompositionMode(opts, headlessCreds.compositionMode);
|
|
35467
36251
|
if (opts.bedrock && !(isAgentName(headlessAgent) && agentSupportsBedrock(headlessAgent))) {
|
|
35468
36252
|
process.stderr.write(`Error: --bedrock is not supported for --agent ${headlessAgent}
|
|
35469
36253
|
`);
|
|
@@ -35498,6 +36282,7 @@ function registerImportCommand(program) {
|
|
|
35498
36282
|
selectPromptPath: opts.selectPromptPath,
|
|
35499
36283
|
autoRejectCycles: opts.autoRejectCycles ?? false,
|
|
35500
36284
|
allowDeletions: opts.allowDeletions ?? false,
|
|
36285
|
+
compositionMode: headlessCompositionMode,
|
|
35501
36286
|
...buildCompositionForwardingOptions(opts)
|
|
35502
36287
|
},
|
|
35503
36288
|
(line) => process.stderr.write(line + "\n")
|