@contentful/experience-design-system-cli 2.37.1-dev-build-33443a39.0 → 2.37.1-dev-build-0e44d27b.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +7 -3
- package/dist/index.js +47 -89
- package/dist/package.json +2 -4
- package/legacy/dist/src/analyze/select/tui/components/FieldEditor.d.ts +4 -1
- package/legacy/dist/src/analyze/select/tui/theme.d.ts +1 -0
- package/legacy/dist/src/import/tui/components/ReviewComponentPanel.d.ts +1 -1
- package/legacy/dist/src/import/tui/components/ReviewDetailsEditor.d.ts +3 -1
- package/legacy/dist/src/index.js +158 -169
- package/legacy/package.json +2 -4
- package/package.json +3 -5
- package/dist/src/commands/forwarded.d.ts +0 -2
- package/dist/src/commands/import.d.ts +0 -2
- package/dist/src/commands/watch.d.ts +0 -5
package/dist/app.js
CHANGED
|
@@ -138,7 +138,7 @@ var START_ITEMS = [
|
|
|
138
138
|
];
|
|
139
139
|
function upgradeItemDisplay(upgradeCheck) {
|
|
140
140
|
if (upgradeCheck?.status === "update-available") {
|
|
141
|
-
return { label: `Upgrade Version (v${upgradeCheck.latest} available)`, color: PALETTE.
|
|
141
|
+
return { label: `Upgrade Version (v${upgradeCheck.latest} available)`, color: PALETTE.warning };
|
|
142
142
|
}
|
|
143
143
|
if (upgradeCheck?.status === "up-to-date") {
|
|
144
144
|
return { label: "Upgrade Version (up to date)", color: PALETTE.muted };
|
|
@@ -401,8 +401,8 @@ function TokenInputScreen({ onConfirm, onBack, initialPath = "" }) {
|
|
|
401
401
|
};
|
|
402
402
|
return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
403
403
|
/* @__PURE__ */ jsx5(Text5, { bold: true, children: "Design tokens" }),
|
|
404
|
-
/* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "Point me to your raw token file (e.g. ~/design-tokens/tokens.json). You can use ~, relative, or absolute paths. Claude will map it to DTCG
|
|
405
|
-
/* @__PURE__ */ jsxs4(Box4, { flexDirection: "column",
|
|
404
|
+
/* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "Point me to your raw token file (e.g. ~/design-tokens/tokens.json). You can use ~, relative, or absolute paths. Claude will map it to Design Token Group Format (DTCG)." }),
|
|
405
|
+
/* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
|
|
406
406
|
/* @__PURE__ */ jsxs4(Box4, { gap: 1, children: [
|
|
407
407
|
/* @__PURE__ */ jsx5(Text5, { color: PALETTE.accent, children: "?" }),
|
|
408
408
|
/* @__PURE__ */ jsx5(Text5, { children: "Token path:" }),
|
|
@@ -1277,6 +1277,7 @@ function App({ onLaunchImport, importExitCode }) {
|
|
|
1277
1277
|
return /* @__PURE__ */ jsx12(HomeScreen, { onNavigate: setScreen });
|
|
1278
1278
|
}
|
|
1279
1279
|
}
|
|
1280
|
+
var CLEAR_SCREEN = "\x1B[2J\x1B[H";
|
|
1280
1281
|
async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
|
|
1281
1282
|
let requestedImport;
|
|
1282
1283
|
const instance = renderApp(
|
|
@@ -1293,6 +1294,9 @@ async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
|
|
|
1293
1294
|
);
|
|
1294
1295
|
await instance.waitUntilExit();
|
|
1295
1296
|
await stopReadingTerminal();
|
|
1297
|
+
if (requestedImport !== void 0 && process.stdout.isTTY) {
|
|
1298
|
+
process.stdout.write(CLEAR_SCREEN);
|
|
1299
|
+
}
|
|
1296
1300
|
return requestedImport;
|
|
1297
1301
|
}
|
|
1298
1302
|
async function runApp(renderApp) {
|
package/dist/index.js
CHANGED
|
@@ -99,11 +99,11 @@ var init_home_theme = __esm({
|
|
|
99
99
|
|
|
100
100
|
// packages/experience-design-system-cli/src/tui/upgrade/version.ts
|
|
101
101
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
102
|
-
import { join as
|
|
102
|
+
import { join as join3 } from "node:path";
|
|
103
103
|
import semver from "semver";
|
|
104
104
|
function readPackageVersion() {
|
|
105
|
-
const root = findPackageRoot(import.meta.url,
|
|
106
|
-
const pkg2 = JSON.parse(readFileSync2(
|
|
105
|
+
const root = findPackageRoot(import.meta.url, PACKAGE_NAME2);
|
|
106
|
+
const pkg2 = JSON.parse(readFileSync2(join3(root, "package.json"), "utf8"));
|
|
107
107
|
return pkg2.version ?? "unknown";
|
|
108
108
|
}
|
|
109
109
|
function parseVersionTag(tag) {
|
|
@@ -128,12 +128,12 @@ async function checkForUpgrade() {
|
|
|
128
128
|
return { status: "error" };
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
var
|
|
131
|
+
var PACKAGE_NAME2, TAGS_URL;
|
|
132
132
|
var init_version = __esm({
|
|
133
133
|
"packages/experience-design-system-cli/src/tui/upgrade/version.ts"() {
|
|
134
134
|
"use strict";
|
|
135
135
|
init_package_root();
|
|
136
|
-
|
|
136
|
+
PACKAGE_NAME2 = "@contentful/experience-design-system-cli";
|
|
137
137
|
TAGS_URL = "https://api.github.com/repos/contentful/experience-design-system-sdk-public/tags?per_page=10";
|
|
138
138
|
}
|
|
139
139
|
});
|
|
@@ -186,7 +186,7 @@ import { Box, Text as Text2, useApp, useInput } from "ink";
|
|
|
186
186
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
187
187
|
function upgradeItemDisplay(upgradeCheck) {
|
|
188
188
|
if (upgradeCheck?.status === "update-available") {
|
|
189
|
-
return { label: `Upgrade Version (v${upgradeCheck.latest} available)`, color: PALETTE.
|
|
189
|
+
return { label: `Upgrade Version (v${upgradeCheck.latest} available)`, color: PALETTE.warning };
|
|
190
190
|
}
|
|
191
191
|
if (upgradeCheck?.status === "up-to-date") {
|
|
192
192
|
return { label: "Upgrade Version (up to date)", color: PALETTE.muted };
|
|
@@ -505,8 +505,8 @@ function TokenInputScreen({ onConfirm, onBack, initialPath = "" }) {
|
|
|
505
505
|
};
|
|
506
506
|
return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
507
507
|
/* @__PURE__ */ jsx5(Text5, { bold: true, children: "Design tokens" }),
|
|
508
|
-
/* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "Point me to your raw token file (e.g. ~/design-tokens/tokens.json). You can use ~, relative, or absolute paths. Claude will map it to DTCG
|
|
509
|
-
/* @__PURE__ */ jsxs4(Box4, { flexDirection: "column",
|
|
508
|
+
/* @__PURE__ */ jsx5(Text5, { dimColor: true, children: "Point me to your raw token file (e.g. ~/design-tokens/tokens.json). You can use ~, relative, or absolute paths. Claude will map it to Design Token Group Format (DTCG)." }),
|
|
509
|
+
/* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
|
|
510
510
|
/* @__PURE__ */ jsxs4(Box4, { gap: 1, children: [
|
|
511
511
|
/* @__PURE__ */ jsx5(Text5, { color: PALETTE.accent, children: "?" }),
|
|
512
512
|
/* @__PURE__ */ jsx5(Text5, { children: "Token path:" }),
|
|
@@ -551,7 +551,7 @@ var init_steps = __esm({
|
|
|
551
551
|
});
|
|
552
552
|
|
|
553
553
|
// packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts
|
|
554
|
-
import { spawn as
|
|
554
|
+
import { spawn as spawn2 } from "node:child_process";
|
|
555
555
|
function buildArgs(options) {
|
|
556
556
|
const args = ["import"];
|
|
557
557
|
if (options.project) {
|
|
@@ -566,7 +566,7 @@ async function spawnV1Import(options = {}) {
|
|
|
566
566
|
const cliPath = findLegacyCliPath();
|
|
567
567
|
const args = buildArgs(options);
|
|
568
568
|
return new Promise((resolvePromise) => {
|
|
569
|
-
const child =
|
|
569
|
+
const child = spawn2("node", [cliPath, ...args], {
|
|
570
570
|
stdio: "inherit"
|
|
571
571
|
});
|
|
572
572
|
child.on("close", (code) => {
|
|
@@ -611,9 +611,9 @@ var init_terminal_input = __esm({
|
|
|
611
611
|
import { randomBytes } from "node:crypto";
|
|
612
612
|
import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
613
613
|
import { homedir as homedir2 } from "node:os";
|
|
614
|
-
import { dirname as dirname2, join as
|
|
614
|
+
import { dirname as dirname2, join as join4 } from "node:path";
|
|
615
615
|
function configRoot() {
|
|
616
|
-
return process.env["EDS_HOME"] ||
|
|
616
|
+
return process.env["EDS_HOME"] || join4(homedir2(), ".contentful", "experience-design-system-cli");
|
|
617
617
|
}
|
|
618
618
|
async function readSettings() {
|
|
619
619
|
try {
|
|
@@ -637,10 +637,10 @@ var configFilePath, runsFilePath, debugSessionsDir, oldConfigDir;
|
|
|
637
637
|
var init_config = __esm({
|
|
638
638
|
"packages/experience-design-system-types/dist/src/config/index.js"() {
|
|
639
639
|
"use strict";
|
|
640
|
-
configFilePath = () =>
|
|
641
|
-
runsFilePath = () =>
|
|
642
|
-
debugSessionsDir = () =>
|
|
643
|
-
oldConfigDir = () =>
|
|
640
|
+
configFilePath = () => join4(configRoot(), "config.json");
|
|
641
|
+
runsFilePath = () => join4(configRoot(), "state", "runs.json");
|
|
642
|
+
debugSessionsDir = () => join4(configRoot(), "debug", "sessions");
|
|
643
|
+
oldConfigDir = () => join4(homedir2(), ".config", "experiences");
|
|
644
644
|
}
|
|
645
645
|
});
|
|
646
646
|
|
|
@@ -665,8 +665,8 @@ var init_debug_mode_store = __esm({
|
|
|
665
665
|
|
|
666
666
|
// packages/experience-design-system-cli/src/tui/debug-store.ts
|
|
667
667
|
import { mkdir as mkdir2, writeFile as writeFile2 } from "node:fs/promises";
|
|
668
|
-
import { existsSync as
|
|
669
|
-
import { join as
|
|
668
|
+
import { existsSync as existsSync3, readdirSync } from "node:fs";
|
|
669
|
+
import { join as join5 } from "node:path";
|
|
670
670
|
function generateRunId() {
|
|
671
671
|
const now = /* @__PURE__ */ new Date();
|
|
672
672
|
const pad = (n) => String(n).padStart(2, "0");
|
|
@@ -682,7 +682,7 @@ function slugify(value) {
|
|
|
682
682
|
function generateSessionId() {
|
|
683
683
|
const today = datePrefix();
|
|
684
684
|
const root = debugSessionsDir();
|
|
685
|
-
const existing =
|
|
685
|
+
const existing = existsSync3(root) ? readdirSync(root) : [];
|
|
686
686
|
const seqPattern = new RegExp(`^${today}-session-(\\d+)$`);
|
|
687
687
|
const maxSeq = existing.reduce((max, entry) => {
|
|
688
688
|
const match = seqPattern.exec(entry);
|
|
@@ -691,7 +691,7 @@ function generateSessionId() {
|
|
|
691
691
|
return `${today}-session-${maxSeq + 1}`;
|
|
692
692
|
}
|
|
693
693
|
function sessionDebugDir() {
|
|
694
|
-
return
|
|
694
|
+
return join5(debugSessionsDir(), SESSION_ID);
|
|
695
695
|
}
|
|
696
696
|
function currentDebugSessionDir() {
|
|
697
697
|
return sessionDebugDir();
|
|
@@ -736,15 +736,15 @@ async function finishDebugRun({
|
|
|
736
736
|
const durationMs = Date.now() - run.startedAt;
|
|
737
737
|
const content = renderMarkdown(run, { outputs: redact(outputs), status, exitMethod, durationMs });
|
|
738
738
|
const flowSegments = run.flow.split("/");
|
|
739
|
-
const dir =
|
|
739
|
+
const dir = join5(sessionDebugDir(), ...flowSegments);
|
|
740
740
|
await mkdir2(dir, { recursive: true });
|
|
741
741
|
const filename = nextAttemptFilename(dir, run.menuOption);
|
|
742
|
-
await writeFile2(
|
|
742
|
+
await writeFile2(join5(dir, filename), content, { mode: 384 });
|
|
743
743
|
}
|
|
744
744
|
function nextAttemptFilename(dir, menuOption) {
|
|
745
745
|
const today = datePrefix();
|
|
746
746
|
const optionSlug = slugify(menuOption);
|
|
747
|
-
const existing =
|
|
747
|
+
const existing = existsSync3(dir) ? readdirSync(dir) : [];
|
|
748
748
|
const attemptPattern = new RegExp(`^${today}-${optionSlug}-attempt-(\\d+)\\.md$`);
|
|
749
749
|
const maxAttempt = existing.reduce((max, entry) => {
|
|
750
750
|
const match = attemptPattern.exec(entry);
|
|
@@ -1506,6 +1506,9 @@ async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
|
|
|
1506
1506
|
);
|
|
1507
1507
|
await instance.waitUntilExit();
|
|
1508
1508
|
await stopReadingTerminal();
|
|
1509
|
+
if (requestedImport !== void 0 && process.stdout.isTTY) {
|
|
1510
|
+
process.stdout.write(CLEAR_SCREEN);
|
|
1511
|
+
}
|
|
1509
1512
|
return requestedImport;
|
|
1510
1513
|
}
|
|
1511
1514
|
async function runApp(renderApp) {
|
|
@@ -1517,6 +1520,7 @@ async function runApp(renderApp) {
|
|
|
1517
1520
|
requestedImport = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
|
|
1518
1521
|
}
|
|
1519
1522
|
}
|
|
1523
|
+
var CLEAR_SCREEN;
|
|
1520
1524
|
var init_app = __esm({
|
|
1521
1525
|
"packages/experience-design-system-cli/app.tsx"() {
|
|
1522
1526
|
"use strict";
|
|
@@ -1532,14 +1536,19 @@ var init_app = __esm({
|
|
|
1532
1536
|
init_PageContainer4();
|
|
1533
1537
|
init_screen4();
|
|
1534
1538
|
init_config_store();
|
|
1539
|
+
CLEAR_SCREEN = "\x1B[2J\x1B[H";
|
|
1535
1540
|
}
|
|
1536
1541
|
});
|
|
1537
1542
|
|
|
1538
1543
|
// packages/experience-design-system-cli/program.ts
|
|
1539
1544
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
1540
|
-
import { join as join7 } from "node:path";
|
|
1541
1545
|
import { Command } from "commander";
|
|
1542
1546
|
|
|
1547
|
+
// packages/experience-design-system-cli/src/legacy/forwarded-import-args.ts
|
|
1548
|
+
function forwardedImportArgs(argv) {
|
|
1549
|
+
return argv[0] === "import" ? argv.slice(1) : argv;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1543
1552
|
// packages/experience-design-system-cli/src/legacy/run-legacy.ts
|
|
1544
1553
|
init_legacy_cli_path();
|
|
1545
1554
|
import { spawn } from "node:child_process";
|
|
@@ -1564,7 +1573,8 @@ function runLegacy(args) {
|
|
|
1564
1573
|
});
|
|
1565
1574
|
}
|
|
1566
1575
|
|
|
1567
|
-
// packages/experience-design-system-cli/
|
|
1576
|
+
// packages/experience-design-system-cli/program.ts
|
|
1577
|
+
var pkg = JSON.parse(readFileSync3(new URL("../package.json", import.meta.url), "utf8"));
|
|
1568
1578
|
var FORWARDED_COMMANDS = [
|
|
1569
1579
|
{
|
|
1570
1580
|
name: "apply",
|
|
@@ -1590,65 +1600,13 @@ function registerForwardedCommands(program) {
|
|
|
1590
1600
|
});
|
|
1591
1601
|
}
|
|
1592
1602
|
}
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
function forwardedImportArgs(argv) {
|
|
1596
|
-
return argv[0] === "import" ? argv.slice(1) : argv;
|
|
1597
|
-
}
|
|
1598
|
-
|
|
1599
|
-
// packages/experience-design-system-cli/src/commands/watch.ts
|
|
1600
|
-
init_package_root();
|
|
1601
|
-
import { spawn as spawn2 } from "node:child_process";
|
|
1602
|
-
import { existsSync as existsSync3 } from "node:fs";
|
|
1603
|
-
import { join as join3 } from "node:path";
|
|
1604
|
-
var PACKAGE_NAME2 = "@contentful/experience-design-system-cli";
|
|
1605
|
-
function extractWatchFlag(args) {
|
|
1606
|
-
const rest = args.filter((arg) => arg !== "--watch");
|
|
1607
|
-
return { watch: rest.length !== args.length, rest };
|
|
1608
|
-
}
|
|
1609
|
-
function runDevWatch(args) {
|
|
1610
|
-
const script = join3(findPackageRoot(import.meta.url, PACKAGE_NAME2), "scripts", "dev.mjs");
|
|
1611
|
-
if (!existsSync3(script)) {
|
|
1612
|
-
process.stderr.write("--watch only works from a checkout of the repo (scripts/dev.mjs is not in the package).\n");
|
|
1613
|
-
return Promise.resolve(1);
|
|
1614
|
-
}
|
|
1615
|
-
return new Promise((resolve2) => {
|
|
1616
|
-
const child = spawn2(process.execPath, [script, ...args], { stdio: "inherit" });
|
|
1617
|
-
process.on("SIGINT", () => void 0);
|
|
1618
|
-
child.on("exit", (code) => resolve2(code ?? 0));
|
|
1619
|
-
child.on("error", (err) => {
|
|
1620
|
-
process.stderr.write(`${err.message}
|
|
1621
|
-
`);
|
|
1622
|
-
resolve2(1);
|
|
1623
|
-
});
|
|
1624
|
-
});
|
|
1625
|
-
}
|
|
1626
|
-
|
|
1627
|
-
// packages/experience-design-system-cli/src/commands/import.ts
|
|
1628
|
-
function registerImportCommand(program, openTui) {
|
|
1603
|
+
function createProgram() {
|
|
1604
|
+
const program = new Command().name("experiences").description("Contentful Experiences design system import CLI").version(pkg.version, "--version", "Print version number");
|
|
1629
1605
|
program.command("import", { isDefault: true }).description("Launch the Experiences CLI").allowUnknownOption().allowExcessArguments().helpOption(false).argument("[args...]").action(async () => {
|
|
1630
|
-
const
|
|
1631
|
-
if (watch) {
|
|
1632
|
-
process.exit(await runDevWatch(forwarded));
|
|
1633
|
-
}
|
|
1606
|
+
const forwarded = forwardedImportArgs(process.argv.slice(2));
|
|
1634
1607
|
if (forwarded.length > 0) {
|
|
1635
1608
|
process.exit(await runLegacy(["import", ...forwarded]));
|
|
1636
1609
|
}
|
|
1637
|
-
await openTui();
|
|
1638
|
-
});
|
|
1639
|
-
}
|
|
1640
|
-
|
|
1641
|
-
// packages/experience-design-system-cli/program.ts
|
|
1642
|
-
init_package_root();
|
|
1643
|
-
var pkg = JSON.parse(
|
|
1644
|
-
readFileSync3(
|
|
1645
|
-
join7(findPackageRoot(import.meta.url, "@contentful/experience-design-system-cli"), "package.json"),
|
|
1646
|
-
"utf8"
|
|
1647
|
-
)
|
|
1648
|
-
);
|
|
1649
|
-
function createProgram() {
|
|
1650
|
-
const program = new Command().name("experiences").description("Contentful Experiences design system import CLI").version(pkg.version, "--version", "Print version number");
|
|
1651
|
-
registerImportCommand(program, async () => {
|
|
1652
1610
|
const { render } = await import("ink");
|
|
1653
1611
|
const { runApp: runApp2 } = await Promise.resolve().then(() => (init_app(), app_exports));
|
|
1654
1612
|
await runApp2(render);
|
|
@@ -1660,10 +1618,10 @@ function createProgram() {
|
|
|
1660
1618
|
// packages/experience-design-system-cli/src/config/migrate.ts
|
|
1661
1619
|
init_config();
|
|
1662
1620
|
init_package_root();
|
|
1663
|
-
import { existsSync as
|
|
1621
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
1664
1622
|
import { mkdir as mkdir3, readFile as readFile2, rename as rename2, rmdir, unlink } from "node:fs/promises";
|
|
1665
|
-
import { dirname as dirname3, join as
|
|
1666
|
-
var
|
|
1623
|
+
import { dirname as dirname3, join as join6 } from "node:path";
|
|
1624
|
+
var PACKAGE_NAME3 = "@contentful/experience-design-system-cli";
|
|
1667
1625
|
async function readJson(path) {
|
|
1668
1626
|
try {
|
|
1669
1627
|
return JSON.parse(await readFile2(path, "utf8"));
|
|
@@ -1673,10 +1631,10 @@ async function readJson(path) {
|
|
|
1673
1631
|
}
|
|
1674
1632
|
async function migrateOldConfig() {
|
|
1675
1633
|
try {
|
|
1676
|
-
const oldCredentials =
|
|
1677
|
-
const oldRuns =
|
|
1678
|
-
const oldDebugMode =
|
|
1679
|
-
findPackageRoot(import.meta.url,
|
|
1634
|
+
const oldCredentials = join6(oldConfigDir(), "credentials.json");
|
|
1635
|
+
const oldRuns = join6(oldConfigDir(), "runs.json");
|
|
1636
|
+
const oldDebugMode = join6(
|
|
1637
|
+
findPackageRoot(import.meta.url, PACKAGE_NAME3),
|
|
1680
1638
|
".contentful",
|
|
1681
1639
|
"config",
|
|
1682
1640
|
"debug_mode.json"
|
|
@@ -1686,8 +1644,8 @@ async function migrateOldConfig() {
|
|
|
1686
1644
|
if (debugMode) migrated["debugMode"] = debugMode;
|
|
1687
1645
|
Object.assign(migrated, await readJson(oldCredentials));
|
|
1688
1646
|
if (Object.keys(migrated).length > 0) await updateSettings({ ...migrated, ...await readSettings() });
|
|
1689
|
-
if (
|
|
1690
|
-
if (!
|
|
1647
|
+
if (existsSync4(oldRuns)) {
|
|
1648
|
+
if (!existsSync4(runsFilePath())) {
|
|
1691
1649
|
await mkdir3(dirname3(runsFilePath()), { recursive: true });
|
|
1692
1650
|
await rename2(oldRuns, runsFilePath());
|
|
1693
1651
|
} else {
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.37.1-dev-build-
|
|
3
|
+
"version": "2.37.1-dev-build-0e44d27b.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -33,8 +33,7 @@
|
|
|
33
33
|
"clean": "nx clean experience-design-system-cli",
|
|
34
34
|
"test": "nx test experience-design-system-cli",
|
|
35
35
|
"lint": "nx lint experience-design-system-cli",
|
|
36
|
-
"lint:fix": "nx lint:fix experience-design-system-cli"
|
|
37
|
-
"dev": "node scripts/dev.mjs"
|
|
36
|
+
"lint:fix": "nx lint:fix experience-design-system-cli"
|
|
38
37
|
},
|
|
39
38
|
"dependencies": {
|
|
40
39
|
"@contentful/experience-design-system-types": "workspace:*",
|
|
@@ -58,7 +57,6 @@
|
|
|
58
57
|
"@types/node": "^24.0.3",
|
|
59
58
|
"@types/react": "^18.3.24",
|
|
60
59
|
"@types/semver": "^7.7.1",
|
|
61
|
-
"esbuild": "0.28.0",
|
|
62
60
|
"eslint": "^9.39.5",
|
|
63
61
|
"eslint-config-prettier": "^10.1.8",
|
|
64
62
|
"eslint-plugin-prettier": "^5.5.6",
|
|
@@ -42,6 +42,9 @@ export type FieldEditorProps = {
|
|
|
42
42
|
};
|
|
43
43
|
showHiddenProps?: boolean;
|
|
44
44
|
showInlineRationales?: boolean;
|
|
45
|
+
/** Pinned inside the box above the rows, in row and field-edit modes. Counts as `headerHeight` rows. */
|
|
46
|
+
header?: React.ReactNode;
|
|
47
|
+
headerHeight?: number;
|
|
45
48
|
};
|
|
46
49
|
export declare function simulateGraphWithCandidate(projectSlotGraph: ComponentSlotInfo[], selfName: string, currentSlots: {
|
|
47
50
|
name: string;
|
|
@@ -60,5 +63,5 @@ export declare function computeAllowedComponentReplacementCandidates(projectSlot
|
|
|
60
63
|
name: string;
|
|
61
64
|
allowedComponents: string[];
|
|
62
65
|
}[], targetSlotName: string, replaceIndex: number): string[];
|
|
63
|
-
export declare function FieldEditor({ value, width, height, fixedHeight, active, onChange, onSave, onDiscard, onExit, metadata, onTogglePropRationale, propRationaleKey, onToggleComponentRationale, componentRationaleKey, onToggleSourceExternal, onTextEntryActiveChange, projectSlotGraph, currentComponentName, onDirtyChange, discardTrigger, initialFocusTarget, showHiddenProps, showInlineRationales, }: FieldEditorProps): React.ReactElement;
|
|
66
|
+
export declare function FieldEditor({ value, width, height, fixedHeight, active, onChange, onSave, onDiscard, onExit, metadata, onTogglePropRationale, propRationaleKey, onToggleComponentRationale, componentRationaleKey, onToggleSourceExternal, onTextEntryActiveChange, projectSlotGraph, currentComponentName, onDirtyChange, discardTrigger, initialFocusTarget, showHiddenProps, showInlineRationales, header, headerHeight, }: FieldEditorProps): React.ReactElement;
|
|
64
67
|
export {};
|
|
@@ -9,7 +9,7 @@ export type ReviewComponentPanelProps = ReviewDetailsEditorConfig & {
|
|
|
9
9
|
selectedKey: string;
|
|
10
10
|
selectedEntry: CDFComponentEntry;
|
|
11
11
|
saveError: string | null;
|
|
12
|
-
sidebarFooter
|
|
12
|
+
sidebarFooter?: React.ReactNode;
|
|
13
13
|
livePreview: Pick<UseLivePreviewReturn, 'status' | 'disabled'>;
|
|
14
14
|
livePreviewSpinner: string;
|
|
15
15
|
};
|
|
@@ -5,9 +5,11 @@ import type { UseReviewEditorResult } from '../hooks/useReviewEditor.js';
|
|
|
5
5
|
type ReviewEditorPanelState = Pick<UseReviewEditorResult, 'panelOpen' | 'panelScrollOffset' | 'tokenReviewRow' | 'tokenReviewEditing' | 'tokenReviewEditCursor' | 'tokenReviewEditSelection' | 'showJson' | 'jsonScrollOffset' | 'currentTokenSuggestions'>;
|
|
6
6
|
export type ReviewDetailsEditorProps = Omit<ReviewDetailsPanelProps, 'editor' | 'panelOpen' | 'panelScrollOffset' | 'tokenSuggestions' | 'tokenReviewRow' | 'tokenReviewEditing' | 'tokenReviewEditCursor' | 'tokenReviewEditSelection' | 'showJson' | 'jsonScrollOffset'> & {
|
|
7
7
|
reviewEditor: ReviewEditorPanelState;
|
|
8
|
+
/** Drawn inside the editor box, above the rows, in both row and field-edit modes. */
|
|
9
|
+
header?: React.ReactNode;
|
|
8
10
|
fieldEditor: Omit<FieldEditorProps, 'active' | 'height' | 'metadata' | 'width'> & {
|
|
9
11
|
key?: string;
|
|
10
12
|
};
|
|
11
13
|
};
|
|
12
|
-
export declare function ReviewDetailsEditor({ selectedKey, componentRationale, reviewMetadata, width, height, sourceBorderColor, jsonValue, sidebarFocused, reviewEditor, fieldEditor, }: ReviewDetailsEditorProps): React.ReactElement;
|
|
14
|
+
export declare function ReviewDetailsEditor({ selectedKey, componentRationale, reviewMetadata, width, height, sourceBorderColor, jsonValue, sidebarFocused, reviewEditor, fieldEditor, header, }: ReviewDetailsEditorProps): React.ReactElement;
|
|
13
15
|
export {};
|
package/legacy/dist/src/index.js
CHANGED
|
@@ -9371,6 +9371,7 @@ var init_theme = __esm({
|
|
|
9371
9371
|
"use strict";
|
|
9372
9372
|
PALETTE = {
|
|
9373
9373
|
info: "#1773EB",
|
|
9374
|
+
link: "#58A6FF",
|
|
9374
9375
|
success: "#00C459",
|
|
9375
9376
|
error: "#E44F20",
|
|
9376
9377
|
warning: "#FFDA00",
|
|
@@ -9962,7 +9963,7 @@ You don't have read access to this directory.`);
|
|
|
9962
9963
|
/* @__PURE__ */ jsx12(Text10, { bold: true, children: projectPath }),
|
|
9963
9964
|
"..."
|
|
9964
9965
|
] }),
|
|
9965
|
-
/* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", gap: 0,
|
|
9966
|
+
/* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", gap: 0, children: [
|
|
9966
9967
|
/* @__PURE__ */ jsxs9(Text10, { color: PALETTE.success, children: [
|
|
9967
9968
|
"\u2713 Found ",
|
|
9968
9969
|
c2.total,
|
|
@@ -10011,7 +10012,7 @@ You don't have read access to this directory.`);
|
|
|
10011
10012
|
] }),
|
|
10012
10013
|
componentFiles === 0 && tokenFiles === 0 && /* @__PURE__ */ jsx12(Text10, { color: PALETTE.warning, children: "\u26A0 No component or token files found. Try a different path." }),
|
|
10013
10014
|
componentFiles === 0 && tokenFiles > 0 && /* @__PURE__ */ jsx12(Text10, { color: PALETTE.warning, children: "\u26A0 No component files found \u2014 only token files detected." }),
|
|
10014
|
-
/* @__PURE__ */ jsx12(
|
|
10015
|
+
/* @__PURE__ */ jsx12(Text10, { children: "Does this look right?" }),
|
|
10015
10016
|
/* @__PURE__ */ jsxs9(Box9, { gap: 3, marginTop: 1, children: [
|
|
10016
10017
|
/* @__PURE__ */ jsx12(Text10, { dimColor: true, children: "[Enter] Yes, start extracting" }),
|
|
10017
10018
|
/* @__PURE__ */ jsx12(Text10, { dimColor: true, children: "[s] Skip components" }),
|
|
@@ -10373,14 +10374,14 @@ function CredentialsStep({
|
|
|
10373
10374
|
"\u2713 ",
|
|
10374
10375
|
summary
|
|
10375
10376
|
] }),
|
|
10376
|
-
/* @__PURE__ */ jsxs13(Box13, { flexDirection: "column",
|
|
10377
|
-
/* @__PURE__ */ jsx17(Text14, { children: initialSpaceId && initialCmaToken ? "Credentials pre-filled from
|
|
10377
|
+
/* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", children: [
|
|
10378
|
+
/* @__PURE__ */ jsx17(Text14, { children: initialSpaceId && initialCmaToken ? "Credentials pre-filled from the configuration settings." : "Enter the Contentful space you want to import into." }),
|
|
10378
10379
|
!(initialSpaceId && initialCmaToken) && /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
10379
10380
|
/* @__PURE__ */ jsx17(Text14, { dimColor: true, children: "These credentials are used both to align agent suggestions with what already exists in the space and to push your import at the end. Press S to skip and run without space context (push will be disabled)." }),
|
|
10380
10381
|
/* @__PURE__ */ jsx17(Text14, { dimColor: true, children: "Tip: run experiences setup to save these to ~/.contentful/experience-design-system-cli/config.json so they pre-fill here automatically." })
|
|
10381
10382
|
] })
|
|
10382
10383
|
] }),
|
|
10383
|
-
/* @__PURE__ */ jsxs13(Box13, { flexDirection: "column",
|
|
10384
|
+
/* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", children: [
|
|
10384
10385
|
renderField("Space ID", spaceId, "spaceId"),
|
|
10385
10386
|
renderField("Environment", environmentId, "environmentId"),
|
|
10386
10387
|
renderField("CMA Token", cmaToken, "cmaToken", true),
|
|
@@ -10400,12 +10401,12 @@ function CredentialsStep({
|
|
|
10400
10401
|
". Will retry after credential validation.",
|
|
10401
10402
|
onRetryPrefetch ? " Press R to retry now." : ""
|
|
10402
10403
|
] }),
|
|
10403
|
-
/* @__PURE__ */ jsxs13(Box13, { gap: 3,
|
|
10404
|
+
/* @__PURE__ */ jsxs13(Box13, { gap: 3, children: [
|
|
10404
10405
|
/* @__PURE__ */ jsx17(Text14, { dimColor: true, children: "[Enter] Next field / Submit" }),
|
|
10405
10406
|
/* @__PURE__ */ jsx17(Text14, { dimColor: true, children: "[Tab] Switch field" }),
|
|
10406
|
-
/* @__PURE__ */ jsx17(Text14, { dimColor: true, children: "[q] Quit" })
|
|
10407
|
-
|
|
10408
|
-
|
|
10407
|
+
/* @__PURE__ */ jsx17(Text14, { dimColor: true, children: "[q] Quit" }),
|
|
10408
|
+
onSkip && /* @__PURE__ */ jsx17(Text14, { dimColor: true, children: "[s] Skip \u2014 review locally only (no push, no live preview)" })
|
|
10409
|
+
] })
|
|
10409
10410
|
] });
|
|
10410
10411
|
}
|
|
10411
10412
|
var init_CredentialsStep = __esm({
|
|
@@ -10739,7 +10740,7 @@ function buildPreviewSummaryLines(preview) {
|
|
|
10739
10740
|
lines.push({
|
|
10740
10741
|
key: "summary-components-new",
|
|
10741
10742
|
color: PALETTE.success,
|
|
10742
|
-
text: ` \uFF0B ${components.new.length} will be created`
|
|
10743
|
+
text: ` \uFF0B ${components.new.length} components will be created`
|
|
10743
10744
|
});
|
|
10744
10745
|
for (const [index, item] of components.new.entries()) {
|
|
10745
10746
|
const name = item.key ?? item.$name ?? "unknown";
|
|
@@ -10750,7 +10751,7 @@ function buildPreviewSummaryLines(preview) {
|
|
|
10750
10751
|
lines.push({
|
|
10751
10752
|
key: "summary-components-changed",
|
|
10752
10753
|
color: PALETTE.warning,
|
|
10753
|
-
text: ` \uFF5E ${components.changed.length} will be updated`
|
|
10754
|
+
text: ` \uFF5E ${components.changed.length} components will be updated`
|
|
10754
10755
|
});
|
|
10755
10756
|
for (const [index, item] of components.changed.entries()) {
|
|
10756
10757
|
const isBreaking = item.changeClassification?.classification === "breaking";
|
|
@@ -10765,7 +10766,7 @@ function buildPreviewSummaryLines(preview) {
|
|
|
10765
10766
|
lines.push({
|
|
10766
10767
|
key: "summary-components-removed",
|
|
10767
10768
|
color: PALETTE.warning,
|
|
10768
|
-
text: ` \u2298 ${components.removed.length} will be skipped`
|
|
10769
|
+
text: ` \u2298 ${components.removed.length} components will be skipped`
|
|
10769
10770
|
});
|
|
10770
10771
|
for (const [index, item] of components.removed.entries()) {
|
|
10771
10772
|
lines.push({ key: `summary-components-removed-${index}`, color: PALETTE.warning, text: ` \u2298 ${item.name}` });
|
|
@@ -11045,6 +11046,29 @@ var init_WizardPreviewStep = __esm({
|
|
|
11045
11046
|
// packages/experience-design-system-cli-legacy/src/import/tui/steps/DoneStep.tsx
|
|
11046
11047
|
import { Box as Box17, Text as Text18 } from "ink";
|
|
11047
11048
|
import { Fragment as Fragment6, jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
11049
|
+
function EntityRows({ entity, label }) {
|
|
11050
|
+
const plural = (n) => `${n} ${label}${n !== 1 ? "s" : ""}`;
|
|
11051
|
+
return /* @__PURE__ */ jsxs17(Fragment6, { children: [
|
|
11052
|
+
ACTIONS.filter((action) => entity[action] > 0).map((action) => /* @__PURE__ */ jsxs17(Text18, { children: [
|
|
11053
|
+
/* @__PURE__ */ jsx21(Text18, { color: PALETTE.success, children: "\u2713" }),
|
|
11054
|
+
" ",
|
|
11055
|
+
plural(entity[action]),
|
|
11056
|
+
" ",
|
|
11057
|
+
action
|
|
11058
|
+
] }, action)),
|
|
11059
|
+
entity.failed > 0 && /* @__PURE__ */ jsxs17(Text18, { color: PALETTE.error, children: [
|
|
11060
|
+
"\u2717 ",
|
|
11061
|
+
plural(entity.failed),
|
|
11062
|
+
" failed \u2014 check logs above"
|
|
11063
|
+
] })
|
|
11064
|
+
] });
|
|
11065
|
+
}
|
|
11066
|
+
function LinkRow({ title, url }) {
|
|
11067
|
+
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", children: [
|
|
11068
|
+
/* @__PURE__ */ jsx21(Text18, { dimColor: true, children: title }),
|
|
11069
|
+
/* @__PURE__ */ jsx21(Text18, { color: PALETTE.link, children: url })
|
|
11070
|
+
] });
|
|
11071
|
+
}
|
|
11048
11072
|
function DoneStep({
|
|
11049
11073
|
componentTypes,
|
|
11050
11074
|
designTokens,
|
|
@@ -11063,71 +11087,26 @@ function DoneStep({
|
|
|
11063
11087
|
const totalFailed = componentTypes.failed + designTokens.failed;
|
|
11064
11088
|
const totalPushed = componentTypes.created + componentTypes.updated + componentTypes.removed + designTokens.created + designTokens.updated + designTokens.removed;
|
|
11065
11089
|
const success = totalFailed === 0;
|
|
11066
|
-
|
|
11067
|
-
return /* @__PURE__ */ jsxs17(Fragment6, { children: [
|
|
11068
|
-
entity.created > 0 && /* @__PURE__ */ jsxs17(Box17, { gap: 1, children: [
|
|
11069
|
-
/* @__PURE__ */ jsx21(Text18, { color: PALETTE.success, children: "\u2713" }),
|
|
11070
|
-
/* @__PURE__ */ jsxs17(Text18, { children: [
|
|
11071
|
-
entity.created,
|
|
11072
|
-
" ",
|
|
11073
|
-
label,
|
|
11074
|
-
entity.created !== 1 ? "s" : "",
|
|
11075
|
-
" created"
|
|
11076
|
-
] })
|
|
11077
|
-
] }),
|
|
11078
|
-
entity.updated > 0 && /* @__PURE__ */ jsxs17(Box17, { gap: 1, children: [
|
|
11079
|
-
/* @__PURE__ */ jsx21(Text18, { color: PALETTE.success, children: "\u2713" }),
|
|
11080
|
-
/* @__PURE__ */ jsxs17(Text18, { children: [
|
|
11081
|
-
entity.updated,
|
|
11082
|
-
" ",
|
|
11083
|
-
label,
|
|
11084
|
-
entity.updated !== 1 ? "s" : "",
|
|
11085
|
-
" updated"
|
|
11086
|
-
] })
|
|
11087
|
-
] }),
|
|
11088
|
-
entity.removed > 0 && /* @__PURE__ */ jsxs17(Box17, { gap: 1, children: [
|
|
11089
|
-
/* @__PURE__ */ jsx21(Text18, { color: PALETTE.success, children: "\u2713" }),
|
|
11090
|
-
/* @__PURE__ */ jsxs17(Text18, { children: [
|
|
11091
|
-
entity.removed,
|
|
11092
|
-
" ",
|
|
11093
|
-
label,
|
|
11094
|
-
entity.removed !== 1 ? "s" : "",
|
|
11095
|
-
" removed"
|
|
11096
|
-
] })
|
|
11097
|
-
] }),
|
|
11098
|
-
entity.failed > 0 && /* @__PURE__ */ jsxs17(Box17, { gap: 1, children: [
|
|
11099
|
-
/* @__PURE__ */ jsx21(Text18, { color: PALETTE.error, children: "\u2717" }),
|
|
11100
|
-
/* @__PURE__ */ jsxs17(Text18, { color: PALETTE.error, children: [
|
|
11101
|
-
entity.failed,
|
|
11102
|
-
" ",
|
|
11103
|
-
label,
|
|
11104
|
-
entity.failed !== 1 ? "s" : "",
|
|
11105
|
-
" failed \u2014 check logs above"
|
|
11106
|
-
] })
|
|
11107
|
-
] })
|
|
11108
|
-
] });
|
|
11109
|
-
}
|
|
11090
|
+
const urlArgs = { host: host ?? "api.contentful.com", spaceId, environmentId };
|
|
11110
11091
|
return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
11111
11092
|
success ? /* @__PURE__ */ jsx21(Text18, { bold: true, color: PALETTE.success, children: "Done!" }) : /* @__PURE__ */ jsx21(Text18, { bold: true, color: PALETTE.warning, children: "\u26A0 Finished with errors" }),
|
|
11112
|
-
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx21(
|
|
11093
|
+
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx21(Text18, { dimColor: true, children: "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", children: [
|
|
11113
11094
|
/* @__PURE__ */ jsx21(EntityRows, { entity: componentTypes, label: "Component Type" }),
|
|
11114
11095
|
/* @__PURE__ */ jsx21(EntityRows, { entity: designTokens, label: "Design Token" }),
|
|
11115
|
-
summary && /* @__PURE__ */
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
" succeeded"
|
|
11122
|
-
] }),
|
|
11096
|
+
summary && /* @__PURE__ */ jsx21(Box17, { marginTop: 1, children: /* @__PURE__ */ jsxs17(Text18, { dimColor: true, children: [
|
|
11097
|
+
"Push result: ",
|
|
11098
|
+
summary.succeeded,
|
|
11099
|
+
"/",
|
|
11100
|
+
summary.total,
|
|
11101
|
+
" succeeded",
|
|
11123
11102
|
summary.failed > 0 && /* @__PURE__ */ jsxs17(Text18, { color: PALETTE.error, children: [
|
|
11124
11103
|
", ",
|
|
11125
11104
|
summary.failed,
|
|
11126
11105
|
" failed"
|
|
11127
11106
|
] })
|
|
11128
|
-
] })
|
|
11107
|
+
] }) })
|
|
11129
11108
|
] }),
|
|
11130
|
-
failures.length > 0 && /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column",
|
|
11109
|
+
failures.length > 0 && /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", children: [
|
|
11131
11110
|
/* @__PURE__ */ jsx21(Text18, { bold: true, color: PALETTE.error, children: "Failure details" }),
|
|
11132
11111
|
failures.map((failure) => /* @__PURE__ */ jsxs17(Text18, { color: PALETTE.error, children: [
|
|
11133
11112
|
failure.entityType,
|
|
@@ -11138,20 +11117,21 @@ function DoneStep({
|
|
|
11138
11117
|
] }, `${failure.entityType}:${failure.entityId}`))
|
|
11139
11118
|
] }),
|
|
11140
11119
|
/* @__PURE__ */ jsx21(SpaceEnvironment, { spaceId, environmentId }),
|
|
11141
|
-
success && totalPushed > 0 && /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", gap: 1,
|
|
11142
|
-
/* @__PURE__ */ jsx21(Text18, {
|
|
11143
|
-
/* @__PURE__ */
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
|
|
11147
|
-
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
|
|
11120
|
+
success && totalPushed > 0 && /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", gap: 1, children: [
|
|
11121
|
+
/* @__PURE__ */ jsx21(Text18, { color: PALETTE.success, children: "Your design system is now in Contentful Experiences." }),
|
|
11122
|
+
/* @__PURE__ */ jsx21(LinkRow, { title: "View your components here:", url: buildPostPushUrl(urlArgs) }),
|
|
11123
|
+
/* @__PURE__ */ jsx21(
|
|
11124
|
+
LinkRow,
|
|
11125
|
+
{
|
|
11126
|
+
title: "View your design tokens here:",
|
|
11127
|
+
url: buildPostPushUrl({ ...urlArgs, view: "design_tokens" })
|
|
11128
|
+
}
|
|
11129
|
+
)
|
|
11151
11130
|
] }),
|
|
11152
|
-
/* @__PURE__ */ jsx21(
|
|
11131
|
+
/* @__PURE__ */ jsx21(Text18, { dimColor: true, children: "[Enter / q] Exit" })
|
|
11153
11132
|
] });
|
|
11154
11133
|
}
|
|
11134
|
+
var ACTIONS;
|
|
11155
11135
|
var init_DoneStep = __esm({
|
|
11156
11136
|
"packages/experience-design-system-cli-legacy/src/import/tui/steps/DoneStep.tsx"() {
|
|
11157
11137
|
"use strict";
|
|
@@ -11159,6 +11139,7 @@ var init_DoneStep = __esm({
|
|
|
11159
11139
|
init_useImmediateInput();
|
|
11160
11140
|
init_contentful_urls();
|
|
11161
11141
|
init_SpaceEnvironment();
|
|
11142
|
+
ACTIONS = ["created", "updated", "removed"];
|
|
11162
11143
|
}
|
|
11163
11144
|
});
|
|
11164
11145
|
|
|
@@ -21055,9 +21036,9 @@ function CompactControlBar({ hasGroupRoots, searchActive }) {
|
|
|
21055
21036
|
return /* @__PURE__ */ jsxs27(Box26, { borderStyle: "single", borderColor: PALETTE.border, paddingX: 1, marginTop: 1, flexWrap: "wrap", columnGap: 2, children: [
|
|
21056
21037
|
legendEntry("[\u2191/\u2193]", "move"),
|
|
21057
21038
|
legendEntry("[a/r]", "accept/reject"),
|
|
21039
|
+
legendEntry("[f]", "continue/finalize"),
|
|
21058
21040
|
hasGroupRoots && legendEntry("[space/E/C]", "expand/collapse"),
|
|
21059
21041
|
legendEntry("[/]", "search", searchActive),
|
|
21060
|
-
legendEntry("[f]", "continue/finalize"),
|
|
21061
21042
|
legendEntry("[h]", "help"),
|
|
21062
21043
|
legendEntry("[q]", "quit")
|
|
21063
21044
|
] });
|
|
@@ -21076,11 +21057,11 @@ import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
|
21076
21057
|
function CounterStrip(props) {
|
|
21077
21058
|
const { counters, totalWidth } = props;
|
|
21078
21059
|
const condensed = totalWidth < 60;
|
|
21079
|
-
const labelGrp = condensed ? "Cmp" : "
|
|
21060
|
+
const labelGrp = condensed ? "Cmp" : "Components with Slots";
|
|
21080
21061
|
const labelRej = condensed ? "Rej" : "Rejected";
|
|
21081
21062
|
const labelUnd = condensed ? "Und" : "Undecided";
|
|
21082
21063
|
const sep = condensed ? " | " : " ";
|
|
21083
|
-
return /* @__PURE__ */ jsx32(Box27, {
|
|
21064
|
+
return /* @__PURE__ */ jsx32(Box27, { children: /* @__PURE__ */ jsxs28(Text28, { children: [
|
|
21084
21065
|
/* @__PURE__ */ jsxs28(Text28, { dimColor: true, children: [
|
|
21085
21066
|
labelGrp,
|
|
21086
21067
|
" "
|
|
@@ -21097,7 +21078,8 @@ function CounterStrip(props) {
|
|
|
21097
21078
|
labelUnd,
|
|
21098
21079
|
" "
|
|
21099
21080
|
] }),
|
|
21100
|
-
/* @__PURE__ */ jsx32(Text28, { bold: true, children: counters.undecided })
|
|
21081
|
+
/* @__PURE__ */ jsx32(Text28, { bold: true, children: counters.undecided }),
|
|
21082
|
+
/* @__PURE__ */ jsx32(Text28, { dimColor: true, children: sep })
|
|
21101
21083
|
] }) });
|
|
21102
21084
|
}
|
|
21103
21085
|
var init_CounterStrip = __esm({
|
|
@@ -22055,11 +22037,11 @@ function ScopeGateStepView({
|
|
|
22055
22037
|
return /* @__PURE__ */ jsx33(HelpOverlay, { sections: HELP_SECTIONS, handleInput: false, onClose: () => setShowHelp(false) });
|
|
22056
22038
|
}
|
|
22057
22039
|
return /* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", paddingX: 2, children: [
|
|
22058
|
-
|
|
22040
|
+
/* @__PURE__ */ jsx33(CounterStrip, { counters, totalWidth }),
|
|
22041
|
+
hasAnyAi && /* @__PURE__ */ jsxs29(Text29, { dimColor: true, children: [
|
|
22059
22042
|
`${aiExcludedCount} component${aiExcludedCount === 1 ? "" : "s"} flagged by AI`,
|
|
22060
22043
|
aiRows.length > 0 && /* @__PURE__ */ jsx33(Text29, { color: PALETTE.info, children: " \u2014 press [x] to see why" })
|
|
22061
|
-
] })
|
|
22062
|
-
/* @__PURE__ */ jsx33(CounterStrip, { counters, totalWidth }),
|
|
22044
|
+
] }),
|
|
22063
22045
|
hasCycles && /* @__PURE__ */ jsx33(Box28, { marginTop: 1, children: /* @__PURE__ */ jsx33(Text29, { dimColor: true, children: "If you must have components with cycles, select them together into the generate step and then use the editor to fix them." }) }),
|
|
22064
22046
|
/* @__PURE__ */ jsxs29(Box28, { flexDirection: "row", alignItems: "stretch", children: [
|
|
22065
22047
|
aiRationalePanel.isOpen ? /* @__PURE__ */ jsx33(
|
|
@@ -22824,47 +22806,36 @@ function serializeState(state, originalJson) {
|
|
|
22824
22806
|
}
|
|
22825
22807
|
function Picker({ value, active }) {
|
|
22826
22808
|
return /* @__PURE__ */ jsxs30(Box29, { children: [
|
|
22827
|
-
active && /* @__PURE__ */ jsx34(Text30, { color: PALETTE.
|
|
22828
|
-
/* @__PURE__ */ jsx34(Text30, { color: active ? PALETTE.
|
|
22829
|
-
active && /* @__PURE__ */ jsx34(Text30, { color: PALETTE.
|
|
22809
|
+
active && /* @__PURE__ */ jsx34(Text30, { color: PALETTE.warning, children: "\u2039" }),
|
|
22810
|
+
/* @__PURE__ */ jsx34(Text30, { color: active ? PALETTE.warning : PALETTE.inverse, bold: active, children: value }),
|
|
22811
|
+
active && /* @__PURE__ */ jsx34(Text30, { color: PALETTE.warning, children: "\u203A" })
|
|
22830
22812
|
] });
|
|
22831
22813
|
}
|
|
22832
22814
|
function Toggle({ value, active }) {
|
|
22833
|
-
return /* @__PURE__ */ jsx34(Box29, { children: /* @__PURE__ */ jsx34(Text30, { color: active ? PALETTE.
|
|
22815
|
+
return /* @__PURE__ */ jsx34(Box29, { children: /* @__PURE__ */ jsx34(Text30, { color: active ? PALETTE.warning : value ? PALETTE.success : PALETTE.border, children: value ? "[\u2713]" : "[ ]" }) });
|
|
22834
22816
|
}
|
|
22835
22817
|
function InlinePropField({
|
|
22836
22818
|
label,
|
|
22837
|
-
selected,
|
|
22838
22819
|
focused = false,
|
|
22839
22820
|
children,
|
|
22840
22821
|
flexible = false,
|
|
22841
22822
|
width
|
|
22842
22823
|
}) {
|
|
22843
22824
|
return /* @__PURE__ */ jsxs30(Box29, { width, gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, flexWrap: "wrap", children: [
|
|
22844
|
-
/* @__PURE__ */ jsxs30(
|
|
22845
|
-
|
|
22846
|
-
|
|
22847
|
-
|
|
22848
|
-
bold: focused,
|
|
22849
|
-
dimColor: !selected && !focused,
|
|
22850
|
-
wrap: "truncate-end",
|
|
22851
|
-
children: [
|
|
22852
|
-
focused ? "\u203A " : " ",
|
|
22853
|
-
label
|
|
22854
|
-
]
|
|
22855
|
-
}
|
|
22856
|
-
),
|
|
22825
|
+
/* @__PURE__ */ jsxs30(Text30, { color: focused ? PALETTE.warning : void 0, bold: focused, dimColor: !focused, wrap: "truncate-end", children: [
|
|
22826
|
+
focused ? "\u203A " : " ",
|
|
22827
|
+
label
|
|
22828
|
+
] }),
|
|
22857
22829
|
children
|
|
22858
22830
|
] });
|
|
22859
22831
|
}
|
|
22860
22832
|
function RequiredField({
|
|
22861
22833
|
value,
|
|
22862
|
-
selected,
|
|
22863
22834
|
focused,
|
|
22864
22835
|
editingField,
|
|
22865
22836
|
activeField
|
|
22866
22837
|
}) {
|
|
22867
|
-
return /* @__PURE__ */ jsx34(InlinePropField, { label: "req:",
|
|
22838
|
+
return /* @__PURE__ */ jsx34(InlinePropField, { label: "req:", focused, children: /* @__PURE__ */ jsx34(Toggle, { value, active: editingField && activeField === "required" }) });
|
|
22868
22839
|
}
|
|
22869
22840
|
function DefaultValueRow({
|
|
22870
22841
|
display,
|
|
@@ -22876,7 +22847,7 @@ function DefaultValueRow({
|
|
|
22876
22847
|
focused ? "\u203A " : " ",
|
|
22877
22848
|
"default:"
|
|
22878
22849
|
] }),
|
|
22879
|
-
active ? /* @__PURE__ */ jsx34(Picker, { value: display, active: true }) : /* @__PURE__ */ jsx34(Text30, { color: focused ? PALETTE.
|
|
22850
|
+
active ? /* @__PURE__ */ jsx34(Picker, { value: display, active: true }) : /* @__PURE__ */ jsx34(Text30, { color: focused ? PALETTE.inverse : PALETTE.inverse, wrap: "wrap", children: display })
|
|
22880
22851
|
] });
|
|
22881
22852
|
}
|
|
22882
22853
|
function RowLabel({
|
|
@@ -22993,7 +22964,7 @@ function DefaultSubRow({
|
|
|
22993
22964
|
focused ? "\u203A " : " ",
|
|
22994
22965
|
"default:"
|
|
22995
22966
|
] }),
|
|
22996
|
-
/* @__PURE__ */ jsxs30(Box29, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.
|
|
22967
|
+
/* @__PURE__ */ jsxs30(Box29, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
22997
22968
|
/* @__PURE__ */ jsx34(Text30, { children: value.slice(0, textCursor) }),
|
|
22998
22969
|
/* @__PURE__ */ jsx34(Text30, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
22999
22970
|
/* @__PURE__ */ jsx34(Text30, { children: value.slice(textCursor + 1) })
|
|
@@ -23005,7 +22976,7 @@ function DefaultSubRow({
|
|
|
23005
22976
|
focused ? "\u203A " : " ",
|
|
23006
22977
|
"default:"
|
|
23007
22978
|
] }),
|
|
23008
|
-
/* @__PURE__ */ jsx34(Text30, { color: focused ? PALETTE.
|
|
22979
|
+
/* @__PURE__ */ jsx34(Text30, { color: focused ? PALETTE.inverse : value ? PALETTE.inverse : void 0, dimColor: !value && !focused, children: value || "(none)" })
|
|
23009
22980
|
] });
|
|
23010
22981
|
}
|
|
23011
22982
|
function DescriptionField({
|
|
@@ -23019,7 +22990,6 @@ function DescriptionField({
|
|
|
23019
22990
|
compact = false,
|
|
23020
22991
|
paddingLeft = 2
|
|
23021
22992
|
}) {
|
|
23022
|
-
const cursor = cursorVisible ? "\u2588" : " ";
|
|
23023
22993
|
if (compact) {
|
|
23024
22994
|
return /* @__PURE__ */ jsxs30(Box29, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
23025
22995
|
/* @__PURE__ */ jsxs30(Text30, { color: focused ? PALETTE.warning : void 0, bold: focused, dimColor: !focused, children: [
|
|
@@ -23034,19 +23004,18 @@ function DescriptionField({
|
|
|
23034
23004
|
focused ? "\u203A " : " ",
|
|
23035
23005
|
label
|
|
23036
23006
|
] }),
|
|
23037
|
-
editing ? /* @__PURE__ */ jsx34(EditableDescription, {
|
|
23007
|
+
editing ? /* @__PURE__ */ jsx34(EditableDescription, { cursorVisible, value, textCursor }) : /* @__PURE__ */ jsx34(Text30, { wrap: "wrap", children: value || "\u2014" })
|
|
23038
23008
|
] });
|
|
23039
23009
|
}
|
|
23040
23010
|
function EditableDescription({
|
|
23041
|
-
cursor,
|
|
23042
23011
|
cursorVisible,
|
|
23043
23012
|
value,
|
|
23044
23013
|
textCursor
|
|
23045
23014
|
}) {
|
|
23046
23015
|
return /* @__PURE__ */ jsxs30(Text30, { wrap: "wrap", children: [
|
|
23047
23016
|
value.slice(0, textCursor),
|
|
23048
|
-
/* @__PURE__ */ jsx34(Text30, { inverse: cursorVisible, children:
|
|
23049
|
-
value.slice(textCursor)
|
|
23017
|
+
/* @__PURE__ */ jsx34(Text30, { inverse: cursorVisible, children: value[textCursor] ?? " " }),
|
|
23018
|
+
value.slice(textCursor + 1)
|
|
23050
23019
|
] });
|
|
23051
23020
|
}
|
|
23052
23021
|
function PropRow({
|
|
@@ -23081,34 +23050,33 @@ function PropRow({
|
|
|
23081
23050
|
paddingLeft: 0
|
|
23082
23051
|
}
|
|
23083
23052
|
),
|
|
23084
|
-
/* @__PURE__ */ jsxs30(Box29, {
|
|
23053
|
+
/* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", width, flexShrink: 0, children: [
|
|
23085
23054
|
/* @__PURE__ */ jsx34(
|
|
23086
23055
|
RequiredField,
|
|
23087
23056
|
{
|
|
23088
23057
|
value: prop.required,
|
|
23089
|
-
selected,
|
|
23090
23058
|
focused: activeField === "required",
|
|
23091
23059
|
editingField,
|
|
23092
23060
|
activeField
|
|
23093
23061
|
}
|
|
23094
23062
|
),
|
|
23095
|
-
/* @__PURE__ */ jsx34(InlinePropField, { label: "type:",
|
|
23063
|
+
/* @__PURE__ */ jsx34(InlinePropField, { label: "type:", focused: activeField === "type", children: editingField && activeField === "type" ? /* @__PURE__ */ jsx34(Picker, { value: prop.type, active: true }) : /* @__PURE__ */ jsx34(Text30, { color: selected ? PALETTE.inverse : PALETTE.inverse, children: prop.type }) })
|
|
23096
23064
|
] }),
|
|
23097
|
-
prop.type === "token" && /* @__PURE__ */ jsx34(InlinePropField, { label: "kind:",
|
|
23065
|
+
prop.type === "token" && /* @__PURE__ */ jsx34(InlinePropField, { label: "kind:", focused: activeField === "tokenKind", width, children: editingField && activeField === "tokenKind" ? /* @__PURE__ */ jsx34(Picker, { value: prop.tokenKind || DESIGN_TOKEN_TYPES2[0], active: true }) : /* @__PURE__ */ jsx34(Text30, { color: selected ? PALETTE.inverse : PALETTE.inverse, wrap: "wrap", children: prop.tokenKind || "\u2014" }) }),
|
|
23098
23066
|
prop.type === "enum" && /* @__PURE__ */ jsxs30(Box29, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
23099
23067
|
/* @__PURE__ */ jsxs30(
|
|
23100
23068
|
Text30,
|
|
23101
23069
|
{
|
|
23102
23070
|
color: activeField === "values" ? PALETTE.warning : void 0,
|
|
23103
23071
|
bold: activeField === "values",
|
|
23104
|
-
dimColor:
|
|
23072
|
+
dimColor: activeField !== "values",
|
|
23105
23073
|
children: [
|
|
23106
23074
|
activeField === "values" ? "\u203A " : " ",
|
|
23107
23075
|
"values:"
|
|
23108
23076
|
]
|
|
23109
23077
|
}
|
|
23110
23078
|
),
|
|
23111
|
-
/* @__PURE__ */ jsxs30(Text30, { color: activeField === "values" ? PALETTE.
|
|
23079
|
+
/* @__PURE__ */ jsxs30(Text30, { color: activeField === "values" ? PALETTE.inverse : selected ? PALETTE.inverse : void 0, wrap: "wrap", children: [
|
|
23112
23080
|
"[",
|
|
23113
23081
|
prop.values.join(", "),
|
|
23114
23082
|
"]"
|
|
@@ -23124,23 +23092,23 @@ function PropRow({
|
|
|
23124
23092
|
cursorVisible
|
|
23125
23093
|
}
|
|
23126
23094
|
),
|
|
23127
|
-
|
|
23095
|
+
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs30(Box29, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
23128
23096
|
/* @__PURE__ */ jsxs30(
|
|
23129
23097
|
Text30,
|
|
23130
23098
|
{
|
|
23131
23099
|
color: activeField === "allowed" ? PALETTE.warning : void 0,
|
|
23132
23100
|
bold: activeField === "allowed",
|
|
23133
|
-
dimColor:
|
|
23101
|
+
dimColor: activeField !== "allowed",
|
|
23134
23102
|
children: [
|
|
23135
23103
|
activeField === "allowed" ? "\u203A " : " ",
|
|
23136
23104
|
"allowed:"
|
|
23137
23105
|
]
|
|
23138
23106
|
}
|
|
23139
23107
|
),
|
|
23140
|
-
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx34(Box29, { width: Math.max(1, width - 4), borderStyle: "round", borderColor: PALETTE.
|
|
23108
|
+
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx34(Box29, { width: Math.max(1, width - 4), borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: /* @__PURE__ */ jsx34(Text30, { dimColor: true, children: "press [t] to edit allowed tokens" }) }) : /* @__PURE__ */ jsx34(
|
|
23141
23109
|
Text30,
|
|
23142
23110
|
{
|
|
23143
|
-
color: activeField === "allowed" ? PALETTE.
|
|
23111
|
+
color: activeField === "allowed" ? PALETTE.inverse : void 0,
|
|
23144
23112
|
dimColor: prop.allowed.length === 0 && activeField !== "allowed",
|
|
23145
23113
|
wrap: "wrap",
|
|
23146
23114
|
children: prop.allowed.length > 0 ? prop.allowed.join(", ") : "(any)"
|
|
@@ -23206,7 +23174,6 @@ function SlotRow({
|
|
|
23206
23174
|
RequiredField,
|
|
23207
23175
|
{
|
|
23208
23176
|
value: slot.required,
|
|
23209
|
-
selected,
|
|
23210
23177
|
focused: activeField === "required",
|
|
23211
23178
|
editingField,
|
|
23212
23179
|
activeField
|
|
@@ -23218,7 +23185,7 @@ function SlotRow({
|
|
|
23218
23185
|
{
|
|
23219
23186
|
color: activeField === "allowedComponents" ? PALETTE.warning : void 0,
|
|
23220
23187
|
bold: activeField === "allowedComponents",
|
|
23221
|
-
dimColor:
|
|
23188
|
+
dimColor: activeField !== "allowedComponents",
|
|
23222
23189
|
children: [
|
|
23223
23190
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
23224
23191
|
"allowed:"
|
|
@@ -23234,7 +23201,7 @@ function SlotRow({
|
|
|
23234
23201
|
{
|
|
23235
23202
|
color: activeField === "allowedComponents" ? PALETTE.warning : void 0,
|
|
23236
23203
|
bold: activeField === "allowedComponents",
|
|
23237
|
-
dimColor:
|
|
23204
|
+
dimColor: activeField !== "allowedComponents",
|
|
23238
23205
|
children: [
|
|
23239
23206
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
23240
23207
|
"allowed:"
|
|
@@ -23279,7 +23246,7 @@ function SlotRow({
|
|
|
23279
23246
|
] });
|
|
23280
23247
|
}
|
|
23281
23248
|
function propFields(prop) {
|
|
23282
|
-
const fields = ["
|
|
23249
|
+
const fields = ["description", "required", "type"];
|
|
23283
23250
|
if (prop.type === "token") {
|
|
23284
23251
|
fields.push("tokenKind");
|
|
23285
23252
|
}
|
|
@@ -23287,7 +23254,6 @@ function propFields(prop) {
|
|
|
23287
23254
|
if (prop.type !== "richtext" && prop.type !== "media" && prop.type !== "link") {
|
|
23288
23255
|
fields.push("default");
|
|
23289
23256
|
}
|
|
23290
|
-
fields.push("description");
|
|
23291
23257
|
if (prop.type === "token" && prop.category === "design") fields.push("allowed");
|
|
23292
23258
|
return fields;
|
|
23293
23259
|
}
|
|
@@ -23389,7 +23355,9 @@ function FieldEditor({
|
|
|
23389
23355
|
discardTrigger,
|
|
23390
23356
|
initialFocusTarget,
|
|
23391
23357
|
showHiddenProps = true,
|
|
23392
|
-
showInlineRationales = true
|
|
23358
|
+
showInlineRationales = true,
|
|
23359
|
+
header,
|
|
23360
|
+
headerHeight = 2
|
|
23393
23361
|
}) {
|
|
23394
23362
|
const { state: initialState, error: parseError } = parseToState(value);
|
|
23395
23363
|
const [editorState, setEditorState] = useState15(initialState);
|
|
@@ -24115,27 +24083,27 @@ function FieldEditor({
|
|
|
24115
24083
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
24116
24084
|
const modeLabel = (() => {
|
|
24117
24085
|
if (editingValue) {
|
|
24118
|
-
return editingValue.mode === "add" ? "Enter to add \xB7 Esc to cancel" : "Enter to save edit \xB7 Esc to cancel";
|
|
24086
|
+
return editingValue.mode === "add" ? "Enter to add \xB7 [Esc] to cancel" : "Enter to save edit \xB7 [Esc] to cancel";
|
|
24119
24087
|
}
|
|
24120
24088
|
if (focusLevel === "field" && editingField && activeField === "description") {
|
|
24121
|
-
return "Type to edit \u2190\u2192 cursor \u2191\u2193 cycle field Esc
|
|
24089
|
+
return "Type to edit [\u2190\u2192] cursor [\u2191\u2193] cycle field [Esc] back [Enter] save";
|
|
24122
24090
|
}
|
|
24123
24091
|
if (focusLevel === "field" && editingField && (activeField === "type" || activeField === "tokenKind")) {
|
|
24124
|
-
return "\u2190\u2192 cycle value \u2191\u2193
|
|
24092
|
+
return "[\u2190\u2192] cycle value [\u2191\u2193]/[\u2190\u2192] cycle field [Esc] back [Enter] save";
|
|
24125
24093
|
}
|
|
24126
24094
|
if (focusLevel === "field" && editingField && activeField === "required") {
|
|
24127
|
-
return "Space toggle Enter save Esc back";
|
|
24095
|
+
return "[Space] toggle [Enter] save [Esc] back";
|
|
24128
24096
|
}
|
|
24129
24097
|
if (focusLevel === "field" && editingField && (activeField === "values" || activeField === "allowedComponents")) {
|
|
24130
|
-
return "[a]
|
|
24098
|
+
return "[a] add [e] edit [r] remove [\u2191\u2193] navigate [Shift+\u2191/\u2193] reorder [Esc] back";
|
|
24131
24099
|
}
|
|
24132
24100
|
if (focusLevel === "field" && !editingField) {
|
|
24133
|
-
return "\u2191\u2193/\u2190\u2192 navigate fields Enter edit Esc back";
|
|
24101
|
+
return "[\u2191\u2193/\u2190\u2192] navigate fields [Enter] edit [Esc] back";
|
|
24134
24102
|
}
|
|
24135
24103
|
if (rationaleOpen) {
|
|
24136
|
-
return "\u2191\u2193
|
|
24104
|
+
return "[\u2191\u2193] scroll [i/Esc] close rationale panel";
|
|
24137
24105
|
}
|
|
24138
|
-
return
|
|
24106
|
+
return `[\u2191\u2193] navigate rows [Enter] edit fields [s] source [${propRationaleKey}] prop rationale [${componentRationaleKey}] component rationale [h] help [Esc] exit panel`;
|
|
24139
24107
|
})();
|
|
24140
24108
|
const rows = [];
|
|
24141
24109
|
rows.push({ kind: "component-description" });
|
|
@@ -24174,7 +24142,7 @@ function FieldEditor({
|
|
|
24174
24142
|
return `${base}-${selected ? "selected" : "normal"}`;
|
|
24175
24143
|
};
|
|
24176
24144
|
const rowHeight = (row, index) => rowHeights[rowKey(row, index)] ?? 1;
|
|
24177
|
-
const contentHeight = Math.max(1, height - 2 - (hasEmptyProperties ? 1 : 0) - 1);
|
|
24145
|
+
const contentHeight = Math.max(1, height - 2 - (hasEmptyProperties ? 1 : 0) - 1 - (header ? headerHeight : 0));
|
|
24178
24146
|
const visibleEnd = (start) => {
|
|
24179
24147
|
if (focusLevel === "field") return Math.min(rows.length, start + 1);
|
|
24180
24148
|
let used = 0;
|
|
@@ -24261,7 +24229,7 @@ function FieldEditor({
|
|
|
24261
24229
|
}
|
|
24262
24230
|
if (row.kind === "prop") {
|
|
24263
24231
|
const p = props[row.idx];
|
|
24264
|
-
const isSelected2 = !inSlots && !inComponentDesc && row.idx === propIdx;
|
|
24232
|
+
const isSelected2 = active && !inSlots && !inComponentDesc && row.idx === propIdx;
|
|
24265
24233
|
const propMeta = metadata?.props?.[p.name];
|
|
24266
24234
|
const commonRowProps2 = createCommonRowProps(
|
|
24267
24235
|
isSelected2,
|
|
@@ -24288,7 +24256,7 @@ function FieldEditor({
|
|
|
24288
24256
|
);
|
|
24289
24257
|
}
|
|
24290
24258
|
const s = slots[row.idx];
|
|
24291
|
-
const isSelected = inSlots && row.idx === slotIdx;
|
|
24259
|
+
const isSelected = active && inSlots && row.idx === slotIdx;
|
|
24292
24260
|
const slotPickerCandidates = isSelected && editingValue?.mode === "add" && activeField === "allowedComponents" && projectSlotGraph && currentComponentName ? computeAllowedComponentCandidates(projectSlotGraph, currentComponentName, slots, s.name) : null;
|
|
24293
24261
|
const commonRowProps = createCommonRowProps(
|
|
24294
24262
|
isSelected,
|
|
@@ -24323,6 +24291,7 @@ function FieldEditor({
|
|
|
24323
24291
|
borderColor: hasEmptyProperties ? PALETTE.warning : active ? PALETTE.info : PALETTE.border,
|
|
24324
24292
|
children: [
|
|
24325
24293
|
hasEmptyProperties && /* @__PURE__ */ jsx34(Text30, { 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." }),
|
|
24294
|
+
header,
|
|
24326
24295
|
/* @__PURE__ */ jsx34(Box29, { flexDirection: "column", width: innerWidth, flexShrink: 0, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx34(
|
|
24327
24296
|
PropRow,
|
|
24328
24297
|
{
|
|
@@ -24437,7 +24406,7 @@ var init_FieldEditor = __esm({
|
|
|
24437
24406
|
init_scroll_offset();
|
|
24438
24407
|
init_cycle_detection();
|
|
24439
24408
|
init_windowed_panel();
|
|
24440
|
-
SLOT_FIELDS = ["
|
|
24409
|
+
SLOT_FIELDS = ["description", "required", "allowedComponents"];
|
|
24441
24410
|
}
|
|
24442
24411
|
});
|
|
24443
24412
|
|
|
@@ -25022,7 +24991,8 @@ function ReviewDetailsEditor({
|
|
|
25022
24991
|
jsonValue,
|
|
25023
24992
|
sidebarFocused,
|
|
25024
24993
|
reviewEditor,
|
|
25025
|
-
fieldEditor
|
|
24994
|
+
fieldEditor,
|
|
24995
|
+
header
|
|
25026
24996
|
}) {
|
|
25027
24997
|
const {
|
|
25028
24998
|
panelOpen,
|
|
@@ -25066,7 +25036,8 @@ function ReviewDetailsEditor({
|
|
|
25066
25036
|
active: !sidebarFocused,
|
|
25067
25037
|
initialFocusTarget: sidebarFocused ? void 0 : fieldEditor.initialFocusTarget,
|
|
25068
25038
|
metadata: toFieldEditorMetadata(reviewMetadata),
|
|
25069
|
-
showInlineRationales: false
|
|
25039
|
+
showInlineRationales: false,
|
|
25040
|
+
header
|
|
25070
25041
|
}
|
|
25071
25042
|
)
|
|
25072
25043
|
}
|
|
@@ -25147,6 +25118,25 @@ function ReviewPanelFooter({
|
|
|
25147
25118
|
livePreview.disabled && /* @__PURE__ */ jsx44(Text39, { children: " \xB7 live preview disabled" })
|
|
25148
25119
|
] });
|
|
25149
25120
|
}
|
|
25121
|
+
function ReviewComponentTitle({
|
|
25122
|
+
selectedKey,
|
|
25123
|
+
propCount,
|
|
25124
|
+
slotCount,
|
|
25125
|
+
sidebarFocused
|
|
25126
|
+
}) {
|
|
25127
|
+
return /* @__PURE__ */ jsxs36(Box35, { paddingLeft: 2, paddingBottom: 1, children: [
|
|
25128
|
+
/* @__PURE__ */ jsx44(Text39, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
25129
|
+
/* @__PURE__ */ jsx44(Box35, { flexGrow: 1 }),
|
|
25130
|
+
/* @__PURE__ */ jsxs36(Text39, { dimColor: true, wrap: "truncate-end", children: [
|
|
25131
|
+
propCount,
|
|
25132
|
+
" prop",
|
|
25133
|
+
propCount !== 1 ? "s" : "",
|
|
25134
|
+
slotCount > 0 ? ` \xB7 ${slotCount} slot${slotCount !== 1 ? "s" : ""}` : "",
|
|
25135
|
+
" ",
|
|
25136
|
+
sidebarFocused ? "[Tab] focus panel" : "[Tab] focus list"
|
|
25137
|
+
] })
|
|
25138
|
+
] });
|
|
25139
|
+
}
|
|
25150
25140
|
function ReviewComponentPanel({
|
|
25151
25141
|
selectedKey,
|
|
25152
25142
|
selectedEntry,
|
|
@@ -25166,21 +25156,9 @@ function ReviewComponentPanel({
|
|
|
25166
25156
|
}) {
|
|
25167
25157
|
const propCount = Object.keys(selectedEntry.$properties).length;
|
|
25168
25158
|
const slotCount = selectedEntry.$slots ? Object.keys(selectedEntry.$slots).length : 0;
|
|
25169
|
-
const contentHeight = Math.max(1, height -
|
|
25159
|
+
const contentHeight = Math.max(1, height - 2);
|
|
25170
25160
|
const contentWidth = Math.max(1, width - 1);
|
|
25171
25161
|
return /* @__PURE__ */ jsx44(FixedPanel, { width, height, borderStyle: void 0, paddingLeft: 1, children: /* @__PURE__ */ jsxs36(Box35, { flexDirection: "column", width: contentWidth, height, flexShrink: 0, overflowY: "hidden", children: [
|
|
25172
|
-
/* @__PURE__ */ jsxs36(Box35, { width: contentWidth, height: 1, flexShrink: 0, children: [
|
|
25173
|
-
/* @__PURE__ */ jsx44(Text39, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
25174
|
-
/* @__PURE__ */ jsx44(Box35, { flexGrow: 1 }),
|
|
25175
|
-
/* @__PURE__ */ jsxs36(Text39, { dimColor: true, wrap: "truncate-end", children: [
|
|
25176
|
-
propCount,
|
|
25177
|
-
" prop",
|
|
25178
|
-
propCount !== 1 ? "s" : "",
|
|
25179
|
-
slotCount > 0 ? ` \xB7 ${slotCount} slot${slotCount !== 1 ? "s" : ""}` : "",
|
|
25180
|
-
" ",
|
|
25181
|
-
sidebarFocused ? "[Tab] focus panel" : "[Tab] focus list"
|
|
25182
|
-
] })
|
|
25183
|
-
] }),
|
|
25184
25162
|
/* @__PURE__ */ jsx44(Box35, { width: contentWidth, height: contentHeight, flexShrink: 0, overflowY: "hidden", children: /* @__PURE__ */ jsx44(
|
|
25185
25163
|
ReviewDetailsEditor,
|
|
25186
25164
|
{
|
|
@@ -25193,7 +25171,16 @@ function ReviewComponentPanel({
|
|
|
25193
25171
|
sourceBorderColor,
|
|
25194
25172
|
jsonValue,
|
|
25195
25173
|
sidebarFocused,
|
|
25196
|
-
fieldEditor
|
|
25174
|
+
fieldEditor,
|
|
25175
|
+
header: /* @__PURE__ */ jsx44(
|
|
25176
|
+
ReviewComponentTitle,
|
|
25177
|
+
{
|
|
25178
|
+
selectedKey,
|
|
25179
|
+
propCount,
|
|
25180
|
+
slotCount,
|
|
25181
|
+
sidebarFocused
|
|
25182
|
+
}
|
|
25183
|
+
)
|
|
25197
25184
|
}
|
|
25198
25185
|
) }),
|
|
25199
25186
|
/* @__PURE__ */ jsx44(Box35, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx44(Text39, { color: saveError ? PALETTE.error : void 0, wrap: "truncate-end", children: saveError ? "\u2717 " + saveError : " " }) }),
|
|
@@ -25403,8 +25390,8 @@ function FinalizeDialog({
|
|
|
25403
25390
|
const windowed = removed.slice(offset, offset + FINALIZE_REMOVED_WINDOW);
|
|
25404
25391
|
const hasMoreBelow = offset + FINALIZE_REMOVED_WINDOW < removed.length;
|
|
25405
25392
|
const hasMoreAbove = offset > 0;
|
|
25406
|
-
return /* @__PURE__ */ jsx46(Box37, { width: "100%", justifyContent: "center", children: /* @__PURE__ */ jsxs38(Box37, { flexDirection: "column", borderStyle: "round", padding: 1, width: 58, children: [
|
|
25407
|
-
/* @__PURE__ */ jsx46(Text41, { bold: true, children: "\u2500".repeat(
|
|
25393
|
+
return /* @__PURE__ */ jsx46(Box37, { width: "100%", justifyContent: "center", children: /* @__PURE__ */ jsxs38(Box37, { flexDirection: "column", alignItems: "center", borderStyle: "round", padding: 1, width: 58, children: [
|
|
25394
|
+
/* @__PURE__ */ jsx46(Text41, { bold: true, children: "\u2500".repeat(22) + " Finalize " + "\u2500".repeat(22) }),
|
|
25408
25395
|
/* @__PURE__ */ jsx46(Text41, { children: " " }),
|
|
25409
25396
|
/* @__PURE__ */ jsxs38(Text41, { children: [
|
|
25410
25397
|
/* @__PURE__ */ jsxs38(Text41, { color: PALETTE.success, children: [
|
|
@@ -25425,12 +25412,12 @@ function FinalizeDialog({
|
|
|
25425
25412
|
/* @__PURE__ */ jsx46(Text41, { children: " " }),
|
|
25426
25413
|
noneAccepted && /* @__PURE__ */ jsxs38(Fragment16, { children: [
|
|
25427
25414
|
/* @__PURE__ */ jsx46(Text41, { bold: true, color: PALETTE.warning, children: "\u26A0 No components are accepted \u2014 nothing will be pushed." }),
|
|
25428
|
-
/* @__PURE__ */ jsx46(Text41, { color: PALETTE.warning, children: "
|
|
25415
|
+
/* @__PURE__ */ jsx46(Text41, { color: PALETTE.warning, children: "Accept at least one component ([a] a row, [A] accept all) to push." }),
|
|
25429
25416
|
/* @__PURE__ */ jsx46(Text41, { children: " " })
|
|
25430
25417
|
] }),
|
|
25431
25418
|
!allResolved && /* @__PURE__ */ jsxs38(Fragment16, { children: [
|
|
25432
25419
|
/* @__PURE__ */ jsx46(Text41, { color: PALETTE.warning, children: "\u26A0 " + needsReview + " unresolved component" + (needsReview === 1 ? "" : "s") + " will not be pushed." }),
|
|
25433
|
-
/* @__PURE__ */ jsx46(Text41, { color: PALETTE.warning, children: "
|
|
25420
|
+
/* @__PURE__ */ jsx46(Text41, { color: PALETTE.warning, children: "Only explicitly accepted components ship." }),
|
|
25434
25421
|
/* @__PURE__ */ jsx46(Text41, { children: " " })
|
|
25435
25422
|
] }),
|
|
25436
25423
|
/* @__PURE__ */ jsxs38(Box37, { flexDirection: "column", height: 2, children: [
|
|
@@ -25439,15 +25426,15 @@ function FinalizeDialog({
|
|
|
25439
25426
|
] }),
|
|
25440
25427
|
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs38(Fragment16, { children: [
|
|
25441
25428
|
/* @__PURE__ */ jsx46(Text41, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removed.length, false) }),
|
|
25442
|
-
hasMoreAbove && /* @__PURE__ */ jsx46(Text41, { dimColor: true, children: "
|
|
25429
|
+
hasMoreAbove && /* @__PURE__ */ jsx46(Text41, { dimColor: true, children: "\u2191 more above" }),
|
|
25443
25430
|
windowed.map((rc) => /* @__PURE__ */ jsx46(Text41, { color: PALETTE.error, children: removedComponentLine(rc) }, rc.id)),
|
|
25444
|
-
hasMoreBelow && /* @__PURE__ */ jsx46(Text41, { dimColor: true, children: "
|
|
25445
|
-
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */ jsx46(Text41, { dimColor: true, children: "
|
|
25431
|
+
hasMoreBelow && /* @__PURE__ */ jsx46(Text41, { dimColor: true, children: "\u2193 more below" }),
|
|
25432
|
+
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */ jsx46(Text41, { dimColor: true, children: "[\u2191\u2193] scroll deletions" }),
|
|
25446
25433
|
/* @__PURE__ */ jsx46(Text41, { children: " " })
|
|
25447
25434
|
] }),
|
|
25448
25435
|
/* @__PURE__ */ jsx46(Text41, { children: noneAccepted ? "Confirm exit with nothing accepted?" : allResolved ? "Save decisions and exit? All components resolved." : "Save decisions and exit?" }),
|
|
25449
25436
|
/* @__PURE__ */ jsx46(Text41, { children: " " }),
|
|
25450
|
-
/* @__PURE__ */ jsx46(Text41, { children: "
|
|
25437
|
+
/* @__PURE__ */ jsx46(Text41, { children: "[y / Enter] Confirm [n / Esc] Cancel" })
|
|
25451
25438
|
] }) });
|
|
25452
25439
|
}
|
|
25453
25440
|
var FINALIZE_REMOVED_WINDOW;
|
|
@@ -27706,7 +27693,6 @@ function GenerateReviewStepView({
|
|
|
27706
27693
|
}
|
|
27707
27694
|
),
|
|
27708
27695
|
saveError: reviewEditor.saveError,
|
|
27709
|
-
sidebarFooter: hasGroupRoots ? " [Space] expand/collapse group [E/C] expand/collapse all" : "",
|
|
27710
27696
|
livePreview: livePreviewHook,
|
|
27711
27697
|
livePreviewSpinner
|
|
27712
27698
|
}
|
|
@@ -29842,8 +29828,10 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
29842
29828
|
{
|
|
29843
29829
|
successMessage: "Existing tokens.json found",
|
|
29844
29830
|
summary: state.tokenSourceChanged ? `Source file has been modified since tokens were last generated.
|
|
29845
|
-
|
|
29846
|
-
|
|
29831
|
+
|
|
29832
|
+
Tokens Path: ${state.tokensPath}` : `Source file has not changed since tokens were last generated.
|
|
29833
|
+
|
|
29834
|
+
Tokens Path: ${state.tokensPath}`,
|
|
29847
29835
|
context: state.tokenSourceChanged ? "The source tokens file changed \u2014 regenerating is recommended." : void 0,
|
|
29848
29836
|
continueLabel: "Reuse existing tokens",
|
|
29849
29837
|
skipLabel: "Regenerate tokens",
|
|
@@ -30048,7 +30036,8 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
30048
30036
|
stepNumber: stepNum,
|
|
30049
30037
|
totalSteps,
|
|
30050
30038
|
title: "Generating definitions",
|
|
30051
|
-
description: `${formatAcceptanceSummary({ accepted: state.acceptedCount, autoRejected: state.autoRejectedCount })}
|
|
30039
|
+
description: `${formatAcceptanceSummary({ accepted: state.acceptedCount, autoRejected: state.autoRejectedCount })}
|
|
30040
|
+
${displayAgent} is mapping your selected components to Contentful's Component Definition Format (CDF).${hasTokens ? " Using your design tokens for prop resolution." : ""}`,
|
|
30052
30041
|
detail: progressDetail,
|
|
30053
30042
|
detailProgress: p ? { done: p.done, total: p.total } : void 0,
|
|
30054
30043
|
secondaryDetail: mapTokensDetail,
|
package/legacy/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.37.1-dev-build-
|
|
3
|
+
"version": "2.37.1-dev-build-0e44d27b.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -33,8 +33,7 @@
|
|
|
33
33
|
"clean": "nx clean experience-design-system-cli",
|
|
34
34
|
"test": "nx test experience-design-system-cli",
|
|
35
35
|
"lint": "nx lint experience-design-system-cli",
|
|
36
|
-
"lint:fix": "nx lint:fix experience-design-system-cli"
|
|
37
|
-
"dev": "node scripts/dev.mjs"
|
|
36
|
+
"lint:fix": "nx lint:fix experience-design-system-cli"
|
|
38
37
|
},
|
|
39
38
|
"dependencies": {
|
|
40
39
|
"@contentful/experience-design-system-types": "workspace:*",
|
|
@@ -58,7 +57,6 @@
|
|
|
58
57
|
"@types/node": "^24.0.3",
|
|
59
58
|
"@types/react": "^18.3.24",
|
|
60
59
|
"@types/semver": "^7.7.1",
|
|
61
|
-
"esbuild": "0.28.0",
|
|
62
60
|
"eslint": "^9.39.5",
|
|
63
61
|
"eslint-config-prettier": "^10.1.8",
|
|
64
62
|
"eslint-plugin-prettier": "^5.5.6",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.37.1-dev-build-
|
|
3
|
+
"version": "2.37.1-dev-build-0e44d27b.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -42,14 +42,13 @@
|
|
|
42
42
|
"svelte": "^5.56.4",
|
|
43
43
|
"ts-morph": "^27.0.2",
|
|
44
44
|
"typescript": "^5.9.3",
|
|
45
|
-
"@contentful/experience-design-system-types": "2.37.1-dev-build-
|
|
45
|
+
"@contentful/experience-design-system-types": "2.37.1-dev-build-0e44d27b.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@tsconfig/node24": "^24.0.4",
|
|
49
49
|
"@types/node": "^24.0.3",
|
|
50
50
|
"@types/react": "^18.3.24",
|
|
51
51
|
"@types/semver": "^7.7.1",
|
|
52
|
-
"esbuild": "0.28.0",
|
|
53
52
|
"eslint": "^9.39.5",
|
|
54
53
|
"eslint-config-prettier": "^10.1.8",
|
|
55
54
|
"eslint-plugin-prettier": "^5.5.6",
|
|
@@ -74,7 +73,6 @@
|
|
|
74
73
|
"clean": "nx clean experience-design-system-cli",
|
|
75
74
|
"test": "nx test experience-design-system-cli",
|
|
76
75
|
"lint": "nx lint experience-design-system-cli",
|
|
77
|
-
"lint:fix": "nx lint:fix experience-design-system-cli"
|
|
78
|
-
"dev": "node scripts/dev.mjs"
|
|
76
|
+
"lint:fix": "nx lint:fix experience-design-system-cli"
|
|
79
77
|
}
|
|
80
78
|
}
|