@contentful/experience-design-system-cli 2.34.5-dev-build-dd4c89b.0 → 2.34.5-dev-build-0fafac5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/index.js CHANGED
@@ -11781,8 +11781,6 @@ 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.
11786
11784
  previewStatus = "done",
11787
11785
  removedScrollOffset = 0
11788
11786
  }) {
@@ -14298,33 +14296,6 @@ var init_SelectView = __esm({
14298
14296
  }
14299
14297
  });
14300
14298
 
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
-
14328
14299
  // packages/experience-design-system-cli/src/lib/command-options.ts
14329
14300
  function addArtifactInputOptions(cmd) {
14330
14301
  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");
@@ -14332,9 +14303,6 @@ function addArtifactInputOptions(cmd) {
14332
14303
  function addContentfulTargetOptions(cmd) {
14333
14304
  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");
14334
14305
  }
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
- }
14338
14306
  function collectOptionValue(value, previous) {
14339
14307
  return [...previous, value];
14340
14308
  }
@@ -14353,116 +14321,9 @@ var init_command_options = __esm({
14353
14321
  }
14354
14322
  });
14355
14323
 
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
-
14463
14324
  // packages/experience-design-system-cli/src/analytics/client.ts
14464
14325
  import { readFileSync as readFileSync7 } from "node:fs";
14465
- import { join as join12 } from "node:path";
14326
+ import { join as join11 } from "node:path";
14466
14327
  import { Analytics } from "@segment/analytics-node";
14467
14328
  function cliVersion() {
14468
14329
  return pkg2.version;
@@ -14516,7 +14377,7 @@ var init_client2 = __esm({
14516
14377
  "packages/experience-design-system-cli/src/analytics/client.ts"() {
14517
14378
  "use strict";
14518
14379
  init_cli_path();
14519
- pkg2 = JSON.parse(readFileSync7(join12(findPkgRoot(), "package.json"), "utf8"));
14380
+ pkg2 = JSON.parse(readFileSync7(join11(findPkgRoot(), "package.json"), "utf8"));
14520
14381
  DEFAULT_WRITE_KEY = "6DmxiEPN3SV1vbRTTMcNqDzCvkfwT06N";
14521
14382
  analyticsClient = null;
14522
14383
  persistedDisabled = false;
@@ -14812,8 +14673,8 @@ var init_path_exists = __esm({
14812
14673
  // packages/experience-design-system-cli/src/apply/command.ts
14813
14674
  import { createElement, useState as useState6 } from "react";
14814
14675
  import { render, useInput as useInput2 } from "ink";
14815
- import { readFile as readFile9, readdir, stat } from "node:fs/promises";
14816
- import { join as join13 } from "node:path";
14676
+ import { readFile as readFile8, readdir, stat } from "node:fs/promises";
14677
+ import { join as join12 } from "node:path";
14817
14678
  import {
14818
14679
  validateCDF,
14819
14680
  flattenDTCG as flattenDTCG2,
@@ -14835,7 +14696,7 @@ async function assertFileExists(flag, p) {
14835
14696
  async function readJsonFile(flag, p) {
14836
14697
  let text;
14837
14698
  try {
14838
- text = await readFile9(p, "utf8");
14699
+ text = await readFile8(p, "utf8");
14839
14700
  } catch {
14840
14701
  return await die(`Error: file not found: ${p} (from ${flag})`);
14841
14702
  }
@@ -14857,7 +14718,7 @@ async function collectJsonFiles(dir) {
14857
14718
  await Promise.all(
14858
14719
  entries.map(async (entry) => {
14859
14720
  if (IGNORE_TOKEN_DIRS.has(entry)) return;
14860
- const full = join13(current, entry);
14721
+ const full = join12(current, entry);
14861
14722
  let s;
14862
14723
  try {
14863
14724
  s = await stat(full);
@@ -14889,7 +14750,7 @@ async function readTokensFromPath(flag, p) {
14889
14750
  for (const file of files.sort()) {
14890
14751
  let text;
14891
14752
  try {
14892
- text = await readFile9(file, "utf8");
14753
+ text = await readFile8(file, "utf8");
14893
14754
  } catch {
14894
14755
  continue;
14895
14756
  }
@@ -14926,7 +14787,6 @@ ${errors.map((e) => ` ${e.path}: ${e.message}`).join("\n")}`
14926
14787
  function addSharedApplyOptions(command) {
14927
14788
  addArtifactInputOptions(command);
14928
14789
  addContentfulTargetOptions(command);
14929
- addCompositionOptions(command);
14930
14790
  }
14931
14791
  function splitSelectedKeys(selectedKeys) {
14932
14792
  const selectedComponentKeys = /* @__PURE__ */ new Set();
@@ -15079,14 +14939,6 @@ async function resolveSharedInputs(opts) {
15079
14939
  }
15080
14940
  components = result.components;
15081
14941
  }
15082
- let configMode;
15083
- try {
15084
- configMode = (await readExperiencesCredentials()).compositionMode;
15085
- } catch {
15086
- }
15087
- if (resolveCompositionMode(opts, configMode) === "atomic") {
15088
- components = stripAllowedComponents(components);
15089
- }
15090
14942
  let tokens = [];
15091
14943
  if (opts.tokens) {
15092
14944
  tokens = await readTokensFromPath("--tokens", opts.tokens);
@@ -15574,10 +15426,7 @@ var init_command = __esm({
15574
15426
  init_ServerApplyView();
15575
15427
  init_SelectView();
15576
15428
  init_contentful_urls();
15577
- init_composition_mode();
15578
15429
  init_command_options();
15579
- init_strip_allowed_components();
15580
- init_credentials_store();
15581
15430
  init_terminal_capabilities();
15582
15431
  init_analytics();
15583
15432
  init_path_exists();
@@ -15596,7 +15445,7 @@ var init_manifest = __esm({
15596
15445
  // packages/experience-design-system-cli/src/analyze/select/tui/App.tsx
15597
15446
  import { useCallback as useCallback2, useEffect as useEffect2, useMemo, useRef as useRef2, useState as useState7 } from "react";
15598
15447
  import { Box as Box17, Text as Text18, useStdout as useStdout2 } from "ink";
15599
- import { readFile as readFile10 } from "node:fs/promises";
15448
+ import { readFile as readFile9 } from "node:fs/promises";
15600
15449
  import { buildManifest as buildManifest2 } from "@contentful/experience-design-system-types";
15601
15450
  import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
15602
15451
  function App({ sessionId: sessionId2, artifactsRoot, reviewRoot }) {
@@ -15761,7 +15610,7 @@ function App({ sessionId: sessionId2, artifactsRoot, reviewRoot }) {
15761
15610
  if (!session || !selectedId) return;
15762
15611
  const selectedComponent = session.components.find((c2) => c2.id === selectedId);
15763
15612
  if (!selectedComponent || selectedComponent.sourceCode !== null) return;
15764
- readFile10(selectedComponent.resolvedSourcePath, "utf8").then((code) => {
15613
+ readFile9(selectedComponent.resolvedSourcePath, "utf8").then((code) => {
15765
15614
  setSession((prev) => {
15766
15615
  if (!prev) return prev;
15767
15616
  return {
@@ -16276,7 +16125,7 @@ var init_component_patch = __esm({
16276
16125
  });
16277
16126
 
16278
16127
  // packages/experience-design-system-cli/src/analyze/select/command.ts
16279
- import { access as access4, readFile as readFile11 } from "node:fs/promises";
16128
+ import { access as access4, readFile as readFile10 } from "node:fs/promises";
16280
16129
  import { dirname as dirname10, resolve as resolve11 } from "node:path";
16281
16130
  import { createElement as createElement2 } from "react";
16282
16131
  import { render as render2 } from "ink";
@@ -16367,7 +16216,7 @@ async function runNonInteractive(snapshot, opts, paths, sessionId2) {
16367
16216
  if (opts.patch) {
16368
16217
  let patchOps;
16369
16218
  try {
16370
- const raw = await readFile11(resolve11(opts.patch), "utf8");
16219
+ const raw = await readFile10(resolve11(opts.patch), "utf8");
16371
16220
  const parsed = JSON.parse(raw);
16372
16221
  if (!Array.isArray(parsed)) {
16373
16222
  process.stderr.write(`Error: --patch file must be a JSON array of patch operations: ${opts.patch}
@@ -16425,7 +16274,7 @@ async function patchReviewStateWithValidationErrors(sessionId2, errors, opts = {
16425
16274
  let snapshot;
16426
16275
  try {
16427
16276
  await access4(paths.statePath);
16428
- snapshot = JSON.parse(await readFile11(paths.statePath, "utf8"));
16277
+ snapshot = JSON.parse(await readFile10(paths.statePath, "utf8"));
16429
16278
  } catch {
16430
16279
  snapshot = await loadAndValidateForReview(sessionId2, void 0);
16431
16280
  snapshot = await ensureRefineSession(sessionId2, artifactsRoot, snapshot);
@@ -16476,7 +16325,7 @@ async function rejectComponentsByName(sessionId2, names, opts = {}) {
16476
16325
  const nameSet = new Set(names);
16477
16326
  let snapshot;
16478
16327
  try {
16479
- snapshot = JSON.parse(await readFile11(paths.statePath, "utf8"));
16328
+ snapshot = JSON.parse(await readFile10(paths.statePath, "utf8"));
16480
16329
  } catch {
16481
16330
  return;
16482
16331
  }
@@ -16621,6 +16470,91 @@ var init_command2 = __esm({
16621
16470
  }
16622
16471
  });
16623
16472
 
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
+
16624
16558
  // packages/experience-design-system-cli/src/import/path-utils.ts
16625
16559
  import { resolve as resolve22 } from "node:path";
16626
16560
  import { homedir as homedir6 } from "node:os";
@@ -22059,29 +21993,13 @@ var init_ScopeGateStep = __esm({
22059
21993
  }
22060
21994
  });
22061
21995
 
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
21996
+ // packages/experience-design-system-cli/src/import/tui/scope-gate-host.tsx
22075
21997
  import { Box as Box43, Text as Text46 } from "ink";
22076
- import React20, { useMemo as useMemo6, useState as useState23 } from "react";
21998
+ import React20 from "react";
22077
21999
  import { jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
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({
22000
+ function ScopeGateHost({
22084
22001
  components,
22002
+ autoAccept,
22085
22003
  onConfirm,
22086
22004
  onQuit,
22087
22005
  aiFilterStatus = "idle",
@@ -22089,357 +22007,51 @@ function AtomicScopeGateStep({
22089
22007
  aiFilterError = null,
22090
22008
  onCancelAutoFilter
22091
22009
  }) {
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);
22010
+ if (components.length === 0) {
22011
+ return /* @__PURE__ */ jsx49(Box43, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx49(Text46, { color: PALETTE.error, children: "Error: no components found for this session \u2014 please re-run analyze extract." }) });
22012
+ }
22013
+ if (autoAccept) {
22014
+ return /* @__PURE__ */ jsx49(ScopeGateAutoAccept, { components, onConfirm });
22015
+ }
22016
+ return /* @__PURE__ */ jsx49(
22017
+ ScopeGateStep,
22018
+ {
22019
+ components: [...components],
22020
+ onConfirm,
22021
+ onQuit,
22022
+ aiFilterStatus,
22023
+ aiFilterProgress,
22024
+ aiFilterError,
22025
+ onCancelAutoFilter
22112
22026
  }
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;
22027
+ );
22028
+ }
22029
+ function ScopeGateAutoAccept({
22030
+ components,
22031
+ onConfirm
22032
+ }) {
22033
+ React20.useEffect(() => {
22034
+ onConfirm({ accepted: components.map((c2) => c2.name), rejected: [] });
22035
+ }, []);
22036
+ return /* @__PURE__ */ jsx49(Box43, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsxs44(Text46, { dimColor: true, children: [
22037
+ "Auto-accepting ",
22038
+ components.length,
22039
+ " components..."
22040
+ ] }) });
22041
+ }
22042
+ var init_scope_gate_host = __esm({
22043
+ "packages/experience-design-system-cli/src/import/tui/scope-gate-host.tsx"() {
22044
+ "use strict";
22045
+ init_theme();
22046
+ init_ScopeGateStep();
22047
+ }
22048
+ });
22049
+
22050
+ // packages/experience-design-system-cli/src/import/tui/merge-ai-decisions.ts
22051
+ function mergeAiDecisions(components, aiDecisions) {
22052
+ return components.map((component) => {
22053
+ if (component.aiDecision !== null && component.aiDecision !== void 0) {
22054
+ return component;
22443
22055
  }
22444
22056
  const streamed = aiDecisions[component.name];
22445
22057
  if (!streamed) {
@@ -22700,7 +22312,7 @@ var init_runLivePreview = __esm({
22700
22312
  });
22701
22313
 
22702
22314
  // packages/experience-design-system-cli/src/import/tui/useFinalizePreview.ts
22703
- import { useEffect as useEffect7, useRef as useRef5, useState as useState24 } from "react";
22315
+ import { useEffect as useEffect7, useRef as useRef5, useState as useState23 } from "react";
22704
22316
  function useReviewFinalizePreview({
22705
22317
  components,
22706
22318
  ...options
@@ -22712,9 +22324,9 @@ function useReviewFinalizePreview({
22712
22324
  }
22713
22325
  function useFinalizePreview(opts) {
22714
22326
  const { open, extractSessionId, tokensPath, spaceId, environmentId, cmaToken, host, acceptedKeys, allowDeletions } = opts;
22715
- const [status, setStatus] = useState24("idle");
22716
- const [removed, setRemoved] = useState24([]);
22717
- const [scrollOffset, setScrollOffset] = useState24(0);
22327
+ const [status, setStatus] = useState23("idle");
22328
+ const [removed, setRemoved] = useState23([]);
22329
+ const [scrollOffset, setScrollOffset] = useState23(0);
22718
22330
  const generationRef = useRef5(0);
22719
22331
  const acceptedKey = [...acceptedKeys].sort().join("\0");
22720
22332
  useEffect7(() => {
@@ -22930,14 +22542,14 @@ var init_scroll_offset = __esm({
22930
22542
  });
22931
22543
 
22932
22544
  // packages/experience-design-system-cli/src/analyze/select/tui/components/FieldEditor.tsx
22933
- import React22, { useState as useState25 } from "react";
22934
- import { Box as Box45, Text as Text48 } from "ink";
22545
+ import React21, { useState as useState24 } from "react";
22546
+ import { Box as Box44, Text as Text47 } from "ink";
22935
22547
  import {
22936
22548
  CDF_PROPERTY_TYPES,
22937
22549
  CDF_PROPERTY_CATEGORIES,
22938
22550
  DESIGN_TOKEN_TYPES as DESIGN_TOKEN_TYPES2
22939
22551
  } from "@contentful/experience-design-system-types";
22940
- import { Fragment as Fragment14, jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
22552
+ import { Fragment as Fragment14, jsx as jsx50, jsxs as jsxs45 } from "react/jsx-runtime";
22941
22553
  function removeAt(values, index) {
22942
22554
  return values.filter((_, i) => i !== index);
22943
22555
  }
@@ -23060,25 +22672,25 @@ function serializeState(state, originalJson) {
23060
22672
  return JSON.stringify(entry, null, 2);
23061
22673
  }
23062
22674
  function Picker({ value, active }) {
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" })
22675
+ return /* @__PURE__ */ jsxs45(Box44, { children: [
22676
+ active && /* @__PURE__ */ jsx50(Text47, { color: PALETTE.info, children: "\u2039" }),
22677
+ /* @__PURE__ */ jsx50(Text47, { color: active ? PALETTE.info : PALETTE.inverse, bold: active, children: value }),
22678
+ active && /* @__PURE__ */ jsx50(Text47, { color: PALETTE.info, children: "\u203A" })
23067
22679
  ] });
23068
22680
  }
23069
22681
  function Toggle({ value, active }) {
23070
- return /* @__PURE__ */ jsx51(Box45, { children: /* @__PURE__ */ jsx51(Text48, { color: active ? PALETTE.info : value ? PALETTE.success : void 0, children: value ? "[\u2713]" : "[ ]" }) });
22682
+ return /* @__PURE__ */ jsx50(Box44, { children: /* @__PURE__ */ jsx50(Text47, { color: active ? PALETTE.info : value ? PALETTE.success : void 0, children: value ? "[\u2713]" : "[ ]" }) });
23071
22683
  }
23072
22684
  function DefaultValueRow({ display, active }) {
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 })
22685
+ return /* @__PURE__ */ jsxs45(Box44, { paddingLeft: 2, gap: 1, children: [
22686
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "default:" }),
22687
+ active ? /* @__PURE__ */ jsx50(Picker, { value: display, active: true }) : /* @__PURE__ */ jsx50(Text47, { color: PALETTE.inverse, children: display })
23076
22688
  ] });
23077
22689
  }
23078
22690
  function RowLabel({ name, selected }) {
23079
22691
  const nameDisplay = name.length > 14 ? name.slice(0, 13) + "\u2026" : name.padEnd(14);
23080
- return /* @__PURE__ */ jsxs46(
23081
- Text48,
22692
+ return /* @__PURE__ */ jsxs45(
22693
+ Text47,
23082
22694
  {
23083
22695
  color: selected ? PALETTE.inverse : PALETTE.info,
23084
22696
  bold: selected,
@@ -23096,10 +22708,10 @@ function ValueInputRow({
23096
22708
  valueText,
23097
22709
  cursorVisible
23098
22710
  }) {
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: " " })
22711
+ return /* @__PURE__ */ jsxs45(Box44, { paddingLeft: 2, children: [
22712
+ /* @__PURE__ */ jsx50(Text47, { color: PALETTE.info, children: mode === "edit" ? "\u270E " : "+ " }),
22713
+ /* @__PURE__ */ jsx50(Text47, { children: valueText }),
22714
+ /* @__PURE__ */ jsx50(Text47, { inverse: cursorVisible, children: " " })
23103
22715
  ] });
23104
22716
  }
23105
22717
  function EditableListItem({
@@ -23112,9 +22724,9 @@ function EditableListItem({
23112
22724
  }) {
23113
22725
  const isBeingEdited = editingValue?.mode === "edit" && editingValue.index === index;
23114
22726
  if (isBeingEdited) {
23115
- return /* @__PURE__ */ jsx51(ValueInputRow, { mode: "edit", valueText, cursorVisible });
22727
+ return /* @__PURE__ */ jsx50(ValueInputRow, { mode: "edit", valueText, cursorVisible });
23116
22728
  }
23117
- return /* @__PURE__ */ jsx51(Box45, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx51(Text48, { color: active ? PALETTE.info : PALETTE.inverse, children: active ? `\u25B6 ${value}` : ` ${value}` }) });
22729
+ return /* @__PURE__ */ jsx50(Box44, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx50(Text47, { color: active ? PALETTE.info : PALETTE.inverse, children: active ? `\u25B6 ${value}` : ` ${value}` }) });
23118
22730
  }
23119
22731
  function EditableValueList({
23120
22732
  values,
@@ -23127,9 +22739,9 @@ function EditableValueList({
23127
22739
  emptyPaddingLeft,
23128
22740
  showAddInput
23129
22741
  }) {
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(
22742
+ return /* @__PURE__ */ jsxs45(Fragment14, { children: [
22743
+ values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: emptyMessage }) : /* @__PURE__ */ jsx50(Box44, { paddingLeft: emptyPaddingLeft, children: /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: emptyMessage }) })),
22744
+ values.map((value, index) => /* @__PURE__ */ jsx50(
23133
22745
  EditableListItem,
23134
22746
  {
23135
22747
  value,
@@ -23141,7 +22753,7 @@ function EditableValueList({
23141
22753
  },
23142
22754
  index
23143
22755
  )),
23144
- showAddInput && editingValue?.mode === "add" && /* @__PURE__ */ jsx51(ValueInputRow, { mode: "add", valueText, cursorVisible })
22756
+ showAddInput && editingValue?.mode === "add" && /* @__PURE__ */ jsx50(ValueInputRow, { mode: "add", valueText, cursorVisible })
23145
22757
  ] });
23146
22758
  }
23147
22759
  function DefaultSubRow({
@@ -23152,39 +22764,39 @@ function DefaultSubRow({
23152
22764
  }) {
23153
22765
  const cursor = cursorVisible ? "\u2588" : " ";
23154
22766
  if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
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)" })
22767
+ return /* @__PURE__ */ jsxs45(Box44, { paddingLeft: 2, gap: 1, children: [
22768
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "default:" }),
22769
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "(not applicable)" })
23158
22770
  ] });
23159
22771
  }
23160
22772
  if (prop.type === "boolean") {
23161
22773
  const display = prop.default === true ? "true" : prop.default === false ? "false" : "(unset)";
23162
- return /* @__PURE__ */ jsx51(DefaultValueRow, { display, active });
22774
+ return /* @__PURE__ */ jsx50(DefaultValueRow, { display, active });
23163
22775
  }
23164
22776
  if (prop.type === "enum") {
23165
22777
  if (prop.values.length === 0) {
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)" })
22778
+ return /* @__PURE__ */ jsxs45(Box44, { paddingLeft: 2, gap: 1, children: [
22779
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "default:" }),
22780
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "(no values defined)" })
23169
22781
  ] });
23170
22782
  }
23171
22783
  const display = typeof prop.default === "string" && prop.default !== "" ? prop.default : "(unset)";
23172
- return /* @__PURE__ */ jsx51(DefaultValueRow, { display, active });
22784
+ return /* @__PURE__ */ jsx50(DefaultValueRow, { display, active });
23173
22785
  }
23174
22786
  const value = typeof prop.default === "string" ? prop.default : "";
23175
22787
  if (active) {
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) })
22788
+ return /* @__PURE__ */ jsxs45(Box44, { paddingLeft: 2, flexDirection: "row", children: [
22789
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "default:" }),
22790
+ /* @__PURE__ */ jsxs45(Box44, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
22791
+ /* @__PURE__ */ jsx50(Text47, { children: value.slice(0, textCursor) }),
22792
+ /* @__PURE__ */ jsx50(Text47, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
22793
+ /* @__PURE__ */ jsx50(Text47, { children: value.slice(textCursor + 1) })
23182
22794
  ] })
23183
22795
  ] });
23184
22796
  }
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)" })
22797
+ return /* @__PURE__ */ jsxs45(Box44, { paddingLeft: 2, gap: 1, children: [
22798
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "default:" }),
22799
+ /* @__PURE__ */ jsx50(Text47, { color: value ? PALETTE.inverse : void 0, dimColor: !value, children: value || "(none)" })
23188
22800
  ] });
23189
22801
  }
23190
22802
  function PropRow({
@@ -23202,28 +22814,28 @@ function PropRow({
23202
22814
  }) {
23203
22815
  const cursor = cursorVisible ? "\u2588" : " ";
23204
22816
  const descActive = activeField === "description";
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: [
22817
+ return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", width, children: [
22818
+ /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
22819
+ /* @__PURE__ */ jsx50(RowLabel, { name: prop.name, selected }),
22820
+ /* @__PURE__ */ jsx50(Text47, { dimColor: !selected, children: "type:" }),
22821
+ activeField === "type" ? /* @__PURE__ */ jsx50(Picker, { value: prop.type, active: true }) : /* @__PURE__ */ jsx50(Text47, { color: selected ? PALETTE.warning : PALETTE.inverse, children: prop.type }),
22822
+ activeField === "category" && /* @__PURE__ */ jsx50(Picker, { value: prop.category, active: true }),
22823
+ /* @__PURE__ */ jsx50(Text47, { dimColor: !selected, children: "req:" }),
22824
+ activeField === "required" ? /* @__PURE__ */ jsx50(Toggle, { value: prop.required, active: true }) : /* @__PURE__ */ jsx50(Toggle, { value: prop.required, active: false }),
22825
+ prop.type === "enum" && /* @__PURE__ */ jsxs45(Fragment14, { children: [
22826
+ /* @__PURE__ */ jsx50(Text47, { dimColor: !selected, children: "values:" }),
22827
+ /* @__PURE__ */ jsxs45(Text47, { color: selected ? PALETTE.warning : PALETTE.inverse, children: [
23216
22828
  "[",
23217
22829
  prop.values.join(", "),
23218
22830
  "]"
23219
22831
  ] })
23220
22832
  ] }),
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" })
22833
+ prop.type === "token" && /* @__PURE__ */ jsxs45(Fragment14, { children: [
22834
+ /* @__PURE__ */ jsx50(Text47, { dimColor: !selected, children: "kind:" }),
22835
+ activeField === "tokenKind" ? /* @__PURE__ */ jsx50(Picker, { value: prop.tokenKind || DESIGN_TOKEN_TYPES2[0], active: true }) : /* @__PURE__ */ jsx50(Text47, { color: selected ? PALETTE.success : PALETTE.inverse, children: prop.tokenKind || "\u2014" })
23224
22836
  ] })
23225
22837
  ] }),
23226
- selected && /* @__PURE__ */ jsx51(
22838
+ selected && /* @__PURE__ */ jsx50(
23227
22839
  DefaultSubRow,
23228
22840
  {
23229
22841
  prop,
@@ -23232,33 +22844,33 @@ function PropRow({
23232
22844
  cursorVisible
23233
22845
  }
23234
22846
  ),
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) })
22847
+ selected && descActive && /* @__PURE__ */ jsxs45(Box44, { paddingLeft: 2, flexDirection: "row", children: [
22848
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "desc:" }),
22849
+ /* @__PURE__ */ jsxs45(Box44, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
22850
+ /* @__PURE__ */ jsx50(Text47, { children: prop.description.slice(0, textCursor) }),
22851
+ /* @__PURE__ */ jsx50(Text47, { inverse: cursorVisible, children: prop.description[textCursor] ?? cursor }),
22852
+ /* @__PURE__ */ jsx50(Text47, { children: prop.description.slice(textCursor + 1) })
23241
22853
  ] })
23242
22854
  ] }),
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" })
22855
+ selected && !descActive && /* @__PURE__ */ jsxs45(Box44, { paddingLeft: 2, gap: 1, children: [
22856
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "desc:" }),
22857
+ /* @__PURE__ */ jsx50(Text47, { color: PALETTE.success, children: prop.description || "\u2014" })
23246
22858
  ] }),
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)" })
22859
+ selected && prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs45(Box44, { paddingLeft: 2, flexDirection: "row", gap: 1, children: [
22860
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "allowed:" }),
22861
+ activeField === "allowed" ? /* @__PURE__ */ jsx50(Box44, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "press [t] to edit allowed tokens" }) }) : /* @__PURE__ */ jsx50(Text47, { color: prop.allowed.length > 0 ? PALETTE.info : void 0, dimColor: prop.allowed.length === 0, children: prop.allowed.length > 0 ? prop.allowed.join(", ") : "(any)" })
23250
22862
  ] }),
23251
- selected && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx51(Box45, { paddingLeft: 2, children: /* @__PURE__ */ jsx51(Text48, { dimColor: true, children: (() => {
22863
+ selected && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx50(Box44, { paddingLeft: 2, children: /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: (() => {
23252
22864
  const max = Math.max(8, width - 8);
23253
22865
  const text = `~ ${rationale}`;
23254
22866
  return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
23255
22867
  })() }) }, rowKey ? `rationale-${rowKey}` : void 0),
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" })
22868
+ selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs45(Box44, { paddingLeft: 2, flexDirection: "column", children: [
22869
+ /* @__PURE__ */ jsxs45(Box44, { children: [
22870
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "values:" }),
22871
+ activeField === "values" && /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: " [a]dd [e]dit [r]emove [\u2191\u2193] navigate [K/J] reorder" })
23260
22872
  ] }),
23261
- /* @__PURE__ */ jsx51(
22873
+ /* @__PURE__ */ jsx50(
23262
22874
  EditableValueList,
23263
22875
  {
23264
22876
  values: prop.values,
@@ -23288,22 +22900,22 @@ function SlotRow({
23288
22900
  pickerCursor
23289
22901
  }) {
23290
22902
  const cursor = cursorVisible ? "\u2588" : " ";
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 })
22903
+ return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", width, children: [
22904
+ /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
22905
+ /* @__PURE__ */ jsx50(RowLabel, { name: slot.name, selected }),
22906
+ /* @__PURE__ */ jsx50(Text47, { dimColor: !selected, children: "req:" }),
22907
+ activeField === "required" ? /* @__PURE__ */ jsx50(Toggle, { value: slot.required, active: true }) : /* @__PURE__ */ jsx50(Toggle, { value: slot.required, active: false })
23296
22908
  ] }),
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(", ") })
22909
+ !selected && /* @__PURE__ */ jsxs45(Box44, { paddingLeft: 2, gap: 1, children: [
22910
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "allowed:" }),
22911
+ slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "(any)" }) : /* @__PURE__ */ jsx50(Text47, { color: PALETTE.info, children: slot.allowedComponents.join(", ") })
23300
22912
  ] }),
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" })
22913
+ selected && /* @__PURE__ */ jsxs45(Box44, { paddingLeft: 2, flexDirection: "column", children: [
22914
+ /* @__PURE__ */ jsxs45(Box44, { children: [
22915
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "allowed:" }),
22916
+ activeField === "allowedComponents" && /* @__PURE__ */ jsx50(Text47, { 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" })
23305
22917
  ] }),
23306
- /* @__PURE__ */ jsx51(
22918
+ /* @__PURE__ */ jsx50(
23307
22919
  EditableValueList,
23308
22920
  {
23309
22921
  values: slot.allowedComponents,
@@ -23317,36 +22929,36 @@ function SlotRow({
23317
22929
  showAddInput: activeField === "allowedComponents"
23318
22930
  }
23319
22931
  ),
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)" }) : (() => {
22932
+ editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx50(Box44, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "(no valid components to add \u2014 all remaining candidates would create cycles)" }) : (() => {
23321
22933
  const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
23322
22934
  if (filtered.length === 0) {
23323
- return /* @__PURE__ */ jsx51(Text48, { dimColor: true, children: "(no candidates match \u2014 Enter to add as free text)" });
22935
+ return /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "(no candidates match \u2014 Enter to add as free text)" });
23324
22936
  }
23325
22937
  const cursor2 = pickerCursor % filtered.length;
23326
22938
  const MAX_VISIBLE = 5;
23327
22939
  const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor2 - 2));
23328
22940
  const slice = filtered.slice(start, start + MAX_VISIBLE);
23329
- return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", children: [
23330
- /* @__PURE__ */ jsx51(Text48, { dimColor: true, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
22941
+ return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", children: [
22942
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
23331
22943
  slice.map((name, i) => {
23332
22944
  const absIdx = start + i;
23333
22945
  const isCursor = absIdx === cursor2;
23334
- return /* @__PURE__ */ jsx51(Text48, { color: isCursor ? PALETTE.info : void 0, dimColor: !isCursor, children: isCursor ? ` \u25B6 ${name}` : ` ${name}` }, name);
22946
+ return /* @__PURE__ */ jsx50(Text47, { color: isCursor ? PALETTE.info : void 0, dimColor: !isCursor, children: isCursor ? ` \u25B6 ${name}` : ` ${name}` }, name);
23335
22947
  })
23336
22948
  ] });
23337
22949
  })() })
23338
22950
  ] }),
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) })
22951
+ selected && activeField === "description" && /* @__PURE__ */ jsxs45(Box44, { paddingLeft: 2, flexDirection: "row", children: [
22952
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "desc:" }),
22953
+ /* @__PURE__ */ jsxs45(Box44, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
22954
+ /* @__PURE__ */ jsx50(Text47, { children: slot.description.slice(0, textCursor) }),
22955
+ /* @__PURE__ */ jsx50(Text47, { inverse: cursorVisible, children: slot.description[textCursor] ?? cursor }),
22956
+ /* @__PURE__ */ jsx50(Text47, { children: slot.description.slice(textCursor + 1) })
23345
22957
  ] })
23346
22958
  ] }),
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" })
22959
+ selected && activeField !== "description" && /* @__PURE__ */ jsxs45(Box44, { paddingLeft: 2, gap: 1, children: [
22960
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "desc:" }),
22961
+ /* @__PURE__ */ jsx50(Text47, { color: PALETTE.success, children: slot.description || "\u2014" })
23350
22962
  ] })
23351
22963
  ] });
23352
22964
  }
@@ -23462,8 +23074,8 @@ function FieldEditor({
23462
23074
  showHiddenProps = true
23463
23075
  }) {
23464
23076
  const { state: initialState, error: parseError } = parseToState(value);
23465
- const [editorState, setEditorState] = useState25(initialState);
23466
- const [parseErr] = useState25(parseError);
23077
+ const [editorState, setEditorState] = useState24(initialState);
23078
+ const [parseErr] = useState24(parseError);
23467
23079
  const initialFocus = (() => {
23468
23080
  if (initialFocusTarget?.kind === "description") {
23469
23081
  return {
@@ -23530,42 +23142,42 @@ function FieldEditor({
23530
23142
  textCursor: 0
23531
23143
  };
23532
23144
  })();
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);
23145
+ const [focusLevel, setFocusLevel] = useState24(initialFocus.focusLevel);
23146
+ const [propIdx, setPropIdx] = useState24(initialFocus.propIdx);
23147
+ const [slotIdx, setSlotIdx] = useState24(initialFocus.slotIdx);
23148
+ const [inSlots, setInSlots] = useState24(initialFocus.inSlots);
23149
+ const [inComponentDesc, setInComponentDesc] = useState24(initialFocus.focusLevel === "componentDescription");
23150
+ const [activeField, setActiveField] = useState24(initialFocus.activeField);
23151
+ const [textCursor, setTextCursor] = useState24(initialFocus.textCursor);
23152
+ const [valueCursor, setValueCursor] = useState24(0);
23153
+ const [editingValue, setEditingValue] = useState24(null);
23154
+ const [valueText, setValueText] = useState24("");
23155
+ const [pickerCursor, setPickerCursor] = useState24(0);
23156
+ const [validationError, setValidationError] = useState24(null);
23157
+ const [cursorVisible] = useState24(true);
23158
+ const [sourceOpen, setSourceOpen] = useState24(false);
23159
+ const [rationaleOpen, setRationaleOpen] = useState24(false);
23160
+ const [rationaleScrollOffset, setRationaleScrollOffset] = useState24(0);
23161
+ const [showHelp, setShowHelp] = useState24(false);
23550
23162
  const props = editorState.props;
23551
23163
  const slots = editorState.slots;
23552
- const contentPropIndexes = React22.useMemo(
23164
+ const contentPropIndexes = React21.useMemo(
23553
23165
  () => props.flatMap((prop, index) => prop.category === "content" ? [index] : []),
23554
23166
  [props]
23555
23167
  );
23556
- const designPropIndexes = React22.useMemo(
23168
+ const designPropIndexes = React21.useMemo(
23557
23169
  () => props.flatMap((prop, index) => prop.category === "design" ? [index] : []),
23558
23170
  [props]
23559
23171
  );
23560
- const hiddenPropIndexes = React22.useMemo(
23172
+ const hiddenPropIndexes = React21.useMemo(
23561
23173
  () => showHiddenProps ? props.flatMap((prop, index) => prop.category === "state" || prop.category === "unattached" ? [index] : []) : [],
23562
23174
  [props, showHiddenProps]
23563
23175
  );
23564
- const visiblePropIndexes = React22.useMemo(
23176
+ const visiblePropIndexes = React21.useMemo(
23565
23177
  () => [...contentPropIndexes, ...designPropIndexes, ...hiddenPropIndexes],
23566
23178
  [contentPropIndexes, designPropIndexes, hiddenPropIndexes]
23567
23179
  );
23568
- const propGroups = React22.useMemo(
23180
+ const propGroups = React21.useMemo(
23569
23181
  () => [
23570
23182
  { kind: "content", label: "\u2500\u2500 CONTENT PROPERTIES", indexes: contentPropIndexes },
23571
23183
  { kind: "design", label: "\u2500\u2500 DESIGN PROPERTIES", indexes: designPropIndexes },
@@ -23573,7 +23185,7 @@ function FieldEditor({
23573
23185
  ],
23574
23186
  [contentPropIndexes, designPropIndexes, hiddenPropIndexes]
23575
23187
  );
23576
- const selectableRows = React22.useMemo(
23188
+ const selectableRows = React21.useMemo(
23577
23189
  () => [
23578
23190
  ...contentPropIndexes.map((idx) => ({ kind: "prop", idx })),
23579
23191
  ...designPropIndexes.map((idx) => ({ kind: "prop", idx })),
@@ -23583,7 +23195,7 @@ function FieldEditor({
23583
23195
  [contentPropIndexes, designPropIndexes, hiddenPropIndexes, slots]
23584
23196
  );
23585
23197
  const visiblePropPosition = visiblePropIndexes.indexOf(propIdx);
23586
- const selectedSelectableIndex = React22.useMemo(
23198
+ const selectedSelectableIndex = React21.useMemo(
23587
23199
  () => selectableRows.findIndex(
23588
23200
  (row) => inSlots ? row.kind === "slot" && row.idx === slotIdx : row.kind === "prop" && row.idx === propIdx
23589
23201
  ),
@@ -23602,12 +23214,12 @@ function FieldEditor({
23602
23214
  }
23603
23215
  };
23604
23216
  const textEntryActive = focusLevel === "field" && activeField === "description" || focusLevel === "field" && activeField === "default" && (editorState.props[propIdx]?.type === "string" || editorState.props[propIdx]?.type === "token") || editingValue != null;
23605
- React22.useEffect(() => {
23217
+ React21.useEffect(() => {
23606
23218
  onTextEntryActiveChange?.(textEntryActive);
23607
23219
  }, [textEntryActive, onTextEntryActiveChange]);
23608
23220
  const currentProp = props[propIdx] ?? null;
23609
23221
  const currentSlot = slots[slotIdx] ?? null;
23610
- React22.useEffect(() => {
23222
+ React21.useEffect(() => {
23611
23223
  if (showHiddenProps || inSlots || inComponentDesc || visiblePropPosition >= 0) return;
23612
23224
  if (visiblePropIndexes.length > 0) {
23613
23225
  setPropIdx(visiblePropIndexes[0]);
@@ -23626,24 +23238,24 @@ function FieldEditor({
23626
23238
  setEditorState(next);
23627
23239
  onChange(serializeState(next, value));
23628
23240
  };
23629
- const canonicalize = React22.useCallback((json) => {
23241
+ const canonicalize = React21.useCallback((json) => {
23630
23242
  try {
23631
23243
  return JSON.stringify(JSON.parse(json));
23632
23244
  } catch {
23633
23245
  return `__unparseable__:${json}`;
23634
23246
  }
23635
23247
  }, []);
23636
- const initialStateRef = React22.useRef(initialState);
23637
- const [baselineCanonical, setBaselineCanonical] = useState25(
23248
+ const initialStateRef = React21.useRef(initialState);
23249
+ const [baselineCanonical, setBaselineCanonical] = useState24(
23638
23250
  () => canonicalize(serializeState(initialState, value))
23639
23251
  );
23640
23252
  const currentCanonical = canonicalize(serializeState(editorState, value));
23641
23253
  const isDirty = currentCanonical !== baselineCanonical;
23642
- React22.useEffect(() => {
23254
+ React21.useEffect(() => {
23643
23255
  onDirtyChange?.(isDirty);
23644
23256
  }, [isDirty, onDirtyChange]);
23645
- const lastDiscardTriggerRef = React22.useRef(discardTrigger);
23646
- React22.useEffect(() => {
23257
+ const lastDiscardTriggerRef = React21.useRef(discardTrigger);
23258
+ React21.useEffect(() => {
23647
23259
  if (discardTrigger === void 0) return;
23648
23260
  if (discardTrigger === lastDiscardTriggerRef.current) return;
23649
23261
  lastDiscardTriggerRef.current = discardTrigger;
@@ -23774,8 +23386,8 @@ function FieldEditor({
23774
23386
  return;
23775
23387
  }
23776
23388
  if (rationaleOpen && !onTogglePropRationale) {
23777
- const PANEL_HEIGHT3 = 12;
23778
- const next = computeNextScrollOffset(rationaleScrollOffset, input, key, 9999, PANEL_HEIGHT3);
23389
+ const PANEL_HEIGHT2 = 12;
23390
+ const next = computeNextScrollOffset(rationaleScrollOffset, input, key, 9999, PANEL_HEIGHT2);
23779
23391
  if (next !== null) {
23780
23392
  setRationaleScrollOffset(() => next);
23781
23393
  return;
@@ -24130,18 +23742,18 @@ function FieldEditor({
24130
23742
  });
24131
23743
  const innerWidth = Math.max(1, width - 2);
24132
23744
  if (parseErr) {
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." })
23745
+ return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.error, children: [
23746
+ /* @__PURE__ */ jsx50(Text47, { bold: true, color: PALETTE.error, children: "FIELD EDITOR \u2014 parse error" }),
23747
+ /* @__PURE__ */ jsx50(Text47, { color: PALETTE.error, children: parseErr }),
23748
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "Cannot display structured editor. Fix the JSON first." })
24137
23749
  ] });
24138
23750
  }
24139
23751
  if (props.length === 0 && slots.length === 0) {
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" })
23752
+ return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.warning, children: [
23753
+ /* @__PURE__ */ jsx50(Text47, { bold: true, color: PALETTE.warning, children: "FIELD EDITOR \u2014 no fields" }),
23754
+ /* @__PURE__ */ jsx50(Text47, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
23755
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "You can add fields manually below or reject this component." }),
23756
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "Ctrl+S to save \xB7 Esc to discard" })
24145
23757
  ] });
24146
23758
  }
24147
23759
  const hasEmptyProperties = props.length === 0 && slots.length === 0;
@@ -24192,26 +23804,26 @@ function FieldEditor({
24192
23804
  const visibleRows = Math.max(1, height - 3);
24193
23805
  const scrollStart = selectedRowIdx < 0 ? 0 : Math.max(0, Math.min(selectedRowIdx, rows.length - visibleRows));
24194
23806
  const visibleRowSlice = rows.slice(scrollStart, scrollStart + visibleRows);
24195
- return /* @__PURE__ */ jsxs46(
24196
- Box45,
23807
+ return /* @__PURE__ */ jsxs45(
23808
+ Box44,
24197
23809
  {
24198
23810
  flexDirection: "column",
24199
23811
  width,
24200
23812
  borderStyle: "single",
24201
23813
  borderColor: hasEmptyProperties ? PALETTE.warning : PALETTE.info,
24202
23814
  children: [
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) => {
23815
+ hasEmptyProperties && /* @__PURE__ */ jsx50(Text47, { 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." }),
23816
+ /* @__PURE__ */ jsx50(Box44, { flexDirection: "column", width: innerWidth, children: visibleRowSlice.map((row, i) => {
24205
23817
  if (row.kind === "header") {
24206
- return /* @__PURE__ */ jsx51(Text48, { bold: true, color: PALETTE.success, children: row.label }, `header-${i}`);
23818
+ return /* @__PURE__ */ jsx50(Text47, { bold: true, color: PALETTE.success, children: row.label }, `header-${i}`);
24207
23819
  }
24208
23820
  if (row.kind === "component-description") {
24209
23821
  const isSelected2 = inComponentDesc;
24210
23822
  const isEditing = isSelected2 && focusLevel === "field" && activeField === "description";
24211
23823
  const desc = editorState.componentDescription;
24212
- return /* @__PURE__ */ jsx51(Box45, { flexDirection: "column", children: /* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
24213
- /* @__PURE__ */ jsx51(
24214
- Text48,
23824
+ return /* @__PURE__ */ jsx50(Box44, { flexDirection: "column", children: /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
23825
+ /* @__PURE__ */ jsx50(
23826
+ Text47,
24215
23827
  {
24216
23828
  color: isSelected2 ? PALETTE.inverse : PALETTE.info,
24217
23829
  bold: isSelected2,
@@ -24219,18 +23831,18 @@ function FieldEditor({
24219
23831
  children: " description: "
24220
23832
  }
24221
23833
  ),
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)" })
23834
+ isEditing ? /* @__PURE__ */ jsxs45(Box44, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
23835
+ /* @__PURE__ */ jsx50(Text47, { children: desc.slice(0, textCursor) }),
23836
+ /* @__PURE__ */ jsx50(Text47, { inverse: cursorVisible, children: desc[textCursor] ?? (cursorVisible ? "\u2588" : " ") }),
23837
+ /* @__PURE__ */ jsx50(Text47, { children: desc.slice(textCursor + 1) })
23838
+ ] }) : /* @__PURE__ */ jsx50(Text47, { color: isSelected2 ? PALETTE.warning : PALETTE.inverse, dimColor: !desc, children: desc || "(none \u2014 Return to edit)" })
24227
23839
  ] }) }, `component-description-${i}`);
24228
23840
  }
24229
23841
  if (row.kind === "prop") {
24230
23842
  const p = props[row.idx];
24231
23843
  const isSelected2 = !inSlots && !inComponentDesc && row.idx === propIdx;
24232
23844
  const propMeta = metadata?.props?.[p.name];
24233
- return /* @__PURE__ */ jsx51(
23845
+ return /* @__PURE__ */ jsx50(
24234
23846
  PropRow,
24235
23847
  {
24236
23848
  prop: p,
@@ -24251,7 +23863,7 @@ function FieldEditor({
24251
23863
  const s = slots[row.idx];
24252
23864
  const isSelected = inSlots && row.idx === slotIdx;
24253
23865
  const slotPickerCandidates = isSelected && editingValue?.mode === "add" && activeField === "allowedComponents" && projectSlotGraph && currentComponentName ? computeAllowedComponentCandidates(projectSlotGraph, currentComponentName, slots, s.name) : null;
24254
- return /* @__PURE__ */ jsx51(
23866
+ return /* @__PURE__ */ jsx50(
24255
23867
  SlotRow,
24256
23868
  {
24257
23869
  slot: s,
@@ -24277,50 +23889,50 @@ function FieldEditor({
24277
23889
  const src = metadata?.componentSource ?? null;
24278
23890
  const headerPath = path ?? "<unknown source path>";
24279
23891
  if (!start || !end || !src) {
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" })
23892
+ return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
23893
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, bold: true, children: `source: ${headerPath}` }),
23894
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "(no source location captured for this prop)" }),
23895
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "[s] close" })
24284
23896
  ] });
24285
23897
  }
24286
23898
  const lines = src.split("\n").slice(Math.max(0, start - 1), end);
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" })
23899
+ return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
23900
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, bold: true, children: `${headerPath}: lines ${start}\u2013${end}` }),
23901
+ lines.map((ln, i) => /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: ln }, `source-line-${i}`)),
23902
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "[s] close \xB7 [Esc] close" })
24291
23903
  ] });
24292
23904
  })(),
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" })
23905
+ showHelp && /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
23906
+ /* @__PURE__ */ jsx50(Text47, { bold: true, color: PALETTE.info, children: "Keybindings" }),
23907
+ /* @__PURE__ */ jsx50(Text47, { children: " " }),
23908
+ /* @__PURE__ */ jsx50(Text47, { bold: true, children: "Row navigation" }),
23909
+ /* @__PURE__ */ jsx50(Text47, { children: " \u2191/\u2193 or j/k move between rows" }),
23910
+ /* @__PURE__ */ jsx50(Text47, { children: " Enter edit fields on the current row" }),
23911
+ /* @__PURE__ */ jsx50(Text47, { children: " Esc exit the panel" }),
23912
+ /* @__PURE__ */ jsx50(Text47, { children: " " }),
23913
+ /* @__PURE__ */ jsx50(Text47, { bold: true, children: "Field editing" }),
23914
+ /* @__PURE__ */ jsx50(Text47, { children: " \u2191/\u2193 or j/k cycle through fields (j/k literal in text inputs)" }),
23915
+ /* @__PURE__ */ jsx50(Text47, { children: " \u2190/\u2192 cycle picker values \xB7 move cursor in text inputs" }),
23916
+ /* @__PURE__ */ jsx50(Text47, { children: " Space/Enter toggle required" }),
23917
+ /* @__PURE__ */ jsx50(Text47, { children: " Type edit description / string default" }),
23918
+ /* @__PURE__ */ jsx50(Text47, { children: " Ctrl+S save changes" }),
23919
+ /* @__PURE__ */ jsx50(Text47, { children: " Esc exit field-edit back to the row" }),
23920
+ /* @__PURE__ */ jsx50(Text47, { children: " " }),
23921
+ /* @__PURE__ */ jsx50(Text47, { bold: true, children: "Values / allowedComponents" }),
23922
+ /* @__PURE__ */ jsx50(Text47, { children: " a / e / r add \xB7 edit \xB7 remove" }),
23923
+ /* @__PURE__ */ jsx50(Text47, { children: " \u2191\u2193 or j/k navigate the list" }),
23924
+ /* @__PURE__ */ jsx50(Text47, { children: " K / J reorder up \xB7 down" }),
23925
+ /* @__PURE__ */ jsx50(Text47, { children: " " }),
23926
+ /* @__PURE__ */ jsx50(Text47, { bold: true, children: "Panels" }),
23927
+ /* @__PURE__ */ jsx50(Text47, { children: " s toggle source-view for the current prop" }),
23928
+ /* @__PURE__ */ jsx50(Text47, { children: " " + propRationaleKey.padEnd(16) + " toggle prop rationale panel" }),
23929
+ /* @__PURE__ */ jsx50(Text47, { children: " " + componentRationaleKey.padEnd(16) + " toggle component rationale panel" }),
23930
+ /* @__PURE__ */ jsx50(Text47, { children: " ? toggle this overlay" }),
23931
+ /* @__PURE__ */ jsx50(Text47, { children: " " }),
23932
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: "press ? or Esc to close" })
24321
23933
  ] }),
24322
- validationError && /* @__PURE__ */ jsx51(Text48, { color: PALETTE.error, children: "\u2717 " + validationError }),
24323
- /* @__PURE__ */ jsx51(Text48, { dimColor: true, children: modeLabel })
23934
+ validationError && /* @__PURE__ */ jsx50(Text47, { color: PALETTE.error, children: "\u2717 " + validationError }),
23935
+ /* @__PURE__ */ jsx50(Text47, { dimColor: true, children: modeLabel })
24324
23936
  ]
24325
23937
  }
24326
23938
  );
@@ -24375,23 +23987,23 @@ var init_wrap_text = __esm({
24375
23987
  });
24376
23988
 
24377
23989
  // packages/experience-design-system-cli/src/analyze/select/tui/components/RationaleLine.tsx
24378
- import { Box as Box46, Text as Text49 } from "ink";
24379
- import { jsx as jsx52, jsxs as jsxs47 } from "react/jsx-runtime";
23990
+ import { Box as Box45, Text as Text48 } from "ink";
23991
+ import { jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
24380
23992
  function RationaleLine({ line, active }) {
24381
23993
  if (line.kind === "blank") {
24382
- return /* @__PURE__ */ jsx52(Box46, { children: /* @__PURE__ */ jsx52(Text49, { children: " " }) });
23994
+ return /* @__PURE__ */ jsx51(Box45, { children: /* @__PURE__ */ jsx51(Text48, { children: " " }) });
24383
23995
  }
24384
23996
  if (line.kind === "heading") {
24385
- return /* @__PURE__ */ jsx52(Box46, { children: /* @__PURE__ */ jsx52(Text49, { bold: true, color: PALETTE.info, dimColor: !active, children: line.text }) });
23997
+ return /* @__PURE__ */ jsx51(Box45, { children: /* @__PURE__ */ jsx51(Text48, { bold: true, color: PALETTE.info, dimColor: !active, children: line.text }) });
24386
23998
  }
24387
23999
  if (line.kind === "label") {
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 })
24000
+ return /* @__PURE__ */ jsxs46(Box45, { children: [
24001
+ line.prefix && /* @__PURE__ */ jsx51(Text48, { children: line.prefix }),
24002
+ /* @__PURE__ */ jsx51(Text48, { bold: true, color: line.color, dimColor: !active, children: line.text }),
24003
+ line.suffix && /* @__PURE__ */ jsx51(Text48, { dimColor: true, children: line.suffix })
24392
24004
  ] });
24393
24005
  }
24394
- return /* @__PURE__ */ jsx52(Box46, { children: /* @__PURE__ */ jsx52(Text49, { dimColor: !active || line.dim, children: line.text }) });
24006
+ return /* @__PURE__ */ jsx51(Box45, { children: /* @__PURE__ */ jsx51(Text48, { dimColor: !active || line.dim, children: line.text }) });
24395
24007
  }
24396
24008
  var init_RationaleLine = __esm({
24397
24009
  "packages/experience-design-system-cli/src/analyze/select/tui/components/RationaleLine.tsx"() {
@@ -24401,8 +24013,8 @@ var init_RationaleLine = __esm({
24401
24013
  });
24402
24014
 
24403
24015
  // packages/experience-design-system-cli/src/analyze/select/tui/components/ComponentRationalePanel.tsx
24404
- import { Box as Box47, Text as Text50 } from "ink";
24405
- import { jsx as jsx53, jsxs as jsxs48 } from "react/jsx-runtime";
24016
+ import { Box as Box46, Text as Text49 } from "ink";
24017
+ import { jsx as jsx52, jsxs as jsxs47 } from "react/jsx-runtime";
24406
24018
  function renderComponentRationaleLines(data, innerWidth) {
24407
24019
  const out = [];
24408
24020
  const pushSection = (heading, body) => {
@@ -24469,8 +24081,8 @@ function ComponentRationalePanel({
24469
24081
  const overflowed = totalLines > contentHeight;
24470
24082
  const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
24471
24083
  const visibleEnd = Math.min(totalLines, scrollOffset + contentHeight);
24472
- return /* @__PURE__ */ jsxs48(
24473
- Box47,
24084
+ return /* @__PURE__ */ jsxs47(
24085
+ Box46,
24474
24086
  {
24475
24087
  flexDirection: "column",
24476
24088
  width,
@@ -24478,9 +24090,9 @@ function ComponentRationalePanel({
24478
24090
  borderStyle: "single",
24479
24091
  borderColor: active ? PALETTE.inverse : void 0,
24480
24092
  children: [
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" }) })
24093
+ /* @__PURE__ */ jsx52(Box46, { children: /* @__PURE__ */ jsx52(Text49, { bold: true, dimColor: !active, children: `Component rationale: ${data.name}` }) }),
24094
+ visible.map((line, i) => /* @__PURE__ */ jsx52(RationaleLine, { line, active }, i)),
24095
+ /* @__PURE__ */ jsx52(Box46, { children: overflowed ? /* @__PURE__ */ jsx52(Text49, { dimColor: true, children: `${visibleStart}-${visibleEnd}/${totalLines} [j/k] scroll [I/Esc] close` }) : /* @__PURE__ */ jsx52(Text49, { dimColor: true, children: "[I/Esc] close" }) })
24484
24096
  ]
24485
24097
  }
24486
24098
  );
@@ -24497,8 +24109,8 @@ var init_ComponentRationalePanel = __esm({
24497
24109
  });
24498
24110
 
24499
24111
  // packages/experience-design-system-cli/src/analyze/select/tui/components/RationalePanel.tsx
24500
- import { Text as Text51 } from "ink";
24501
- import { jsx as jsx54 } from "react/jsx-runtime";
24112
+ import { Text as Text50 } from "ink";
24113
+ import { jsx as jsx53 } from "react/jsx-runtime";
24502
24114
  function renderRationaleLines(rows, innerWidth) {
24503
24115
  const out = [];
24504
24116
  rows.forEach((row, idx) => {
@@ -24531,10 +24143,10 @@ function RationalePanel({
24531
24143
  const visible = allLines.slice(scrollOffset, scrollOffset + height);
24532
24144
  const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
24533
24145
  const visibleEnd = Math.min(totalLines, scrollOffset + height);
24534
- return /* @__PURE__ */ jsx54(
24146
+ return /* @__PURE__ */ jsx53(
24535
24147
  ScrollablePanel,
24536
24148
  {
24537
- header: /* @__PURE__ */ jsx54(Text51, { bold: true, dimColor: !active, children: `RATIONALE \u2014 ${componentName}` }),
24149
+ header: /* @__PURE__ */ jsx53(Text50, { bold: true, dimColor: !active, children: `RATIONALE \u2014 ${componentName}` }),
24538
24150
  width,
24539
24151
  height,
24540
24152
  active,
@@ -24542,7 +24154,7 @@ function RationalePanel({
24542
24154
  visibleStart,
24543
24155
  visibleEnd,
24544
24156
  borderColor: active ? PALETTE.inverse : void 0,
24545
- children: visible.map((line, i) => /* @__PURE__ */ jsx54(RationaleLine, { line, active }, i))
24157
+ children: visible.map((line, i) => /* @__PURE__ */ jsx53(RationaleLine, { line, active }, i))
24546
24158
  }
24547
24159
  );
24548
24160
  }
@@ -24557,8 +24169,8 @@ var init_RationalePanel = __esm({
24557
24169
  });
24558
24170
 
24559
24171
  // packages/experience-design-system-cli/src/analyze/select/tui/components/TokenReviewPanel.tsx
24560
- import { Box as Box48, Text as Text52 } from "ink";
24561
- import { jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
24172
+ import { Box as Box47, Text as Text51 } from "ink";
24173
+ import { jsx as jsx54, jsxs as jsxs48 } from "react/jsx-runtime";
24562
24174
  function collectTokenSuggestions(entry, availableTokens = []) {
24563
24175
  return Object.entries(entry.$properties).filter(([, def]) => {
24564
24176
  const rawKind = def["$token.kind"];
@@ -24592,8 +24204,8 @@ function TokenReviewPanel({
24592
24204
  const scrollStart = Math.max(0, Math.min(editCursor - Math.floor(visibleCount / 2), maxStart));
24593
24205
  const visiblePaths = current.paths.slice(scrollStart, scrollStart + visibleCount);
24594
24206
  const rangeLabel = current.paths.length === 0 ? "no compatible tokens" : `${scrollStart + 1}-${scrollStart + visiblePaths.length} of ${current.paths.length}`;
24595
- return /* @__PURE__ */ jsxs49(
24596
- Box48,
24207
+ return /* @__PURE__ */ jsxs48(
24208
+ Box47,
24597
24209
  {
24598
24210
  flexDirection: "column",
24599
24211
  width,
@@ -24601,25 +24213,25 @@ function TokenReviewPanel({
24601
24213
  borderStyle: "single",
24602
24214
  borderColor: active ? PALETTE.inverse : void 0,
24603
24215
  children: [
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)" }),
24216
+ /* @__PURE__ */ jsx54(Text51, { bold: true, dimColor: !active, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
24217
+ /* @__PURE__ */ jsx54(Text51, { dimColor: true, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
24218
+ /* @__PURE__ */ jsx54(Text51, { children: " " }),
24219
+ current.paths.length === 0 && /* @__PURE__ */ jsx54(Text51, { dimColor: true, children: "(no compatible tokens found for this token kind)" }),
24608
24220
  visiblePaths.map((path, i) => {
24609
24221
  const pathIndex = scrollStart + i;
24610
24222
  const checked = editSelection.has(path);
24611
24223
  const focused = pathIndex === editCursor;
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);
24224
+ return /* @__PURE__ */ jsx54(Box47, { children: /* @__PURE__ */ jsx54(Text51, { color: focused ? PALETTE.info : void 0, bold: focused, dimColor: !active, wrap: "truncate", children: ` [${checked ? "x" : " "}] ${path}` }) }, path);
24613
24225
  }),
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" })
24226
+ /* @__PURE__ */ jsx54(Text51, { children: " " }),
24227
+ /* @__PURE__ */ jsx54(Text51, { dimColor: true, wrap: "truncate", children: "[\u2191/\u2193] move [Space] toggle" }),
24228
+ /* @__PURE__ */ jsx54(Text51, { dimColor: true, wrap: "truncate", children: "[Ctrl+S] save [Esc] cancel" })
24617
24229
  ]
24618
24230
  }
24619
24231
  );
24620
24232
  }
24621
- return /* @__PURE__ */ jsxs49(
24622
- Box48,
24233
+ return /* @__PURE__ */ jsxs48(
24234
+ Box47,
24623
24235
  {
24624
24236
  flexDirection: "column",
24625
24237
  width,
@@ -24627,18 +24239,18 @@ function TokenReviewPanel({
24627
24239
  borderStyle: "single",
24628
24240
  borderColor: active ? PALETTE.inverse : void 0,
24629
24241
  children: [
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)" }),
24242
+ /* @__PURE__ */ jsx54(Text51, { bold: true, dimColor: !active, children: `TOKEN REVIEW \u2014 ${componentName}` }),
24243
+ suggestions.length === 0 && /* @__PURE__ */ jsx54(Text51, { dimColor: true, children: "(no token suggestions for this component)" }),
24632
24244
  suggestions.map((s, i) => {
24633
24245
  const focused = i === selectedRow;
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(", ")}` })
24246
+ return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", children: [
24247
+ /* @__PURE__ */ jsx54(Box47, { children: /* @__PURE__ */ jsx54(Text51, { color: focused ? PALETTE.info : void 0, bold: focused, dimColor: !active, children: `${focused ? "\u25B6" : " "} ${s.propName}` }) }),
24248
+ /* @__PURE__ */ jsx54(Text51, { dimColor: true, children: ` suggested: ${s.suggested.join(", ")}` }),
24249
+ /* @__PURE__ */ jsx54(Text51, { dimColor: true, children: ` allowed: ${s.allowed.join(", ")}` })
24638
24250
  ] }, s.propName);
24639
24251
  }),
24640
- /* @__PURE__ */ jsx55(Text52, { children: " " }),
24641
- /* @__PURE__ */ jsx55(Text52, { dimColor: true, children: "[\u2191/\u2193] move [Enter] edit allowed [Esc] close" })
24252
+ /* @__PURE__ */ jsx54(Text51, { children: " " }),
24253
+ /* @__PURE__ */ jsx54(Text51, { dimColor: true, children: "[\u2191/\u2193] move [Enter] edit allowed [Esc] close" })
24642
24254
  ]
24643
24255
  }
24644
24256
  );
@@ -24651,8 +24263,8 @@ var init_TokenReviewPanel = __esm({
24651
24263
  });
24652
24264
 
24653
24265
  // packages/experience-design-system-cli/src/import/tui/steps/review-details-panel.tsx
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";
24266
+ import { Box as Box48, Text as Text52 } from "ink";
24267
+ import { Fragment as Fragment15, jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
24656
24268
  function ReviewDetailsPanel({
24657
24269
  selectedKey,
24658
24270
  panelOpen,
@@ -24686,7 +24298,7 @@ function ReviewDetailsPanel({
24686
24298
  rationale: s.rationale ?? ""
24687
24299
  }))
24688
24300
  ];
24689
- return /* @__PURE__ */ jsx56(
24301
+ return /* @__PURE__ */ jsx55(
24690
24302
  RationalePanel,
24691
24303
  {
24692
24304
  componentName: componentRationale?.name ?? selectedKey,
@@ -24699,7 +24311,7 @@ function ReviewDetailsPanel({
24699
24311
  );
24700
24312
  }
24701
24313
  if (panelOpen === "component-rationale") {
24702
- return /* @__PURE__ */ jsx56(
24314
+ return /* @__PURE__ */ jsx55(
24703
24315
  ComponentRationalePanel,
24704
24316
  {
24705
24317
  data: componentRationale ?? {
@@ -24723,14 +24335,14 @@ function ReviewDetailsPanel({
24723
24335
  const source = reviewMetadata?.componentSource ?? null;
24724
24336
  const headerPath = path ?? "<unknown source path>";
24725
24337
  const lines = source ? source.split("\n").slice(panelScrollOffset, panelScrollOffset + height) : [];
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" })
24338
+ return /* @__PURE__ */ jsxs49(Box48, { flexDirection: "column", width, borderStyle: "single", borderColor: sourceBorderColor, paddingX: 1, children: [
24339
+ /* @__PURE__ */ jsx55(Text52, { dimColor: true, bold: true, children: `source: ${headerPath}` }),
24340
+ source ? lines.map((line, index) => /* @__PURE__ */ jsx55(Text52, { dimColor: true, children: line }, `source-line-${index}`)) : /* @__PURE__ */ jsx55(Text52, { dimColor: true, children: "(no source captured)" }),
24341
+ /* @__PURE__ */ jsx55(Text52, { dimColor: true, children: "[s/Esc] close" })
24730
24342
  ] });
24731
24343
  }
24732
24344
  if (panelOpen === "token-review") {
24733
- return /* @__PURE__ */ jsx56(
24345
+ return /* @__PURE__ */ jsx55(
24734
24346
  TokenReviewPanel,
24735
24347
  {
24736
24348
  componentName: selectedKey,
@@ -24746,7 +24358,7 @@ function ReviewDetailsPanel({
24746
24358
  );
24747
24359
  }
24748
24360
  if (showJson) {
24749
- return /* @__PURE__ */ jsx56(
24361
+ return /* @__PURE__ */ jsx55(
24750
24362
  JsonPanel,
24751
24363
  {
24752
24364
  label: "GENERATED DEFINITION (read-only)",
@@ -24758,7 +24370,7 @@ function ReviewDetailsPanel({
24758
24370
  }
24759
24371
  );
24760
24372
  }
24761
- return /* @__PURE__ */ jsx56(Fragment15, { children: editor });
24373
+ return /* @__PURE__ */ jsx55(Fragment15, { children: editor });
24762
24374
  }
24763
24375
  var init_review_details_panel = __esm({
24764
24376
  "packages/experience-design-system-cli/src/import/tui/steps/review-details-panel.tsx"() {
@@ -24771,7 +24383,7 @@ var init_review_details_panel = __esm({
24771
24383
  });
24772
24384
 
24773
24385
  // packages/experience-design-system-cli/src/import/tui/components/ReviewDetailsEditor.tsx
24774
- import { jsx as jsx57 } from "react/jsx-runtime";
24386
+ import { jsx as jsx56 } from "react/jsx-runtime";
24775
24387
  import { createElement as createElement7 } from "react";
24776
24388
  function toFieldEditorMetadata(reviewMetadata) {
24777
24389
  if (!reviewMetadata) return void 0;
@@ -24804,7 +24416,7 @@ function ReviewDetailsEditor({
24804
24416
  jsonScrollOffset,
24805
24417
  currentTokenSuggestions
24806
24418
  } = reviewEditor;
24807
- return /* @__PURE__ */ jsx57(
24419
+ return /* @__PURE__ */ jsx56(
24808
24420
  ReviewDetailsPanel,
24809
24421
  {
24810
24422
  selectedKey,
@@ -24847,8 +24459,8 @@ var init_ReviewDetailsEditor = __esm({
24847
24459
  });
24848
24460
 
24849
24461
  // packages/experience-design-system-cli/src/import/tui/components/ReviewComponentPanel.tsx
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";
24462
+ import { Box as Box49, Text as Text53 } from "ink";
24463
+ import { Fragment as Fragment16, jsx as jsx57, jsxs as jsxs50 } from "react/jsx-runtime";
24852
24464
  function buildReviewFieldEditor(reviewEditor, selectedJson, onExit, overrides = {}) {
24853
24465
  return {
24854
24466
  value: reviewEditor.draftValue || selectedJson,
@@ -24888,17 +24500,17 @@ function ReviewEmptyComponentsWarning({
24888
24500
  hidden
24889
24501
  }) {
24890
24502
  if (hidden || count === 0) return null;
24891
- return /* @__PURE__ */ jsx58(Text54, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
24503
+ return /* @__PURE__ */ jsx57(Text53, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
24892
24504
  }
24893
24505
  function ReviewNoSelection() {
24894
- return /* @__PURE__ */ jsx58(Box50, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx58(Text54, { dimColor: true, children: "No component selected" }) });
24506
+ return /* @__PURE__ */ jsx57(Box49, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx57(Text53, { dimColor: true, children: "No component selected" }) });
24895
24507
  }
24896
24508
  function ReviewFinalizeError({
24897
24509
  message,
24898
24510
  hidden
24899
24511
  }) {
24900
24512
  if (hidden || !message) return null;
24901
- return /* @__PURE__ */ jsx58(Text54, { color: PALETTE.error, children: `\u26A0 ${message}` });
24513
+ return /* @__PURE__ */ jsx57(Text53, { color: PALETTE.error, children: `\u26A0 ${message}` });
24902
24514
  }
24903
24515
  function ReviewPanelFooter({
24904
24516
  reviewEditor,
@@ -24907,10 +24519,10 @@ function ReviewPanelFooter({
24907
24519
  livePreview,
24908
24520
  livePreviewSpinner
24909
24521
  }) {
24910
- return /* @__PURE__ */ jsxs51(Fragment16, { children: [
24522
+ return /* @__PURE__ */ jsxs50(Fragment16, { children: [
24911
24523
  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" : ""),
24912
- livePreview.status === "running" && /* @__PURE__ */ jsx58(Text54, { children: ` ${livePreviewSpinner} live preview` }),
24913
- livePreview.disabled && /* @__PURE__ */ jsx58(Text54, { children: " \xB7 live preview disabled" })
24524
+ livePreview.status === "running" && /* @__PURE__ */ jsx57(Text53, { children: ` ${livePreviewSpinner} live preview` }),
24525
+ livePreview.disabled && /* @__PURE__ */ jsx57(Text53, { children: " \xB7 live preview disabled" })
24914
24526
  ] });
24915
24527
  }
24916
24528
  function ReviewComponentPanel({
@@ -24932,11 +24544,11 @@ function ReviewComponentPanel({
24932
24544
  }) {
24933
24545
  const propCount = Object.keys(selectedEntry.$properties).length;
24934
24546
  const slotCount = selectedEntry.$slots ? Object.keys(selectedEntry.$slots).length : 0;
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: [
24547
+ return /* @__PURE__ */ jsxs50(Box49, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: [
24548
+ /* @__PURE__ */ jsxs50(Box49, { children: [
24549
+ /* @__PURE__ */ jsx57(Text53, { bold: true, children: selectedKey }),
24550
+ /* @__PURE__ */ jsx57(Box49, { flexGrow: 1 }),
24551
+ /* @__PURE__ */ jsxs50(Text53, { dimColor: true, children: [
24940
24552
  propCount,
24941
24553
  " prop",
24942
24554
  propCount !== 1 ? "s" : "",
@@ -24945,7 +24557,7 @@ function ReviewComponentPanel({
24945
24557
  sidebarFocused ? "[Tab] focus panel" : "[Tab] focus list"
24946
24558
  ] })
24947
24559
  ] }),
24948
- /* @__PURE__ */ jsx58(
24560
+ /* @__PURE__ */ jsx57(
24949
24561
  ReviewDetailsEditor,
24950
24562
  {
24951
24563
  selectedKey,
@@ -24960,8 +24572,8 @@ function ReviewComponentPanel({
24960
24572
  fieldEditor
24961
24573
  }
24962
24574
  ),
24963
- saveError && /* @__PURE__ */ jsx58(Text54, { color: PALETTE.error, children: "\u2717 " + saveError }),
24964
- /* @__PURE__ */ jsx58(Text54, { dimColor: true, children: /* @__PURE__ */ jsx58(
24575
+ saveError && /* @__PURE__ */ jsx57(Text53, { color: PALETTE.error, children: "\u2717 " + saveError }),
24576
+ /* @__PURE__ */ jsx57(Text53, { dimColor: true, children: /* @__PURE__ */ jsx57(
24965
24577
  ReviewPanelFooter,
24966
24578
  {
24967
24579
  reviewEditor,
@@ -24983,8 +24595,8 @@ var init_ReviewComponentPanel = __esm({
24983
24595
  });
24984
24596
 
24985
24597
  // packages/experience-design-system-cli/src/import/tui/components/ReviewStatus.tsx
24986
- import { Box as Box51, Text as Text55 } from "ink";
24987
- import { jsx as jsx59, jsxs as jsxs52 } from "react/jsx-runtime";
24598
+ import { Box as Box50, Text as Text54 } from "ink";
24599
+ import { jsx as jsx58, jsxs as jsxs51 } from "react/jsx-runtime";
24988
24600
  function countReviewStatuses(entries) {
24989
24601
  return entries.reduce(
24990
24602
  (counts, entry) => {
@@ -25002,7 +24614,7 @@ function ReviewStatusBar({
25002
24614
  onFinalize
25003
24615
  }) {
25004
24616
  const { accepted, rejected, needsReview } = countReviewStatuses(entries);
25005
- return /* @__PURE__ */ jsx59(
24617
+ return /* @__PURE__ */ jsx58(
25006
24618
  StatusBar,
25007
24619
  {
25008
24620
  accepted,
@@ -25015,13 +24627,13 @@ function ReviewStatusBar({
25015
24627
  );
25016
24628
  }
25017
24629
  function ReviewLoadingState() {
25018
- return /* @__PURE__ */ jsx59(Box51, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx59(Text55, { dimColor: true, children: "Loading generated definitions..." }) });
24630
+ return /* @__PURE__ */ jsx58(Box50, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx58(Text54, { dimColor: true, children: "Loading generated definitions..." }) });
25019
24631
  }
25020
24632
  function ReviewLoadError({ message }) {
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" })
24633
+ return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
24634
+ /* @__PURE__ */ jsx58(Text54, { color: PALETTE.error, children: message }),
24635
+ /* @__PURE__ */ jsx58(Text54, { children: " " }),
24636
+ /* @__PURE__ */ jsx58(Text54, { dimColor: true, children: "[q / Enter / Esc] Quit" })
25025
24637
  ] });
25026
24638
  }
25027
24639
  var init_ReviewStatus = __esm({
@@ -25092,7 +24704,7 @@ var init_history = __esm({
25092
24704
  });
25093
24705
 
25094
24706
  // packages/experience-design-system-cli/src/import/tui/hooks/useReviewSession.ts
25095
- import { useCallback as useCallback4, useEffect as useEffect8, useRef as useRef6, useState as useState26 } from "react";
24707
+ import { useCallback as useCallback4, useEffect as useEffect8, useRef as useRef6, useState as useState25 } from "react";
25096
24708
  function loadReviewSessionState({
25097
24709
  extractSessionId,
25098
24710
  tokenSessionId,
@@ -25138,10 +24750,10 @@ function useReviewSession({
25138
24750
  tokensPath,
25139
24751
  onExtraLoaded
25140
24752
  }) {
25141
- const [components, setComponents] = useState26([]);
25142
- const [loading, setLoading] = useState26(true);
25143
- const [loadError, setLoadError] = useState26(null);
25144
- const [availableTokens, setAvailableTokens] = useState26([]);
24753
+ const [components, setComponents] = useState25([]);
24754
+ const [loading, setLoading] = useState25(true);
24755
+ const [loadError, setLoadError] = useState25(null);
24756
+ const [availableTokens, setAvailableTokens] = useState25([]);
25145
24757
  const loadInitialState = useCallback4(async () => {
25146
24758
  const result = loadSession();
25147
24759
  if (result.error || !tokensPath) return { result, catalog: result.tokens };
@@ -25202,8 +24814,8 @@ function useReviewSession({
25202
24814
  };
25203
24815
  }
25204
24816
  function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
25205
- const [reviewMetadata, setReviewMetadata] = useState26(null);
25206
- const [componentRationale, setComponentRationale] = useState26(null);
24817
+ const [reviewMetadata, setReviewMetadata] = useState25(null);
24818
+ const [componentRationale, setComponentRationale] = useState25(null);
25207
24819
  useEffect8(() => {
25208
24820
  const current = components[selectedIdx];
25209
24821
  if (!current) {
@@ -25308,7 +24920,7 @@ var init_useReviewSession = __esm({
25308
24920
  });
25309
24921
 
25310
24922
  // packages/experience-design-system-cli/src/import/tui/hooks/useReviewEditor.ts
25311
- import { useEffect as useEffect9, useRef as useRef7, useState as useState27 } from "react";
24923
+ import { useEffect as useEffect9, useRef as useRef7, useState as useState26 } from "react";
25312
24924
  function parseReviewEntry(draftValue) {
25313
24925
  const parsed = JSON.parse(draftValue);
25314
24926
  const keys = Object.keys(parsed);
@@ -25328,18 +24940,18 @@ function useReviewEditor({
25328
24940
  onEditSaved,
25329
24941
  onTokenSaved
25330
24942
  }) {
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());
24943
+ const [panelOpen, setPanelOpen] = useState26("none");
24944
+ const [panelScrollOffset, setPanelScrollOffset] = useState26(0);
24945
+ const [jsonScrollOffset, setJsonScrollOffset] = useState26(0);
24946
+ const [textEntryActive, setTextEntryActive] = useState26(false);
24947
+ const [showJson, setShowJson] = useState26(false);
24948
+ const [showHiddenProps, setShowHiddenProps] = useState26(false);
24949
+ const [draftValue, setDraftValue] = useState26("");
24950
+ const [saveError, setSaveError] = useState26(null);
24951
+ const [tokenReviewRow, setTokenReviewRow] = useState26(0);
24952
+ const [tokenReviewEditing, setTokenReviewEditing] = useState26(false);
24953
+ const [tokenReviewEditCursor, setTokenReviewEditCursor] = useState26(0);
24954
+ const [tokenReviewEditSelection, setTokenReviewEditSelection] = useState26(/* @__PURE__ */ new Set());
25343
24955
  const tokenReviewSuggestedRef = useRef7(/* @__PURE__ */ new Map());
25344
24956
  const pendingGRef = useRef7(false);
25345
24957
  useEffect9(() => {
@@ -25461,12 +25073,12 @@ var init_useReviewEditor = __esm({
25461
25073
  });
25462
25074
 
25463
25075
  // packages/experience-design-system-cli/src/import/tui/hooks/useReviewSurfaceState.ts
25464
- import { useState as useState28 } from "react";
25076
+ import { useState as useState27 } from "react";
25465
25077
  function useReviewSurfaceState(initialFinalizeError = null) {
25466
- const [sidebarFocused, setSidebarFocused] = useState28(true);
25467
- const [showFinalize, setShowFinalize] = useState28(false);
25468
- const [showQuit, setShowQuit] = useState28(false);
25469
- const [finalizeError, setFinalizeError] = useState28(initialFinalizeError);
25078
+ const [sidebarFocused, setSidebarFocused] = useState27(true);
25079
+ const [showFinalize, setShowFinalize] = useState27(false);
25080
+ const [showQuit, setShowQuit] = useState27(false);
25081
+ const [finalizeError, setFinalizeError] = useState27(initialFinalizeError);
25470
25082
  return {
25471
25083
  sidebarFocused,
25472
25084
  setSidebarFocused,
@@ -25485,8 +25097,8 @@ var init_useReviewSurfaceState = __esm({
25485
25097
  });
25486
25098
 
25487
25099
  // packages/experience-design-system-cli/src/import/tui/components/ReviewDialogs.tsx
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";
25100
+ import { Box as Box51, Text as Text55 } from "ink";
25101
+ import { Fragment as Fragment17, jsx as jsx59, jsxs as jsxs52 } from "react/jsx-runtime";
25490
25102
  function ReviewFinalizeDialogs({
25491
25103
  showFinalize,
25492
25104
  showQuit,
@@ -25500,8 +25112,8 @@ function ReviewFinalizeDialogs({
25500
25112
  onQuitCancel
25501
25113
  }) {
25502
25114
  const { accepted, rejected, needsReview } = countReviewStatuses(components);
25503
- return /* @__PURE__ */ jsxs53(Fragment17, { children: [
25504
- showFinalize && /* @__PURE__ */ jsx60(
25115
+ return /* @__PURE__ */ jsxs52(Fragment17, { children: [
25116
+ showFinalize && /* @__PURE__ */ jsx59(
25505
25117
  FinalizeDialog,
25506
25118
  {
25507
25119
  accepted,
@@ -25514,7 +25126,7 @@ function ReviewFinalizeDialogs({
25514
25126
  onCancel: onFinalizeCancel
25515
25127
  }
25516
25128
  ),
25517
- showQuit && /* @__PURE__ */ jsx60(QuitDialog, { hasUnsavedDrafts: false, onConfirm: onQuitConfirm, onCancel: onQuitCancel })
25129
+ showQuit && /* @__PURE__ */ jsx59(QuitDialog, { hasUnsavedDrafts: false, onConfirm: onQuitConfirm, onCancel: onQuitCancel })
25518
25130
  ] });
25519
25131
  }
25520
25132
  function ReviewStepDialogs({
@@ -25524,7 +25136,7 @@ function ReviewStepDialogs({
25524
25136
  onFinalize,
25525
25137
  onQuit
25526
25138
  }) {
25527
- return /* @__PURE__ */ jsx60(
25139
+ return /* @__PURE__ */ jsx59(
25528
25140
  ReviewFinalizeDialogs,
25529
25141
  {
25530
25142
  showFinalize: surfaceState.showFinalize,
@@ -25542,12 +25154,12 @@ function ReviewStepDialogs({
25542
25154
  }
25543
25155
  function ReviewReloadDialog({ open }) {
25544
25156
  if (!open) return null;
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" })
25157
+ return /* @__PURE__ */ jsxs52(Box51, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
25158
+ /* @__PURE__ */ jsx59(Text55, { bold: true, color: PALETTE.warning, children: "Reload from saved state?" }),
25159
+ /* @__PURE__ */ jsx59(Text55, { children: "Unsaved in-memory changes will be lost." }),
25160
+ /* @__PURE__ */ jsx59(Text55, { children: " " }),
25161
+ /* @__PURE__ */ jsx59(Text55, { children: " [Enter] Confirm" }),
25162
+ /* @__PURE__ */ jsx59(Text55, { children: " [Esc] Cancel" })
25551
25163
  ] });
25552
25164
  }
25553
25165
  var init_ReviewDialogs = __esm({
@@ -25790,11 +25402,11 @@ var init_preview_annotations = __esm({
25790
25402
  });
25791
25403
 
25792
25404
  // packages/experience-design-system-cli/src/import/tui/useLivePreview.ts
25793
- import { useCallback as useCallback5, useEffect as useEffect10, useRef as useRef8, useState as useState29 } from "react";
25405
+ import { useCallback as useCallback5, useEffect as useEffect10, useRef as useRef8, useState as useState28 } from "react";
25794
25406
  function useLivePreview(opts) {
25795
25407
  const debounceMs = opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
25796
- const [status, setStatus] = useState29("idle");
25797
- const [disabled, setDisabled] = useState29(false);
25408
+ const [status, setStatus] = useState28("idle");
25409
+ const [disabled, setDisabled] = useState28(false);
25798
25410
  const timerRef = useRef8(null);
25799
25411
  const generationRef = useRef8(0);
25800
25412
  const latestRef = useRef8(0);
@@ -25889,7 +25501,7 @@ var init_useLivePreview = __esm({
25889
25501
  });
25890
25502
 
25891
25503
  // packages/experience-design-system-cli/src/import/tui/hooks/useReviewPreview.ts
25892
- import { useCallback as useCallback6, useEffect as useEffect11, useState as useState30 } from "react";
25504
+ import { useCallback as useCallback6, useEffect as useEffect11, useState as useState29 } from "react";
25893
25505
  function useReviewPreview({
25894
25506
  components,
25895
25507
  loading,
@@ -25904,8 +25516,8 @@ function useReviewPreview({
25904
25516
  allowDeletions,
25905
25517
  onResult
25906
25518
  }) {
25907
- const [previewAnnotations, setPreviewAnnotations] = useState30(/* @__PURE__ */ new Map());
25908
- const [removedComponents, setRemovedComponents] = useState30([]);
25519
+ const [previewAnnotations, setPreviewAnnotations] = useState29(/* @__PURE__ */ new Map());
25520
+ const [removedComponents, setRemovedComponents] = useState29([]);
25909
25521
  const handleResult = useCallback6(
25910
25522
  (response) => {
25911
25523
  if (!response) return;
@@ -25932,7 +25544,7 @@ function useReviewPreview({
25932
25544
  deleteAllComponents,
25933
25545
  allowDeletions
25934
25546
  });
25935
- const [spinnerTick, setSpinnerTick] = useState30(0);
25547
+ const [spinnerTick, setSpinnerTick] = useState29(0);
25936
25548
  useEffect11(() => {
25937
25549
  if (livePreviewHook.status !== "running") return;
25938
25550
  const id = setInterval(() => setSpinnerTick((tick) => tick + 1), 80);
@@ -25958,8 +25570,8 @@ var init_useReviewPreview = __esm({
25958
25570
  });
25959
25571
 
25960
25572
  // packages/experience-design-system-cli/src/import/tui/components/LivePreviewSummary.tsx
25961
- import { Box as Box53, Text as Text57 } from "ink";
25962
- import { jsx as jsx61, jsxs as jsxs54 } from "react/jsx-runtime";
25573
+ import { Box as Box52, Text as Text56 } from "ink";
25574
+ import { jsx as jsx60, jsxs as jsxs53 } from "react/jsx-runtime";
25963
25575
  function LivePreviewSummary({
25964
25576
  enabled,
25965
25577
  previewAnnotations,
@@ -25973,19 +25585,19 @@ function LivePreviewSummary({
25973
25585
  const counts = { new: 0, changed: 0, removed: 0, breaking: 0 };
25974
25586
  for (const annotation of previewAnnotations.values()) counts[annotation] += 1;
25975
25587
  const hasCounts = counts.new + counts.changed + counts.removed + counts.breaking > 0;
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...` });
25588
+ if (disabled) return /* @__PURE__ */ jsx60(Text56, { dimColor: true, children: "Preview: disabled (creds rejected)" });
25589
+ if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx60(Text56, { dimColor: true, children: `Preview: ${spinner} running...` });
25978
25590
  if (!hasCounts) return null;
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` })
25591
+ return /* @__PURE__ */ jsxs53(Box52, { children: [
25592
+ /* @__PURE__ */ jsx60(Text56, { children: "Preview: " }),
25593
+ /* @__PURE__ */ jsx60(Text56, { color: PALETTE.success, children: `${counts.new} new` }),
25594
+ /* @__PURE__ */ jsx60(Text56, { children: " \xB7 " }),
25595
+ /* @__PURE__ */ jsx60(Text56, { color: PALETTE.warning, children: `${counts.changed} changed` }),
25596
+ /* @__PURE__ */ jsx60(Text56, { children: " \xB7 " }),
25597
+ /* @__PURE__ */ jsx60(Text56, { dimColor: true, children: `${counts.removed} removed` }),
25598
+ showRemovedListHint && removedCount > 0 && /* @__PURE__ */ jsx60(Text56, { dimColor: true, children: " ([d] removed list)" }),
25599
+ /* @__PURE__ */ jsx60(Text56, { children: " \xB7 " }),
25600
+ /* @__PURE__ */ jsx60(Text56, { color: PALETTE.error, bold: true, children: `${counts.breaking} breaking` })
25989
25601
  ] });
25990
25602
  }
25991
25603
  var init_LivePreviewSummary = __esm({
@@ -25996,9 +25608,9 @@ var init_LivePreviewSummary = __esm({
25996
25608
  });
25997
25609
 
25998
25610
  // packages/experience-design-system-cli/src/import/tui/steps/GenerateReviewStep.tsx
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";
25611
+ import { useCallback as useCallback7, useEffect as useEffect12, useMemo as useMemo6, useRef as useRef9, useState as useState30 } from "react";
25612
+ import { Box as Box53, Text as Text57, useStdout as useStdout5 } from "ink";
25613
+ import { Fragment as Fragment18, jsx as jsx61, jsxs as jsxs54 } from "react/jsx-runtime";
26002
25614
  function sortComponentsForSidebar2(components, cycleParticipants) {
26003
25615
  const isEmpty2 = (entry) => Object.keys(entry.$properties ?? {}).length === 0 && Object.keys(entry.$slots ?? {}).length === 0;
26004
25616
  const tier = (c2) => {
@@ -26039,10 +25651,10 @@ function CyclePathLine({
26039
25651
  highlightComponents = false,
26040
25652
  highlightLine = false
26041
25653
  }) {
26042
- return /* @__PURE__ */ jsxs55(Text58, { color: highlightLine ? PALETTE.warning : void 0, children: [
25654
+ return /* @__PURE__ */ jsxs54(Text57, { color: highlightLine ? PALETTE.warning : void 0, children: [
26043
25655
  prefix,
26044
25656
  segments.map(
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)
25657
+ (segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx61(Text57, { color: PALETTE.info, children: segment.text }, index) : segment.kind === "arrow" ? /* @__PURE__ */ jsx61(Text57, { dimColor: true, children: segment.text }, index) : /* @__PURE__ */ jsx61(Text57, { color: highlightComponents ? PALETTE.warning : void 0, children: segment.text }, index)
26046
25658
  )
26047
25659
  ] });
26048
25660
  }
@@ -26101,9 +25713,9 @@ function GenerateReviewStep({
26101
25713
  initialFinalizeError = null,
26102
25714
  allowDeletions = false
26103
25715
  }) {
26104
- const { stdout } = useStdout6();
25716
+ const { stdout } = useStdout5();
26105
25717
  const terminalWidth = stdout?.columns ?? 80;
26106
- const [slotCycles, setSlotCycles] = useState31([]);
25718
+ const [slotCycles, setSlotCycles] = useState30([]);
26107
25719
  const setLoadedSlotCycles = useCallback7((cycles) => {
26108
25720
  setSlotCycles(cycles ?? []);
26109
25721
  }, []);
@@ -26135,7 +25747,7 @@ function GenerateReviewStep({
26135
25747
  tokensPath,
26136
25748
  onExtraLoaded: setLoadedSlotCycles
26137
25749
  });
26138
- const [nav, setNav] = useState31({
25750
+ const [nav, setNav] = useState30({
26139
25751
  cursorRowIdx: 0,
26140
25752
  sidebarScrollOffset: 0
26141
25753
  });
@@ -26151,10 +25763,10 @@ function GenerateReviewStep({
26151
25763
  finalizeError,
26152
25764
  setFinalizeError
26153
25765
  } = reviewSurface;
26154
- const [removedBannerCollapsed, setRemovedBannerCollapsed] = useState31(false);
25766
+ const [removedBannerCollapsed, setRemovedBannerCollapsed] = useState30(false);
26155
25767
  const removedBannerDefaultedRef = useRef9(false);
26156
- const [cyclePanelScroll, setCyclePanelScroll] = useState31(0);
26157
- const [cyclesCursor, setCyclesCursor] = useState31(0);
25768
+ const [cyclePanelScroll, setCyclePanelScroll] = useState30(0);
25769
+ const [cyclesCursor, setCyclesCursor] = useState30(0);
26158
25770
  const cyclePanel = useOverlayPanel({
26159
25771
  toggleKey: "c",
26160
25772
  onClose: () => {
@@ -26169,9 +25781,9 @@ function GenerateReviewStep({
26169
25781
  setBreakConfirm(false);
26170
25782
  }
26171
25783
  });
26172
- const [breakCursor, setBreakCursor] = useState31(0);
26173
- const [breakConfirm, setBreakConfirm] = useState31(false);
26174
- const [expandedGroups, setExpandedGroups] = useState31(/* @__PURE__ */ new Set());
25784
+ const [breakCursor, setBreakCursor] = useState30(0);
25785
+ const [breakConfirm, setBreakConfirm] = useState30(false);
25786
+ const [expandedGroups, setExpandedGroups] = useState30(/* @__PURE__ */ new Set());
26175
25787
  const seededGroupsRef = useRef9(false);
26176
25788
  const {
26177
25789
  searchOpen,
@@ -26190,20 +25802,20 @@ function GenerateReviewStep({
26190
25802
  setShowHelp
26191
25803
  } = useSidebarSearchState();
26192
25804
  const lineagePanel = useOverlayPanel({ toggleKey: "l" });
26193
- const [lineageCursor, setLineageCursor] = useState31(0);
25805
+ const [lineageCursor, setLineageCursor] = useState30(0);
26194
25806
  const breakingPanel = useOverlayPanel({ toggleKey: "b", onClose: () => setBreakingDetailOpen(false) });
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);
25807
+ const [breakingChanges, setBreakingChanges] = useState30([]);
25808
+ const [breakingCursor, setBreakingCursor] = useState30(0);
25809
+ const [breakingDetailOpen, setBreakingDetailOpen] = useState30(false);
25810
+ const [pendingEditorFocus, setPendingEditorFocus] = useState30(null);
25811
+ const [autoRejected, setAutoRejected] = useState30([]);
25812
+ const [undoSnapshot, setUndoSnapshot] = useState30(null);
26201
25813
  const autoRejectFiredRef = useRef9(false);
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);
25814
+ const [editorDirty, setEditorDirty] = useState30(false);
25815
+ const [showUnsavedWarning, setShowUnsavedWarning] = useState30(false);
25816
+ const [pendingFocusAway, setPendingFocusAway] = useState30(null);
25817
+ const [discardTrigger, setDiscardTrigger] = useState30(0);
25818
+ const [showReloadDialog, setShowReloadDialog] = useState30(false);
26207
25819
  const acceptedCountForPreview = components.filter((c2) => c2.status === "accepted").length;
26208
25820
  const { previewAnnotations, removedComponents, livePreviewHook, livePreviewSpinner } = useReviewPreview({
26209
25821
  components,
@@ -26264,12 +25876,12 @@ function GenerateReviewStep({
26264
25876
  } catch {
26265
25877
  }
26266
25878
  };
26267
- const componentGraph = useMemo7(() => buildComponentGraph(components), [components]);
26268
- const sidebarGraph = useMemo7(
25879
+ const componentGraph = useMemo6(() => buildComponentGraph(components), [components]);
25880
+ const sidebarGraph = useMemo6(
26269
25881
  () => buildComponentGraph(components, { stripRejectedEdges: true }),
26270
25882
  [components]
26271
25883
  );
26272
- const closures = useMemo7(() => computeAllClosures(componentGraph), [componentGraph]);
25884
+ const closures = useMemo6(() => computeAllClosures(componentGraph), [componentGraph]);
26273
25885
  useEffect12(() => {
26274
25886
  if (seededGroupsRef.current) return;
26275
25887
  if (closures.size === 0 && slotCycles.length === 0) return;
@@ -26281,14 +25893,14 @@ function GenerateReviewStep({
26281
25893
  )
26282
25894
  );
26283
25895
  }, [closures, slotCycles]);
26284
- const directIssues = useMemo7(() => {
25896
+ const directIssues = useMemo6(() => {
26285
25897
  const m = /* @__PURE__ */ new Map();
26286
25898
  for (const c2 of components) {
26287
25899
  if (c2.status === "rejected") m.set(c2.key, "error");
26288
25900
  }
26289
25901
  return m;
26290
25902
  }, [components]);
26291
- const cycleView = useMemo7(() => computeCycleView(components), [components]);
25903
+ const cycleView = useMemo6(() => computeCycleView(components), [components]);
26292
25904
  useEffect12(() => {
26293
25905
  const decision = computeAutoRejectDecision({
26294
25906
  loading,
@@ -26359,7 +25971,7 @@ function GenerateReviewStep({
26359
25971
  reviewEditor.setSaveError(null);
26360
25972
  setFinalizeError(null);
26361
25973
  };
26362
- const groupedItemsMemo = useMemo7(
25974
+ const groupedItemsMemo = useMemo6(
26363
25975
  () => components.map((c2) => ({
26364
25976
  key: c2.key,
26365
25977
  entry: c2.entry,
@@ -26367,12 +25979,12 @@ function GenerateReviewStep({
26367
25979
  })),
26368
25980
  [components, directIssues]
26369
25981
  );
26370
- const brokenKeys = useMemo7(
25982
+ const brokenKeys = useMemo6(
26371
25983
  () => new Set(breakingChanges.map((b) => b.componentName)),
26372
25984
  [breakingChanges]
26373
25985
  );
26374
- const breakingRows = useMemo7(() => buildBreakingRows(breakingChanges), [breakingChanges]);
26375
- const filterVisibleKeys = useMemo7(() => {
25986
+ const breakingRows = useMemo6(() => buildBreakingRows(breakingChanges), [breakingChanges]);
25987
+ const filterVisibleKeys = useMemo6(() => {
26376
25988
  if (jumpFilterTarget) {
26377
25989
  return findAllAncestors2(jumpFilterTarget, sidebarGraph);
26378
25990
  }
@@ -26388,7 +26000,7 @@ function GenerateReviewStep({
26388
26000
  })();
26389
26001
  return intersectFilterKeys(categoryKeys, searchKeys);
26390
26002
  }, [jumpFilterTarget, activeFilters, cycleView, brokenKeys, searchQuery, groupedItemsMemo, sidebarGraph]);
26391
- const visibleRowsMemo = useMemo7(
26003
+ const visibleRowsMemo = useMemo6(
26392
26004
  () => buildVisibleRows({
26393
26005
  items: groupedItemsMemo,
26394
26006
  cycleParticipants: cycleView.structural,
@@ -26399,7 +26011,7 @@ function GenerateReviewStep({
26399
26011
  }),
26400
26012
  [groupedItemsMemo, cycleView, expandedGroups, columnOneView, sidebarGraph, filterVisibleKeys]
26401
26013
  );
26402
- const selectableRowPositions = useMemo7(() => {
26014
+ const selectableRowPositions = useMemo6(() => {
26403
26015
  const out = [];
26404
26016
  for (let i = 0; i < visibleRowsMemo.length; i++) {
26405
26017
  if (visibleRowsMemo[i].itemIdx >= 0) out.push(i);
@@ -26445,7 +26057,7 @@ function GenerateReviewStep({
26445
26057
  selectedIdx,
26446
26058
  extractSessionId
26447
26059
  });
26448
- const renderStatusByKey = useMemo7(() => {
26060
+ const renderStatusByKey = useMemo6(() => {
26449
26061
  const merged = /* @__PURE__ */ new Map();
26450
26062
  for (const closure of closures.values()) {
26451
26063
  const per = computeRenderStatuses(closure, directIssues);
@@ -26458,7 +26070,7 @@ function GenerateReviewStep({
26458
26070
  }
26459
26071
  return merged;
26460
26072
  }, [closures, directIssues]);
26461
- const selectionStateByKey = useMemo7(() => {
26073
+ const selectionStateByKey = useMemo6(() => {
26462
26074
  const map = /* @__PURE__ */ new Map();
26463
26075
  for (const c2 of components) {
26464
26076
  if (c2.status === "accepted") map.set(c2.key, "accepted");
@@ -26467,7 +26079,7 @@ function GenerateReviewStep({
26467
26079
  }
26468
26080
  return map;
26469
26081
  }, [components]);
26470
- const searchMatches = useMemo7(() => {
26082
+ const searchMatches = useMemo6(() => {
26471
26083
  if (!searchQuery) return [];
26472
26084
  const out = [];
26473
26085
  for (const pos of selectableRowPositions) {
@@ -26477,7 +26089,7 @@ function GenerateReviewStep({
26477
26089
  }
26478
26090
  return out;
26479
26091
  }, [searchQuery, selectableRowPositions, visibleRowsMemo, components]);
26480
- const searchMatchCount = useMemo7(() => {
26092
+ const searchMatchCount = useMemo6(() => {
26481
26093
  if (searchMatches.length === 0) return 0;
26482
26094
  const seen = /* @__PURE__ */ new Set();
26483
26095
  for (const pos of searchMatches) {
@@ -26486,7 +26098,7 @@ function GenerateReviewStep({
26486
26098
  }
26487
26099
  return seen.size;
26488
26100
  }, [searchMatches, visibleRowsMemo]);
26489
- const dimPredicate = useMemo7(
26101
+ const dimPredicate = useMemo6(
26490
26102
  () => buildFlatDimPredicate({
26491
26103
  viewMode: columnOneView,
26492
26104
  searchQuery,
@@ -26517,7 +26129,7 @@ function GenerateReviewStep({
26517
26129
  }
26518
26130
  }
26519
26131
  };
26520
- const breakEdges = useMemo7(() => {
26132
+ const breakEdges = useMemo6(() => {
26521
26133
  const cycle = slotCycles[cyclesCursor];
26522
26134
  if (!cycle) return [];
26523
26135
  return enumerateCycleBreaks(cycle, components);
@@ -26959,30 +26571,30 @@ function GenerateReviewStep({
26959
26571
  }
26960
26572
  });
26961
26573
  if (loading) {
26962
- return /* @__PURE__ */ jsx62(ReviewLoadingState, {});
26574
+ return /* @__PURE__ */ jsx61(ReviewLoadingState, {});
26963
26575
  }
26964
26576
  if (loadError) {
26965
- return /* @__PURE__ */ jsx62(ReviewLoadError, { message: loadError });
26577
+ return /* @__PURE__ */ jsx61(ReviewLoadError, { message: loadError });
26966
26578
  }
26967
26579
  if (showHelp) {
26968
- return /* @__PURE__ */ jsx62(HelpOverlay, { sections: HELP_SECTIONS2, onClose: () => setShowHelp(false) });
26580
+ return /* @__PURE__ */ jsx61(HelpOverlay, { sections: HELP_SECTIONS2, onClose: () => setShowHelp(false) });
26969
26581
  }
26970
26582
  const renderBreakOverlay = (width) => {
26971
26583
  const highlightedCycle = slotCycles[cyclesCursor];
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:" }),
26584
+ return /* @__PURE__ */ jsxs54(Box53, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, width, children: [
26585
+ /* @__PURE__ */ jsx61(Text57, { bold: true, color: PALETTE.warning, children: `BREAK CYCLE ${cyclesCursor + 1} \u2014 remove a slot edge or reject a member` }),
26586
+ highlightedCycle && /* @__PURE__ */ jsx61(CyclePathLine, { segments: formatCyclePathSegments(highlightedCycle), prefix: " ", highlightComponents: true }),
26587
+ /* @__PURE__ */ jsx61(Text57, { dimColor: true, children: highlightedCycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
26588
+ /* @__PURE__ */ jsx61(Text57, { children: " " }),
26589
+ breakEdges.length > 0 && /* @__PURE__ */ jsx61(Text57, { dimColor: true, children: "remove slot edge:" }),
26978
26590
  breakEdges.map((edge, idx) => {
26979
26591
  const isCursor = idx === breakCursor;
26980
- return /* @__PURE__ */ jsx62(Text58, { inverse: isCursor, children: `${isCursor ? "\u25B6" : " "} remove '${edge.toComponent}' from ${edge.fromComponent}.$slots.${edge.slotName}.$allowedComponents` }, `break-${idx}`);
26592
+ return /* @__PURE__ */ jsx61(Text57, { inverse: isCursor, children: `${isCursor ? "\u25B6" : " "} remove '${edge.toComponent}' from ${edge.fromComponent}.$slots.${edge.slotName}.$allowedComponents` }, `break-${idx}`);
26981
26593
  }),
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" })
26594
+ breakConfirm ? /* @__PURE__ */ jsxs54(Fragment18, { children: [
26595
+ /* @__PURE__ */ jsx61(Text57, { children: " " }),
26596
+ /* @__PURE__ */ jsx61(Text57, { bold: true, color: PALETTE.warning, children: "Delete this slot edge? [y] confirm [n] cancel" })
26597
+ ] }) : /* @__PURE__ */ jsx61(Text57, { dimColor: true, children: "[\u2191\u2193/j/k] move [Enter] delete [x/Esc] close" })
26986
26598
  ] });
26987
26599
  };
26988
26600
  const breakOverlayFullScreen = breakPanel.isOpen && shouldBreakOverlayGoFullScreen({
@@ -27026,8 +26638,8 @@ function GenerateReviewStep({
27026
26638
  for (const c2 of closures.values()) if (c2.nodes.length > 1) return true;
27027
26639
  return false;
27028
26640
  })();
27029
- return /* @__PURE__ */ jsxs55(Box54, { flexDirection: "column", children: [
27030
- /* @__PURE__ */ jsx62(
26641
+ return /* @__PURE__ */ jsxs54(Box53, { flexDirection: "column", children: [
26642
+ /* @__PURE__ */ jsx61(
27031
26643
  ReviewStepDialogs,
27032
26644
  {
27033
26645
  surfaceState: reviewSurface,
@@ -27037,24 +26649,24 @@ function GenerateReviewStep({
27037
26649
  onQuit
27038
26650
  }
27039
26651
  ),
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" })
26652
+ showUnsavedWarning && !dialogOpen && /* @__PURE__ */ jsxs54(Box53, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
26653
+ /* @__PURE__ */ jsx61(Text57, { bold: true, color: PALETTE.warning, children: "Unsaved changes" }),
26654
+ /* @__PURE__ */ jsx61(Text57, { children: "You have unsaved edits in the current field editor." }),
26655
+ /* @__PURE__ */ jsx61(Text57, { children: " " }),
26656
+ /* @__PURE__ */ jsx61(Text57, { children: " [Enter] Save and continue" }),
26657
+ /* @__PURE__ */ jsx61(Text57, { children: " [Esc] Discard changes and continue" }),
26658
+ /* @__PURE__ */ jsx61(Text57, { children: " [Tab] Stay in the panel" })
27047
26659
  ] }),
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))
26660
+ /* @__PURE__ */ jsx61(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
26661
+ removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs54(Box53, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
26662
+ /* @__PURE__ */ jsx61(Text57, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
26663
+ !removedBannerCollapsed && /* @__PURE__ */ jsxs54(Fragment18, { children: [
26664
+ /* @__PURE__ */ jsx61(Text57, { children: " " }),
26665
+ removedComponents.map((rc) => /* @__PURE__ */ jsx61(Text57, { children: removedComponentLine(rc) }, rc.id))
27054
26666
  ] })
27055
26667
  ] }),
27056
- breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx62(Box54, { paddingX: 1, children: /* @__PURE__ */ jsx62(
27057
- Text58,
26668
+ breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx61(Box53, { paddingX: 1, children: /* @__PURE__ */ jsx61(
26669
+ Text57,
27058
26670
  {
27059
26671
  color: PALETTE.warning,
27060
26672
  children: `[b] ${breakingChanges.length} breaking change${breakingChanges.length === 1 ? "" : "s"}`
@@ -27064,32 +26676,32 @@ function GenerateReviewStep({
27064
26676
  const row = breakingRows[breakingCursor];
27065
26677
  const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
27066
26678
  if (!comp) return null;
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" })
26679
+ return /* @__PURE__ */ jsxs54(Box53, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
26680
+ /* @__PURE__ */ jsx61(Text57, { bold: true, color: PALETTE.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
26681
+ comp.impact && /* @__PURE__ */ jsx61(Text57, { dimColor: true, children: ` affects ${comp.impact.affectedExperiences} experience${comp.impact.affectedExperiences === 1 ? "" : "s"}, ${comp.impact.affectedFragments} fragment${comp.impact.affectedFragments === 1 ? "" : "s"}` }),
26682
+ comp.changes.length === 0 ? /* @__PURE__ */ jsx61(Text57, { dimColor: true, children: " (no enumerated changes)" }) : comp.changes.map((change, ci) => /* @__PURE__ */ jsx61(Text57, { children: ` \u2022 ${formatBreakingChange(change, comp.current)}` }, `bd-detail-${ci}`)),
26683
+ /* @__PURE__ */ jsx61(Text57, { dimColor: true, children: "[D/Esc] close detail" })
27072
26684
  ] });
27073
26685
  })(),
27074
26686
  cyclePanel.isOpen && !dialogOpen && (() => {
27075
26687
  const PANEL_H = 20;
27076
26688
  const lines = [];
27077
26689
  lines.push(
27078
- /* @__PURE__ */ jsx62(Text58, { bold: true, color: PALETTE.warning, children: `SLOT DEPENDENCY CYCLES (${slotCycles.length})` }, "cyc-title")
26690
+ /* @__PURE__ */ jsx61(Text57, { bold: true, color: PALETTE.warning, children: `SLOT DEPENDENCY CYCLES (${slotCycles.length})` }, "cyc-title")
27079
26691
  );
27080
26692
  lines.push(
27081
- /* @__PURE__ */ jsx62(Text58, { dimColor: true, children: "push will fail until these are resolved" }, "cyc-sub")
26693
+ /* @__PURE__ */ jsx61(Text57, { dimColor: true, children: "push will fail until these are resolved" }, "cyc-sub")
27082
26694
  );
27083
26695
  lines.push(
27084
- /* @__PURE__ */ jsx62(Text58, { dimColor: true, children: "To fix: reject a cycle member, or break the cycle by removing a slot edge." }, "cyc-guide")
26696
+ /* @__PURE__ */ jsx61(Text57, { dimColor: true, children: "To fix: reject a cycle member, or break the cycle by removing a slot edge." }, "cyc-guide")
27085
26697
  );
27086
- lines.push(/* @__PURE__ */ jsx62(Text58, { children: " " }, "cyc-space"));
26698
+ lines.push(/* @__PURE__ */ jsx61(Text57, { children: " " }, "cyc-space"));
27087
26699
  slotCycles.forEach((cycle, idx) => {
27088
26700
  const nodeCount = new Set(cycle.path).size;
27089
26701
  const isCursor = idx === cyclesCursor;
27090
26702
  lines.push(
27091
- /* @__PURE__ */ jsx62(
27092
- Text58,
26703
+ /* @__PURE__ */ jsx61(
26704
+ Text57,
27093
26705
  {
27094
26706
  bold: true,
27095
26707
  inverse: isCursor,
@@ -27099,23 +26711,23 @@ function GenerateReviewStep({
27099
26711
  )
27100
26712
  );
27101
26713
  lines.push(
27102
- /* @__PURE__ */ jsx62(CyclePathLine, { segments: formatCyclePathSegments(cycle, 16), prefix: " " }, `cyc-p-${idx}`)
26714
+ /* @__PURE__ */ jsx61(CyclePathLine, { segments: formatCyclePathSegments(cycle, 16), prefix: " " }, `cyc-p-${idx}`)
27103
26715
  );
27104
26716
  if (cycle.suggestedBreak) {
27105
26717
  const b = cycle.suggestedBreak;
27106
26718
  lines.push(
27107
- /* @__PURE__ */ jsx62(Text58, { dimColor: true, children: ` Suggested fix: remove '${b.toComponent}' from ${b.fromComponent}.$slots.${b.slotName}.$allowedComponents` }, `cyc-f-${idx}`)
26719
+ /* @__PURE__ */ jsx61(Text57, { dimColor: true, children: ` Suggested fix: remove '${b.toComponent}' from ${b.fromComponent}.$slots.${b.slotName}.$allowedComponents` }, `cyc-f-${idx}`)
27108
26720
  );
27109
26721
  }
27110
- lines.push(/* @__PURE__ */ jsx62(Text58, { children: " " }, `cyc-s-${idx}`));
26722
+ lines.push(/* @__PURE__ */ jsx61(Text57, { children: " " }, `cyc-s-${idx}`));
27111
26723
  });
27112
26724
  const visible = lines.slice(cyclePanelScroll, cyclePanelScroll + PANEL_H);
27113
- return /* @__PURE__ */ jsxs55(Box54, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
26725
+ return /* @__PURE__ */ jsxs54(Box53, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
27114
26726
  visible,
27115
- /* @__PURE__ */ jsx62(Text58, { dimColor: true, children: "[\u2191\u2193/j/k] move [Enter] jump [x] break cycle [c/q/Esc] close" })
26727
+ /* @__PURE__ */ jsx61(Text57, { dimColor: true, children: "[\u2191\u2193/j/k] move [Enter] jump [x] break cycle [c/q/Esc] close" })
27116
26728
  ] });
27117
26729
  })(),
27118
- !dialogOpen && /* @__PURE__ */ jsx62(
26730
+ !dialogOpen && /* @__PURE__ */ jsx61(
27119
26731
  LivePreviewSummary,
27120
26732
  {
27121
26733
  enabled: livePreview,
@@ -27134,598 +26746,78 @@ function GenerateReviewStep({
27134
26746
  const participantSet = cycleView.structural;
27135
26747
  const members = stillRejected.filter((n) => participantSet.has(n)).sort();
27136
26748
  const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
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" })
26749
+ return /* @__PURE__ */ jsxs54(Box53, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.error, paddingX: 1, children: [
26750
+ /* @__PURE__ */ jsx61(Text57, { color: PALETTE.error, bold: true, children: `Cyclic manifest \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
26751
+ members.length > 0 && /* @__PURE__ */ jsx61(Text57, { color: PALETTE.error, children: ` Cycle members: ${members.join(", ")}` }),
26752
+ ancestors.length > 0 && /* @__PURE__ */ jsx61(Text57, { color: PALETTE.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
26753
+ /* @__PURE__ */ jsx61(Text57, { dimColor: true, children: undoSnapshot ? " [Ctrl+Z] undo \xB7 [r]/[a] manually toggle \xB7 [F] continue" : " [r]/[a] manually toggle \xB7 [F] continue" })
27142
26754
  ] });
27143
26755
  })(),
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(
26756
+ /* @__PURE__ */ jsx61(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
26757
+ /* @__PURE__ */ jsx61(ReviewFinalizeError, { message: finalizeError, hidden: dialogOpen }),
26758
+ !dialogOpen && /* @__PURE__ */ jsxs54(Box53, { children: [
26759
+ breakingPanel.isOpen ? /* @__PURE__ */ jsx61(
27148
26760
  GotoBanner,
27149
26761
  {
27150
26762
  title: "Breaking changes",
27151
26763
  rows: breakingRows.map((r) => ({
27152
26764
  label: r.label,
27153
- jumpTarget: r.componentName
27154
- })),
27155
- cursor: breakingCursor,
27156
- maxRows: panelMaxRows,
27157
- width: sidebarWidth,
27158
- footerHint: "[\u2191/\u2193] move \xB7 [Enter] jump \xB7 [D] detail \xB7 [Esc] close"
27159
- }
27160
- ) : lineagePanel.isOpen && focusedComponentKey ? /* @__PURE__ */ jsx62(
27161
- LineagePanel,
27162
- {
27163
- focusedComponentKey,
27164
- entries: lineageEntries,
27165
- cursor: lineageCursor,
27166
- jumpables: lineageJumpables,
27167
- maxRows: panelMaxRows,
27168
- width: sidebarWidth
27169
- }
27170
- ) : /* @__PURE__ */ jsx62(
27171
- GroupedSidebar,
27172
- {
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,
26765
+ jumpTarget: r.componentName
26766
+ })),
26767
+ cursor: breakingCursor,
26768
+ maxRows: panelMaxRows,
26769
+ width: sidebarWidth,
26770
+ footerHint: "[\u2191/\u2193] move \xB7 [Enter] jump \xB7 [D] detail \xB7 [Esc] close"
26771
+ }
26772
+ ) : lineagePanel.isOpen && focusedComponentKey ? /* @__PURE__ */ jsx61(
26773
+ LineagePanel,
27711
26774
  {
27712
- components: sidebarItems,
27713
- selectedId: selected?.key ?? null,
27714
- focused: sidebarFocused,
27715
- scrollOffset: sidebarScrollOffset,
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);
26775
+ focusedComponentKey,
26776
+ entries: lineageEntries,
26777
+ cursor: lineageCursor,
26778
+ jumpables: lineageJumpables,
26779
+ maxRows: panelMaxRows,
26780
+ width: sidebarWidth
26781
+ }
26782
+ ) : /* @__PURE__ */ jsx61(
26783
+ GroupedSidebar,
26784
+ {
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
+ }
27722
26795
  }
26796
+ reviewEditor.setJsonScrollOffset(0);
27723
26797
  },
27724
- onScrollChange: setSidebarScrollOffset,
27725
- width: sidebarWidth
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,
26808
+ focused: sidebarFocused,
26809
+ renderStatusByKey,
26810
+ previewAnnotationByKey,
26811
+ selectionStateByKey,
26812
+ scrollOffset: sidebarScrollOffset,
26813
+ visibleCount,
26814
+ dimPredicate,
26815
+ visibleRows: visibleRowsMemo,
26816
+ viewMode: columnOneView,
26817
+ graph: sidebarGraph
27726
26818
  }
27727
26819
  ),
27728
- selected ? /* @__PURE__ */ jsx63(
26820
+ selected ? /* @__PURE__ */ jsx61(
27729
26821
  ReviewComponentPanel,
27730
26822
  {
27731
26823
  selectedKey: selected.key,
@@ -27734,55 +26826,224 @@ function AtomicGenerateReviewStep({
27734
26826
  reviewMetadata,
27735
26827
  reviewEditor,
27736
26828
  width: panelWidth,
27737
- height: PANEL_HEIGHT2,
27738
- sourceBorderColor: PALETTE.border,
26829
+ height: PANEL_HEIGHT,
27739
26830
  jsonValue: visibleJsonPanelValue,
27740
26831
  sidebarFocused,
27741
- fieldEditor: buildReviewFieldEditor(reviewEditor, selectedJson, () => setSidebarFocused(true)),
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
+ }),
27742
26842
  saveError: reviewEditor.saveError,
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",
26843
+ sidebarFooter: hasGroupRoots ? " [Space] expand/collapse group [E/C] expand/collapse all" : "",
27744
26844
  livePreview: livePreviewHook,
27745
26845
  livePreviewSpinner
27746
26846
  }
27747
- ) : /* @__PURE__ */ jsx63(ReviewNoSelection, {})
26847
+ ) : /* @__PURE__ */ jsx61(ReviewNoSelection, {})
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" })
27748
26866
  ] }),
27749
- !dialogOpen && /* @__PURE__ */ jsx63(ReviewStatusBar, { entries: components, onApproveAll: acceptAll, onFinalize: () => setShowFinalize(true) })
26867
+ /* @__PURE__ */ jsx61(
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
+ )
27750
26924
  ] });
27751
26925
  }
27752
- var VISIBLE_COUNT3, PANEL_HEIGHT2;
27753
- var init_AtomicGenerateReviewStep = __esm({
27754
- "packages/experience-design-system-cli/src/import/tui/steps/AtomicGenerateReviewStep.tsx"() {
26926
+ var PANEL_HEIGHT, HELP_SECTIONS2;
26927
+ var init_GenerateReviewStep = __esm({
26928
+ "packages/experience-design-system-cli/src/import/tui/steps/GenerateReviewStep.tsx"() {
27755
26929
  "use strict";
27756
- init_Sidebar();
26930
+ init_theme();
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();
27757
26938
  init_useImmediateInput();
26939
+ init_db();
26940
+ init_cycle_detection();
26941
+ init_cycle_panel_scroll();
27758
26942
  init_useFinalizePreview();
27759
- init_theme();
26943
+ init_fuzzy_search();
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();
27760
26966
  init_ReviewComponentPanel();
27761
- init_review_json_panel();
27762
- init_LivePreviewSummary();
27763
26967
  init_ReviewStatus();
27764
- init_review_input();
27765
26968
  init_useReviewSession();
27766
26969
  init_useReviewEditor();
27767
26970
  init_useReviewSurfaceState();
27768
- init_useReviewPreview();
27769
26971
  init_ReviewDialogs();
27770
- init_useTerminalColumns();
27771
- VISIBLE_COUNT3 = 20;
27772
- PANEL_HEIGHT2 = 22;
26972
+ init_review_input();
26973
+ init_useReviewPreview();
26974
+ init_LivePreviewSummary();
26975
+ init_cycle_auto_reject();
26976
+ PANEL_HEIGHT = 22;
26977
+ HELP_SECTIONS2 = [
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
+ ];
27773
27035
  }
27774
27036
  });
27775
27037
 
27776
27038
  // packages/experience-design-system-cli/src/import/tui/final-review-host.tsx
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";
27039
+ import { Box as Box54, Text as Text58 } from "ink";
27040
+ import React23 from "react";
27041
+ import { jsx as jsx62, jsxs as jsxs55 } from "react/jsx-runtime";
27780
27042
  function FinalReviewHost({
27781
27043
  extractSessionId,
27782
27044
  tokenSessionId,
27783
27045
  generatedCount,
27784
27046
  autoAccept,
27785
- compositionMode = "atomic",
27786
27047
  onFinalize,
27787
27048
  onQuit,
27788
27049
  livePreview,
@@ -27795,14 +27056,13 @@ function FinalReviewHost({
27795
27056
  allowDeletions
27796
27057
  }) {
27797
27058
  if (!extractSessionId) {
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." }) });
27059
+ return /* @__PURE__ */ jsx62(Box54, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx62(Text58, { color: PALETTE.error, children: "Error: no session ID \u2014 cannot load generated definitions." }) });
27799
27060
  }
27800
27061
  if (autoAccept) {
27801
- return /* @__PURE__ */ jsx64(FinalReviewAutoAccept, { generatedCount, onFinalize });
27062
+ return /* @__PURE__ */ jsx62(FinalReviewAutoAccept, { generatedCount, onFinalize });
27802
27063
  }
27803
- const StepComponent = compositionMode === "atomic" ? AtomicGenerateReviewStep : GenerateReviewStep;
27804
- return /* @__PURE__ */ jsx64(
27805
- StepComponent,
27064
+ return /* @__PURE__ */ jsx62(
27065
+ GenerateReviewStep,
27806
27066
  {
27807
27067
  extractSessionId,
27808
27068
  tokenSessionId,
@@ -27815,7 +27075,7 @@ function FinalReviewHost({
27815
27075
  host,
27816
27076
  tokensPath,
27817
27077
  initialFinalizeError,
27818
- ...compositionMode !== "atomic" ? { allowDeletions } : {}
27078
+ allowDeletions
27819
27079
  }
27820
27080
  );
27821
27081
  }
@@ -27823,10 +27083,10 @@ function FinalReviewAutoAccept({
27823
27083
  generatedCount,
27824
27084
  onFinalize
27825
27085
  }) {
27826
- React25.useEffect(() => {
27086
+ React23.useEffect(() => {
27827
27087
  onFinalize(generatedCount, 0, 0);
27828
27088
  }, []);
27829
- return /* @__PURE__ */ jsx64(Box56, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsxs57(Text60, { dimColor: true, children: [
27089
+ return /* @__PURE__ */ jsx62(Box54, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsxs55(Text58, { dimColor: true, children: [
27830
27090
  "Auto-accepting ",
27831
27091
  generatedCount,
27832
27092
  " generated components..."
@@ -27837,7 +27097,6 @@ var init_final_review_host = __esm({
27837
27097
  "use strict";
27838
27098
  init_theme();
27839
27099
  init_GenerateReviewStep();
27840
- init_AtomicGenerateReviewStep();
27841
27100
  }
27842
27101
  });
27843
27102
 
@@ -27936,8 +27195,8 @@ __export(WizardApp_exports, {
27936
27195
  parsePrintTokensCount: () => parsePrintTokensCount,
27937
27196
  shouldRunMapTokens: () => shouldRunMapTokens
27938
27197
  });
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";
27198
+ import { useEffect as useEffect13, useRef as useRef10, useState as useState31 } from "react";
27199
+ import { Box as Box55, Text as Text59, useStdout as useStdout6 } from "ink";
27941
27200
  import { join as join25, resolve as resolve25 } from "node:path";
27942
27201
  import { appendFileSync as appendFileSync2, writeFileSync } from "node:fs";
27943
27202
  import { access as access8, readFile as readFile23, stat as stat6 } from "node:fs/promises";
@@ -27945,7 +27204,7 @@ import { tmpdir } from "node:os";
27945
27204
  import { execFile as execFile4, spawn as spawn4 } from "node:child_process";
27946
27205
  import { mkdir as mkdir7 } from "node:fs/promises";
27947
27206
  import { buildManifest as buildManifest4 } from "@contentful/experience-design-system-types";
27948
- import { jsx as jsx65, jsxs as jsxs58 } from "react/jsx-runtime";
27207
+ import { jsx as jsx63, jsxs as jsxs56 } from "react/jsx-runtime";
27949
27208
  function buildSelectAgentArgs(opts) {
27950
27209
  const args = ["analyze", "select-agent", "--agent", opts.agent, "--session", opts.sessionId, "--exclude-invalid"];
27951
27210
  if (opts.model) args.push("--model", opts.model);
@@ -28065,7 +27324,6 @@ function WizardApp({
28065
27324
  host,
28066
27325
  autoAcceptScope = false,
28067
27326
  autoRejectCycles = false,
28068
- compositionMode = "atomic",
28069
27327
  compositionMap,
28070
27328
  compositionAgent = false,
28071
27329
  compositionAgentMode,
@@ -28094,7 +27352,7 @@ function WizardApp({
28094
27352
  } = {}) {
28095
27353
  const defaultConfiguredHost = toConfiguredHost(host || process.env["EDS_HOST"]) ?? DEFAULT_CONFIGURED_HOST;
28096
27354
  const resolveWizardHost = (hostValue) => hostValue || defaultConfiguredHost;
28097
- const { stdout } = useStdout7();
27355
+ const { stdout } = useStdout6();
28098
27356
  const terminalWidth = stdout?.columns ?? 80;
28099
27357
  const logInit = useRef10(false);
28100
27358
  if (!logInit.current) {
@@ -28118,7 +27376,7 @@ function WizardApp({
28118
27376
  const initialStepResolved = modifyEntryReady ? "final-review" : pushFromPickerReady ? "push-from-picker" : rawTokensEntryReady ? "generating-tokens" : initialProjectPath ? "token-input" : "welcome";
28119
27377
  const initialOutDir = initialProjectPath ? join25(resolve25(initialProjectPath), ".contentful") : "";
28120
27378
  const initialTokensPath = (modifyEntryReady || pushFromPickerReady) && initialOutDir && seedTokenSessionId ? join25(initialOutDir, "tokens.json") : "";
28121
- const [state, setState] = useState33({
27379
+ const [state, setState] = useState31({
28122
27380
  step: modifyEntryReady || rawTokensEntryReady || pushFromPickerReady ? initialStepResolved : initialRuns && initialRuns.length > 0 ? "run-picker" : initialStepResolved,
28123
27381
  agent: initialAgent ?? "claude",
28124
27382
  ...initialModel ? { agentModel: initialModel } : {},
@@ -28364,17 +27622,14 @@ If you are using AWS Bedrock, run:
28364
27622
  const outDir = join25(resolve25(projectPath), ".contentful");
28365
27623
  update({ step: "extracting", outDir, extractProgress: null, compositionPhase: null });
28366
27624
  const extractArgs = [findCliPath(), "analyze", "extract", "--project", projectPath];
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
- }
27625
+ if (compositionMap) extractArgs.push("--composition-map", compositionMap);
27626
+ if (compositionAgent) extractArgs.push("--composition-agent");
27627
+ if (compositionAgentMode) extractArgs.push("--composition-agent-mode", compositionAgentMode);
27628
+ if (compositionRefresh) extractArgs.push("--composition-refresh");
27629
+ if (generateMap) extractArgs.push("--generate-map", generateMap);
27630
+ for (const p of promptOverrides ?? []) extractArgs.push("--prompt", p);
27631
+ if (state.agent) extractArgs.push("--agent", state.agent);
27632
+ if (state.bedrock) extractArgs.push("--bedrock");
28378
27633
  const r = await runSpawnedCli(extractArgs, (chunk) => {
28379
27634
  for (const line of chunk.split("\n")) {
28380
27635
  const scanMatch = /^progress=scan:(\d+)$/.exec(line.trim());
@@ -29217,8 +28472,7 @@ If using a custom --host, make sure the space exists on that host.`
29217
28472
  extractSessionId: state.extractSessionId ?? "",
29218
28473
  generateSessionId: state.generateSessionId,
29219
28474
  sourceFingerprint,
29220
- savedFingerprint,
29221
- compositionMode
28475
+ savedFingerprint
29222
28476
  });
29223
28477
  setState((prev) => ({ ...prev, lastRunId: record.id }));
29224
28478
  } catch (err) {
@@ -29291,7 +28545,7 @@ If using a custom --host, make sure the space exists on that host.`
29291
28545
  const stepContent = (() => {
29292
28546
  switch (state.step) {
29293
28547
  case "run-picker":
29294
- return /* @__PURE__ */ jsx65(
28548
+ return /* @__PURE__ */ jsx63(
29295
28549
  RunPicker,
29296
28550
  {
29297
28551
  runs: initialRuns ?? [],
@@ -29306,7 +28560,7 @@ If using a custom --host, make sure the space exists on that host.`
29306
28560
  }
29307
28561
  );
29308
28562
  case "welcome":
29309
- return /* @__PURE__ */ jsx65(
28563
+ return /* @__PURE__ */ jsx63(
29310
28564
  WelcomeStep,
29311
28565
  {
29312
28566
  onContinue: (path) => {
@@ -29318,7 +28572,7 @@ If using a custom --host, make sure the space exists on that host.`
29318
28572
  }
29319
28573
  );
29320
28574
  case "token-input":
29321
- return /* @__PURE__ */ jsx65(
28575
+ return /* @__PURE__ */ jsx63(
29322
28576
  TokenInputStep,
29323
28577
  {
29324
28578
  onConfirm: (rawTokensPath) => {
@@ -29329,7 +28583,7 @@ If using a custom --host, make sure the space exists on that host.`
29329
28583
  }
29330
28584
  );
29331
28585
  case "token-reuse-gate":
29332
- return /* @__PURE__ */ jsx65(
28586
+ return /* @__PURE__ */ jsx63(
29333
28587
  GateStep,
29334
28588
  {
29335
28589
  successMessage: "Existing tokens.json found",
@@ -29351,7 +28605,7 @@ If using a custom --host, make sure the space exists on that host.`
29351
28605
  }
29352
28606
  );
29353
28607
  case "checking-claude-auth":
29354
- return /* @__PURE__ */ jsx65(
28608
+ return /* @__PURE__ */ jsx63(
29355
28609
  RunningStep,
29356
28610
  {
29357
28611
  stepNumber: state.authCheckStepNumber,
@@ -29361,7 +28615,7 @@ If using a custom --host, make sure the space exists on that host.`
29361
28615
  }
29362
28616
  );
29363
28617
  case "generating-tokens":
29364
- return /* @__PURE__ */ jsx65(
28618
+ return /* @__PURE__ */ jsx63(
29365
28619
  RunningStep,
29366
28620
  {
29367
28621
  stepNumber: 1,
@@ -29371,7 +28625,7 @@ If using a custom --host, make sure the space exists on that host.`
29371
28625
  }
29372
28626
  );
29373
28627
  case "path-validation":
29374
- return /* @__PURE__ */ jsx65(
28628
+ return /* @__PURE__ */ jsx63(
29375
28629
  PathValidationStep,
29376
28630
  {
29377
28631
  projectPath: state.projectPath,
@@ -29411,7 +28665,7 @@ If using a custom --host, make sure the space exists on that host.`
29411
28665
  if (phase === "done") return "Composition mapping resolved \u2713";
29412
28666
  return `Composition: ${phase}`;
29413
28667
  })();
29414
- return /* @__PURE__ */ jsx65(
28668
+ return /* @__PURE__ */ jsx63(
29415
28669
  RunningStep,
29416
28670
  {
29417
28671
  stepNumber: hasTokens ? 2 : 1,
@@ -29425,7 +28679,7 @@ If using a custom --host, make sure the space exists on that host.`
29425
28679
  }
29426
28680
  case "scope-gate": {
29427
28681
  if (!state.extractSessionId) {
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." }) });
28682
+ return /* @__PURE__ */ jsx63(Box55, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx63(Text59, { color: PALETTE.error, children: "Error: extract session ID missing \u2014 please re-run." }) });
29429
28683
  }
29430
28684
  const sessionId2 = state.extractSessionId;
29431
28685
  const db = openPipelineDb();
@@ -29436,12 +28690,11 @@ If using a custom --host, make sure the space exists on that host.`
29436
28690
  db.close();
29437
28691
  }
29438
28692
  components = mergeAiDecisions(components, state.aiDecisions);
29439
- return /* @__PURE__ */ jsx65(
28693
+ return /* @__PURE__ */ jsx63(
29440
28694
  ScopeGateHost,
29441
28695
  {
29442
28696
  components,
29443
28697
  autoAccept: autoAcceptScope,
29444
- compositionMode,
29445
28698
  aiFilterStatus: state.aiFilterStatus,
29446
28699
  aiFilterProgress: state.aiFilterProgress,
29447
28700
  aiFilterError: state.aiFilterError,
@@ -29481,7 +28734,7 @@ If using a custom --host, make sure the space exists on that host.`
29481
28734
  const p = state.generateProgress;
29482
28735
  const stepNum = hasTokens ? 4 : 3;
29483
28736
  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)`;
29484
- return /* @__PURE__ */ jsx65(
28737
+ return /* @__PURE__ */ jsx63(
29485
28738
  RunningStep,
29486
28739
  {
29487
28740
  stepNumber: stepNum,
@@ -29494,7 +28747,7 @@ If using a custom --host, make sure the space exists on that host.`
29494
28747
  }
29495
28748
  case "mapping-tokens": {
29496
28749
  const stepNum = hasTokens ? 5 : 4;
29497
- return /* @__PURE__ */ jsx65(
28750
+ return /* @__PURE__ */ jsx63(
29498
28751
  RunningStep,
29499
28752
  {
29500
28753
  stepNumber: stepNum,
@@ -29506,14 +28759,13 @@ If using a custom --host, make sure the space exists on that host.`
29506
28759
  );
29507
28760
  }
29508
28761
  case "final-review": {
29509
- return /* @__PURE__ */ jsx65(
28762
+ return /* @__PURE__ */ jsx63(
29510
28763
  FinalReviewHost,
29511
28764
  {
29512
28765
  extractSessionId: state.extractSessionId,
29513
28766
  tokenSessionId: state.tokenSessionId,
29514
28767
  generatedCount: state.generatedCount,
29515
28768
  autoAccept: autoAcceptScope,
29516
- compositionMode,
29517
28769
  livePreview,
29518
28770
  spaceId: state.spaceId,
29519
28771
  environmentId: state.environmentId,
@@ -29654,7 +28906,7 @@ If using a custom --host, make sure the space exists on that host.`
29654
28906
  const files = [tokenDesc, compDesc].filter(Boolean).join(" and ");
29655
28907
  const count = state.generatedAcceptedCount > 0 ? state.generatedAcceptedCount : state.generatedCount;
29656
28908
  const summary = hasComponents ? `${count} component definition${count !== 1 ? "s" : ""} ready${hasTokens ? ", design tokens ready" : ""}.` : hasTokens ? "Design tokens ready." : "Ready to continue.";
29657
- return /* @__PURE__ */ jsx65(
28909
+ return /* @__PURE__ */ jsx63(
29658
28910
  PushDecisionGateStep,
29659
28911
  {
29660
28912
  summary,
@@ -29686,7 +28938,7 @@ If using a custom --host, make sure the space exists on that host.`
29686
28938
  );
29687
28939
  }
29688
28940
  case "credentials":
29689
- return /* @__PURE__ */ jsx65(
28941
+ return /* @__PURE__ */ jsx63(
29690
28942
  CredentialsStep,
29691
28943
  {
29692
28944
  initialSpaceId: state.spaceId,
@@ -29719,7 +28971,7 @@ If using a custom --host, make sure the space exists on that host.`
29719
28971
  );
29720
28972
  case "push-from-picker":
29721
28973
  case "previewing":
29722
- return /* @__PURE__ */ jsx65(
28974
+ return /* @__PURE__ */ jsx63(
29723
28975
  RunningStep,
29724
28976
  {
29725
28977
  stepNumber: totalSteps,
@@ -29732,7 +28984,7 @@ If using a custom --host, make sure the space exists on that host.`
29732
28984
  const editableComponentCount = Object.keys(state.manifest?.componentsManifest ?? {}).filter(
29733
28985
  (k) => k !== "$schema"
29734
28986
  ).length;
29735
- return /* @__PURE__ */ jsx65(
28987
+ return /* @__PURE__ */ jsx63(
29736
28988
  WizardPreviewStep,
29737
28989
  {
29738
28990
  preview: state.serverPreview,
@@ -29762,9 +29014,9 @@ If using a custom --host, make sure the space exists on that host.`
29762
29014
  );
29763
29015
  }
29764
29016
  case "pushing":
29765
- return /* @__PURE__ */ jsx65(PushingStep, { stepNumber: totalSteps, totalSteps, progress: state.pushProgress });
29017
+ return /* @__PURE__ */ jsx63(PushingStep, { stepNumber: totalSteps, totalSteps, progress: state.pushProgress });
29766
29018
  case "path-prompt":
29767
- return /* @__PURE__ */ jsx65(
29019
+ return /* @__PURE__ */ jsx63(
29768
29020
  PathPrompt,
29769
29021
  {
29770
29022
  defaultPath: state.outDir,
@@ -29783,7 +29035,7 @@ If using a custom --host, make sure the space exists on that host.`
29783
29035
  }
29784
29036
  );
29785
29037
  case "save-conflict-gate":
29786
- return /* @__PURE__ */ jsx65(
29038
+ return /* @__PURE__ */ jsx63(
29787
29039
  SaveConflictGate,
29788
29040
  {
29789
29041
  path: state.outDir,
@@ -29801,7 +29053,7 @@ If using a custom --host, make sure the space exists on that host.`
29801
29053
  }
29802
29054
  );
29803
29055
  case "printing":
29804
- return /* @__PURE__ */ jsx65(
29056
+ return /* @__PURE__ */ jsx63(
29805
29057
  RunningStep,
29806
29058
  {
29807
29059
  stepNumber: totalSteps,
@@ -29812,7 +29064,7 @@ If using a custom --host, make sure the space exists on that host.`
29812
29064
  );
29813
29065
  case "print-gate": {
29814
29066
  const teaser = buildRunTeaserLine(state.lastRunId);
29815
- return /* @__PURE__ */ jsx65(
29067
+ return /* @__PURE__ */ jsx63(
29816
29068
  GateStep,
29817
29069
  {
29818
29070
  successMessage: "Files saved",
@@ -29831,7 +29083,7 @@ If using a custom --host, make sure the space exists on that host.`
29831
29083
  case "done": {
29832
29084
  const totalFailed = state.pushResult.componentTypes.failed + state.pushResult.designTokens.failed;
29833
29085
  const teaser = buildRunTeaserLine(state.lastRunId);
29834
- return /* @__PURE__ */ jsx65(
29086
+ return /* @__PURE__ */ jsx63(
29835
29087
  DoneStep,
29836
29088
  {
29837
29089
  componentTypes: state.pushResult.componentTypes,
@@ -29847,7 +29099,7 @@ If using a custom --host, make sure the space exists on that host.`
29847
29099
  );
29848
29100
  }
29849
29101
  case "preview-validation-error": {
29850
- return /* @__PURE__ */ jsx65(
29102
+ return /* @__PURE__ */ jsx63(
29851
29103
  PreviewValidationErrorStep,
29852
29104
  {
29853
29105
  errors: state.previewValidationErrors,
@@ -29863,7 +29115,7 @@ If using a custom --host, make sure the space exists on that host.`
29863
29115
  );
29864
29116
  }
29865
29117
  case "error":
29866
- return /* @__PURE__ */ jsx65(
29118
+ return /* @__PURE__ */ jsx63(
29867
29119
  ErrorStep,
29868
29120
  {
29869
29121
  stepName: state.errorStep,
@@ -29876,9 +29128,9 @@ If using a custom --host, make sure the space exists on that host.`
29876
29128
  return null;
29877
29129
  }
29878
29130
  })();
29879
- return /* @__PURE__ */ jsxs58(Box57, { flexDirection: "column", width: terminalWidth, children: [
29880
- /* @__PURE__ */ jsx65(TopBar, { subcommand: "import", hints }),
29881
- /* @__PURE__ */ jsx65(CustomPromptBanner, { selectPromptPath, generatePromptPath }),
29131
+ return /* @__PURE__ */ jsxs56(Box55, { flexDirection: "column", width: terminalWidth, children: [
29132
+ /* @__PURE__ */ jsx63(TopBar, { subcommand: "import", hints }),
29133
+ /* @__PURE__ */ jsx63(CustomPromptBanner, { selectPromptPath, generatePromptPath }),
29882
29134
  stepContent
29883
29135
  ] });
29884
29136
  }
@@ -30066,15 +29318,15 @@ var push_creds_prompt_exports = {};
30066
29318
  __export(push_creds_prompt_exports, {
30067
29319
  promptForPushCredentials: () => promptForPushCredentials
30068
29320
  });
30069
- import React27 from "react";
29321
+ import React25 from "react";
30070
29322
  async function promptForPushCredentials(opts = {}) {
30071
- const { render: render7, Box: Box58, Text: Text62 } = await import("ink");
30072
- const { useState: useState34 } = await import("react");
29323
+ const { render: render7, Box: Box56, Text: Text60 } = await import("ink");
29324
+ const { useState: useState32 } = await import("react");
30073
29325
  const { CredentialsStep: CredentialsStep2 } = await Promise.resolve().then(() => (init_CredentialsStep(), CredentialsStep_exports));
30074
29326
  return new Promise((resolve29, reject) => {
30075
29327
  let app = null;
30076
29328
  function App2() {
30077
- const [done, setDone] = useState34(false);
29329
+ const [done, setDone] = useState32(false);
30078
29330
  const handle = (spaceId, environmentId, cmaToken, host) => {
30079
29331
  if (done) return;
30080
29332
  setDone(true);
@@ -30084,9 +29336,9 @@ async function promptForPushCredentials(opts = {}) {
30084
29336
  });
30085
29337
  };
30086
29338
  if (done) {
30087
- return React27.createElement(Box58, null, React27.createElement(Text62, null, ""));
29339
+ return React25.createElement(Box56, null, React25.createElement(Text60, null, ""));
30088
29340
  }
30089
- return React27.createElement(CredentialsStep2, {
29341
+ return React25.createElement(CredentialsStep2, {
30090
29342
  summary: opts.summary ?? "Enter Contentful credentials to push this run. Press Enter on each field to advance.",
30091
29343
  ...opts.initialSpaceId !== void 0 ? { initialSpaceId: opts.initialSpaceId } : {},
30092
29344
  ...opts.initialEnvironmentId !== void 0 ? { initialEnvironmentId: opts.initialEnvironmentId } : {},
@@ -30100,7 +29352,7 @@ async function promptForPushCredentials(opts = {}) {
30100
29352
  }
30101
29353
  });
30102
29354
  }
30103
- app = render7(React27.createElement(App2));
29355
+ app = render7(React25.createElement(App2));
30104
29356
  });
30105
29357
  }
30106
29358
  var init_push_creds_prompt = __esm({
@@ -30268,11 +29520,11 @@ init_db();
30268
29520
  init_cache_keys();
30269
29521
 
30270
29522
  // packages/experience-design-system-cli/src/helpers/read-existing-contentful-entities-from-session.ts
30271
- import { readFile as readFile12 } from "node:fs/promises";
29523
+ import { readFile as readFile11 } from "node:fs/promises";
30272
29524
  async function readExistingContentfulEntitiesFromSession(path) {
30273
29525
  if (!path) return void 0;
30274
29526
  try {
30275
- const raw = await readFile12(path, "utf8");
29527
+ const raw = await readFile11(path, "utf8");
30276
29528
  const parsed = JSON.parse(raw);
30277
29529
  if (!Array.isArray(parsed.components) || !Array.isArray(parsed.tokens)) return void 0;
30278
29530
  return parsed;
@@ -31263,7 +30515,6 @@ ${error instanceof Error ? error.message : String(error)}
31263
30515
  // packages/experience-design-system-cli/src/analyze/command.ts
31264
30516
  init_db();
31265
30517
  init_cycle_detection();
31266
- init_composition_mode();
31267
30518
 
31268
30519
  // packages/experience-design-system-cli/src/analyze/composition/interchange-schema.ts
31269
30520
  function validateInterchangeMap(input) {
@@ -32080,7 +31331,6 @@ async function resolvePromptOverride(override) {
32080
31331
 
32081
31332
  // packages/experience-design-system-cli/src/analyze/command.ts
32082
31333
  init_src();
32083
- init_credentials_store();
32084
31334
 
32085
31335
  // packages/experience-design-system-cli/src/analyze/build-analyze-view-rows.ts
32086
31336
  var WARNING_PREFIX_SUFFIX = ":";
@@ -32220,13 +31470,6 @@ async function collectSourceFiles(directory, onProgress) {
32220
31470
  await visit(directory);
32221
31471
  return files.sort();
32222
31472
  }
32223
- async function safeReadCompositionMode() {
32224
- try {
32225
- return (await readExperiencesCredentials()).compositionMode;
32226
- } catch {
32227
- return void 0;
32228
- }
32229
- }
32230
31473
  function componentsToInterchangeMap(components) {
32231
31474
  const groups = {};
32232
31475
  for (const c2 of components) {
@@ -32269,13 +31512,7 @@ function registerAnalyzeCommand(program) {
32269
31512
  "--resolve-unreachable <mode>",
32270
31513
  "Retry pass for unresolved Svelte Props types: 'auto' (default), 'always', or 'never'",
32271
31514
  "auto"
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(
31515
+ ).option("--composition-map <path>", "Consume a hand-authored parent\u2192children interchange map").option("--composition-agent", "Opt into agentic mapping resolution when deterministic sources find no groups").option("--composition-refresh", "Force the mapping agent to run even where deterministic sources answered").option("--generate-map <path>", "Write a skeleton interchange map from resolved composition").option(
32279
31516
  "--prompt <stage=value>",
32280
31517
  "Override a stage prompt (repeatable). value is a file path or literal text, e.g. --prompt composition=./p.md",
32281
31518
  (v, acc) => [...acc, v],
@@ -32393,8 +31630,7 @@ function registerAnalyzeCommand(program) {
32393
31630
  });
32394
31631
  }
32395
31632
  let validatedComponents = validateExtractedComponents(filteredComponents);
32396
- const compositionMode = resolveCompositionMode(opts, await safeReadCompositionMode() ?? void 0);
32397
- if (compositionMode === "composite") {
31633
+ {
32398
31634
  const sources = resolveCompositionSources(opts);
32399
31635
  const { overrides: promptOverrides, errors: promptErrors } = parsePromptOverrides(opts.prompt ?? []);
32400
31636
  for (const err of promptErrors) {
@@ -35020,17 +34256,14 @@ async function runPipeline(opts, progressWriter, cliPathOverride) {
35020
34256
  });
35021
34257
  const t0 = Date.now();
35022
34258
  const analyzeArgs = ["analyze", "extract", "--project", projectRoot];
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
- }
34259
+ if (opts.compositionMap) analyzeArgs.push("--composition-map", opts.compositionMap);
34260
+ if (opts.compositionAgent) analyzeArgs.push("--composition-agent");
34261
+ if (opts.compositionAgentMode) analyzeArgs.push("--composition-agent-mode", opts.compositionAgentMode);
34262
+ if (opts.compositionRefresh) analyzeArgs.push("--composition-refresh");
34263
+ if (opts.generateMap) analyzeArgs.push("--generate-map", opts.generateMap);
34264
+ for (const p of opts.promptOverrides ?? []) analyzeArgs.push("--prompt", p);
34265
+ if (opts.agent) analyzeArgs.push("--agent", opts.agent);
34266
+ if (opts.bedrock) analyzeArgs.push("--bedrock");
35034
34267
  const r = await runStep(analyzeArgs, cliPath, sessionId2);
35035
34268
  const durationMs = Date.now() - t0;
35036
34269
  if (r.exitCode !== 0) {
@@ -35524,7 +34757,6 @@ function resolveModel(flagValue, storedValue) {
35524
34757
  }
35525
34758
 
35526
34759
  // packages/experience-design-system-cli/src/import/command.ts
35527
- init_composition_mode();
35528
34760
  init_command_options();
35529
34761
  init_save_path_resolver();
35530
34762
  init_credentials_store();
@@ -35614,7 +34846,6 @@ async function launchModifyWizard(input) {
35614
34846
  initialStep: input.entryStep
35615
34847
  };
35616
34848
  applyWizardSeedProps(props, input);
35617
- if (input.compositionMode) props.compositionMode = input.compositionMode;
35618
34849
  if (input.saveMode === "overwrite") props.outDirOverride = input.savePath;
35619
34850
  if (input.outDirOverride) props.outDirOverride = input.outDirOverride;
35620
34851
  if (input.allowDeletions !== void 0) props.allowDeletions = input.allowDeletions;
@@ -35730,7 +34961,6 @@ async function modifyRun(opts) {
35730
34961
  savePath: run.savePath,
35731
34962
  entryStep: "final-review",
35732
34963
  saveMode,
35733
- ...run.compositionMode ? { compositionMode: run.compositionMode } : {},
35734
34964
  ...opts.outDir ? { outDirOverride: resolve26(opts.outDir) } : {},
35735
34965
  ...mergedSpaceId ? { initialSpaceId: mergedSpaceId } : {},
35736
34966
  ...mergedEnvironmentId ? { initialEnvironmentId: mergedEnvironmentId } : {},
@@ -35934,21 +35164,14 @@ function registerImportCommand(program) {
35934
35164
  "--print-prompt",
35935
35165
  "Print the generate components prompt without invoking the agent. Replaces the legacy --dry-run prompt-print behaviour on this command."
35936
35166
  ).option("--auto-accept-scope", "Accept all extracted components without prompting (for scripted/non-TTY callers)");
35937
- addCompositionOptions(cmd);
35938
35167
  addAllowDeletionsOption(cmd);
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(
35168
+ cmd.option("--composition-map <path>", "Consume a hand-authored parent\u2192children interchange map").option("--composition-agent", "Opt into agentic mapping resolution when deterministic sources find no groups").option(
35943
35169
  "--composition-refresh",
35944
- "Bypass the composition cache and re-resolve from scratch, forcing the agent to run (implies --composite)"
35170
+ "Bypass the composition cache and re-resolve from scratch, forcing the agent to run"
35945
35171
  ).option(
35946
35172
  "--composition-agent-mode <mode>",
35947
35173
  "Agent mode: 'parser' (agent writes a sandboxed parser, default) or 'edges' (agent lists edges)"
35948
- ).option(
35949
- "--generate-map <path>",
35950
- "Also write a composition-map skeleton from resolved edges during extract (implies --composite)"
35951
- ).option(
35174
+ ).option("--generate-map <path>", "Also write a composition-map skeleton from resolved edges during extract").option(
35952
35175
  "--prompt <stage=value>",
35953
35176
  "Override a stage prompt (repeatable). value is a file path or literal text, e.g. --prompt composition=./p.md",
35954
35177
  (v, acc) => [...acc, v],
@@ -35993,8 +35216,6 @@ function registerImportCommand(program) {
35993
35216
  const interactiveTerminalSupported = getInteractiveTerminalSupport().supported;
35994
35217
  if (opts.modify !== void 0 || opts.pushFromRun !== void 0) {
35995
35218
  const passedCompositionFlags = [
35996
- opts.composite ? "--composite" : null,
35997
- opts.atomic ? "--atomic" : null,
35998
35219
  opts.compositionMap ? "--composition-map" : null,
35999
35220
  opts.compositionAgent ? "--composition-agent" : null,
36000
35221
  opts.compositionAgentMode ? "--composition-agent-mode" : null,
@@ -36004,11 +35225,9 @@ function registerImportCommand(program) {
36004
35225
  if (passedCompositionFlags.length > 0) {
36005
35226
  const entry = opts.modify !== void 0 ? "--modify" : "--push-from-run";
36006
35227
  process.stderr.write(
36007
- `Note: ${passedCompositionFlags.join(", ")} ignored with ${entry} \u2014 composition mode comes from the recorded run.
35228
+ `Note: ${passedCompositionFlags.join(", ")} ignored with ${entry} \u2014 composition inputs come from the recorded run.
36008
35229
  `
36009
35230
  );
36010
- opts.composite = void 0;
36011
- opts.atomic = void 0;
36012
35231
  opts.compositionMap = void 0;
36013
35232
  opts.compositionAgent = void 0;
36014
35233
  opts.compositionAgentMode = void 0;
@@ -36161,7 +35380,6 @@ function registerImportCommand(program) {
36161
35380
  const creds = await readExperiencesCredentials();
36162
35381
  const resolvedAgent = resolveAgent(opts.agent, creds.agent);
36163
35382
  const resolvedModel = resolveModel(opts.model, creds.agentModel);
36164
- const resolvedCompositionMode = resolveCompositionMode(opts, creds.compositionMode);
36165
35383
  if (opts.bedrock && !(isAgentName(resolvedAgent) && agentSupportsBedrock(resolvedAgent))) {
36166
35384
  process.stderr.write(`Error: --bedrock is not supported for --agent ${resolvedAgent}
36167
35385
  `);
@@ -36200,7 +35418,6 @@ function registerImportCommand(program) {
36200
35418
  host: opts.host,
36201
35419
  autoAcceptScope,
36202
35420
  autoRejectCycles: opts.autoRejectCycles ?? false,
36203
- compositionMode: resolvedCompositionMode,
36204
35421
  ...buildCompositionForwardingOptions(opts),
36205
35422
  noCache: opts.cache === false,
36206
35423
  skipMapTokens: opts.skipMapTokens ?? false,
@@ -36247,7 +35464,6 @@ function registerImportCommand(program) {
36247
35464
  const headlessCreds = await readExperiencesCredentials();
36248
35465
  const headlessAgent = resolveAgent(opts.agent, headlessCreds.agent);
36249
35466
  const headlessModel = resolveModel(opts.model, headlessCreds.agentModel);
36250
- const headlessCompositionMode = resolveCompositionMode(opts, headlessCreds.compositionMode);
36251
35467
  if (opts.bedrock && !(isAgentName(headlessAgent) && agentSupportsBedrock(headlessAgent))) {
36252
35468
  process.stderr.write(`Error: --bedrock is not supported for --agent ${headlessAgent}
36253
35469
  `);
@@ -36282,7 +35498,6 @@ function registerImportCommand(program) {
36282
35498
  selectPromptPath: opts.selectPromptPath,
36283
35499
  autoRejectCycles: opts.autoRejectCycles ?? false,
36284
35500
  allowDeletions: opts.allowDeletions ?? false,
36285
- compositionMode: headlessCompositionMode,
36286
35501
  ...buildCompositionForwardingOptions(opts)
36287
35502
  },
36288
35503
  (line) => process.stderr.write(line + "\n")