@contentful/experience-design-system-cli 2.38.1-dev-build-db0347a4.0 → 2.38.1-dev-build-dda16770.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 CHANGED
@@ -19198,6 +19198,7 @@ function GotoBanner({
19198
19198
  borderStyle: "single",
19199
19199
  borderColor: PALETTE.accent,
19200
19200
  paddingX: 1,
19201
+ paddingBottom: 1,
19201
19202
  marginTop: width === void 0 ? 1 : 0,
19202
19203
  width,
19203
19204
  flexShrink: 0,
@@ -19209,7 +19210,7 @@ function GotoBanner({
19209
19210
  return renderRow(row, i, i === highlightIndex);
19210
19211
  }),
19211
19212
  moreBelow > 0 && /* @__PURE__ */ jsx24(Text21, { color: PALETTE.muted, children: ` \u25BC ${moreBelow} more` }),
19212
- footerHint !== void 0 && /* @__PURE__ */ jsx24(Text21, { color: PALETTE.muted, children: footerHint })
19213
+ footerHint !== void 0 && /* @__PURE__ */ jsx24(Box21, { marginTop: 1, children: /* @__PURE__ */ jsx24(Text21, { color: PALETTE.muted, children: footerHint }) })
19213
19214
  ]
19214
19215
  }
19215
19216
  );
@@ -21714,7 +21715,7 @@ var capitalize = (name) => name.charAt(0).toUpperCase() + name.slice(1);
21714
21715
  function describeGeneration(input) {
21715
21716
  const agent = capitalize(input.agent);
21716
21717
  return `${formatAcceptanceSummary({ accepted: input.acceptedCount, autoRejected: 0 })}
21717
- ${agent} is reading each selected component and writing a Contentful component definition for it${input.hasTokens ? " Using your design tokens for prop resolution." : ""}`;
21718
+ ${agent} is reading each selected component and writing a Contentful component definition for it.${input.hasTokens ? "\nUsing your design tokens for prop resolution." : ""}`;
21718
21719
  }
21719
21720
  function progressRows2(progress, agent) {
21720
21721
  const name = capitalize(agent);
@@ -23372,7 +23373,6 @@ function FieldEditor({
23372
23373
  const [rationaleOpen, setRationaleOpen] = useState19(false);
23373
23374
  const [rationaleScrollOffset, setRationaleScrollOffset] = useState19(0);
23374
23375
  const [showHelp, setShowHelp] = useState19(false);
23375
- const [pendingDelete, setPendingDelete] = useState19(null);
23376
23376
  const props = editorState.props;
23377
23377
  const slots = editorState.slots;
23378
23378
  const contentPropIndexes = React13.useMemo(
@@ -23464,46 +23464,6 @@ function FieldEditor({
23464
23464
  setEditorState(next);
23465
23465
  onChange(serializeState(next, value));
23466
23466
  };
23467
- const deleteRow = (row) => {
23468
- if (row.kind === "prop") {
23469
- const nextProps = removeAt(editorState.props, row.idx);
23470
- commit({ ...editorState, props: nextProps });
23471
- setPropIdx(Math.max(0, Math.min(row.idx, nextProps.length - 1)));
23472
- const rowsAfter2 = selectableRows.filter((r) => !(r.kind === "prop" && r.idx === row.idx));
23473
- const neighbour2 = rowsAfter2[Math.max(0, selectableRows.findIndex((r) => r.kind === row.kind && r.idx === row.idx) - 1)];
23474
- if (!neighbour2) {
23475
- setInSlots(false);
23476
- setInComponentDesc(true);
23477
- setFocusLevel("componentDescription");
23478
- } else if (neighbour2.kind === "prop") {
23479
- setInSlots(false);
23480
- setPropIdx(neighbour2.idx > row.idx ? neighbour2.idx - 1 : neighbour2.idx);
23481
- setFocusLevel("prop");
23482
- } else {
23483
- setInSlots(true);
23484
- setSlotIdx(neighbour2.idx);
23485
- setFocusLevel("slot");
23486
- }
23487
- return;
23488
- }
23489
- const nextSlots = removeAt(editorState.slots, row.idx);
23490
- commit({ ...editorState, slots: nextSlots });
23491
- const rowsAfter = selectableRows.filter((r) => !(r.kind === "slot" && r.idx === row.idx));
23492
- const neighbour = rowsAfter[Math.max(0, selectableRows.findIndex((r) => r.kind === row.kind && r.idx === row.idx) - 1)];
23493
- if (!neighbour) {
23494
- setInSlots(false);
23495
- setInComponentDesc(true);
23496
- setFocusLevel("componentDescription");
23497
- } else if (neighbour.kind === "slot") {
23498
- setInSlots(true);
23499
- setSlotIdx(neighbour.idx > row.idx ? neighbour.idx - 1 : neighbour.idx);
23500
- setFocusLevel("slot");
23501
- } else {
23502
- setInSlots(false);
23503
- setPropIdx(neighbour.idx);
23504
- setFocusLevel("prop");
23505
- }
23506
- };
23507
23467
  const canonicalize = React13.useCallback((json) => {
23508
23468
  try {
23509
23469
  return JSON.stringify(JSON.parse(json));
@@ -23540,11 +23500,6 @@ function FieldEditor({
23540
23500
  onSave();
23541
23501
  return;
23542
23502
  }
23543
- if (pendingDelete) {
23544
- if (input === "y") deleteRow(pendingDelete);
23545
- setPendingDelete(null);
23546
- return;
23547
- }
23548
23503
  const inDescriptionTextEntryForHelp = focusLevel === "field" && editingField && activeField === "description";
23549
23504
  const inStringDefaultTextEntryForHelp = focusLevel === "field" && editingField && activeField === "default" && currentProp != null && (currentProp.type === "string" || currentProp.type === "token");
23550
23505
  const inValueListTextEntry = editingValue != null;
@@ -23744,11 +23699,6 @@ function FieldEditor({
23744
23699
  }
23745
23700
  return;
23746
23701
  }
23747
- if (input === "d" && !key.ctrl && !key.meta) {
23748
- if (focusLevel === "prop" && currentProp) setPendingDelete({ kind: "prop", idx: propIdx });
23749
- if (focusLevel === "slot" && currentSlot) setPendingDelete({ kind: "slot", idx: slotIdx });
23750
- return;
23751
- }
23752
23702
  if (focusLevel === "slot" && key.return && currentSlot) {
23753
23703
  setFocusLevel("field");
23754
23704
  setActiveField(SLOT_FIELDS[0] ?? null);
@@ -24055,10 +24005,6 @@ function FieldEditor({
24055
24005
  }
24056
24006
  const hasEmptyProperties = props.length === 0 && slots.length === 0;
24057
24007
  const modeLabel = (() => {
24058
- if (pendingDelete) {
24059
- const name = pendingDelete.kind === "prop" ? props[pendingDelete.idx]?.name : slots[pendingDelete.idx]?.name;
24060
- return `Delete ${pendingDelete.kind} "${name}"? [y] delete \xB7 any other key cancels`;
24061
- }
24062
24008
  if (editingValue) {
24063
24009
  return editingValue.mode === "add" ? "Enter to add \xB7 [Esc] to cancel" : "Enter to save edit \xB7 [Esc] to cancel";
24064
24010
  }
@@ -24080,7 +24026,7 @@ function FieldEditor({
24080
24026
  if (rationaleOpen) {
24081
24027
  return "[\u2191\u2193] scroll [i/Esc] close rationale panel";
24082
24028
  }
24083
- return `[\u2191\u2193] navigate [Enter] edit fields [d] delete property [h] help [s] source [Esc] exit panel`;
24029
+ return `[\u2191\u2193] navigate [Enter] edit fields [h] help [s] source [Esc] exit panel`;
24084
24030
  })();
24085
24031
  const rows = [];
24086
24032
  rows.push({ kind: "component-description" });
@@ -24346,7 +24292,6 @@ function FieldEditor({
24346
24292
  /* @__PURE__ */ jsx32(Text27, { bold: true, children: "Row navigation" }),
24347
24293
  /* @__PURE__ */ jsx32(Text27, { children: " \u2191/\u2193 move between rows" }),
24348
24294
  /* @__PURE__ */ jsx32(Text27, { children: " Enter edit fields on the current row" }),
24349
- /* @__PURE__ */ jsx32(Text27, { children: " d delete the current prop or slot (asks to confirm)" }),
24350
24295
  /* @__PURE__ */ jsx32(Text27, { children: " Esc exit the panel" }),
24351
24296
  /* @__PURE__ */ jsx32(Text27, { children: " " }),
24352
24297
  /* @__PURE__ */ jsx32(Text27, { bold: true, children: "Field editing" }),
@@ -24370,7 +24315,7 @@ function FieldEditor({
24370
24315
  /* @__PURE__ */ jsx32(Text27, { color: PALETTE.muted, children: "press ? or Esc to close" })
24371
24316
  ] }),
24372
24317
  validationError && /* @__PURE__ */ jsx32(Text27, { color: PALETTE.error, children: "\u2717 " + validationError }),
24373
- /* @__PURE__ */ jsx32(Box26, { paddingTop: 1, children: /* @__PURE__ */ jsx32(Text27, { color: pendingDelete ? PALETTE.text : PALETTE.muted, children: modeLabel }) })
24318
+ /* @__PURE__ */ jsx32(Box26, { paddingTop: 1, children: /* @__PURE__ */ jsx32(Text27, { color: PALETTE.muted, children: modeLabel }) })
24374
24319
  ]
24375
24320
  }
24376
24321
  );
@@ -24709,8 +24654,8 @@ function TokenReviewPanel({
24709
24654
  borderStyle: "single",
24710
24655
  borderColor: active ? PALETTE.text : void 0,
24711
24656
  children: [
24712
- /* @__PURE__ */ jsx39(Text32, { bold: true, color: active ? void 0 : PALETTE.muted, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
24713
- /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
24657
+ /* @__PURE__ */ jsx39(Text32, { bold: true, color: active ? void 0 : PALETTE.muted, wrap: "truncate", children: `Review mapped tokens \u2014 ${componentName} \xB7 ${current.propName}${current.kinds.length > 0 ? ` (${current.kinds.join(", ")})` : ""}` }),
24658
+ /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, wrap: "truncate", children: `Tick the tokens this property may use (${rangeLabel}).` }),
24714
24659
  /* @__PURE__ */ jsx39(Text32, { children: " " }),
24715
24660
  current.paths.length === 0 && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "(no compatible tokens found for this token kind)" }),
24716
24661
  visiblePaths.map((path5, i) => {
@@ -24743,18 +24688,33 @@ function TokenReviewPanel({
24743
24688
  borderStyle: "single",
24744
24689
  borderColor: active ? PALETTE.text : void 0,
24745
24690
  children: [
24746
- /* @__PURE__ */ jsx39(Text32, { bold: true, color: active ? void 0 : PALETTE.muted, children: `TOKEN REVIEW \u2014 ${componentName}` }),
24691
+ /* @__PURE__ */ jsx39(Text32, { bold: true, color: active ? void 0 : PALETTE.muted, children: `Review mapped tokens \u2014 ${componentName}` }),
24692
+ /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, wrap: "truncate", children: `${componentName} has ${suggestions.length} design ${suggestions.length === 1 ? "prop" : "props"} of type token. Select which tokens are allowed for each property.` }),
24693
+ /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, wrap: "truncate", children: "Suggested tokens come from the agent. Allowed tokens are what editors can pick in Contentful." }),
24694
+ /* @__PURE__ */ jsx39(Text32, { children: " " }),
24747
24695
  suggestions.length === 0 && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "(no token suggestions for this component)" }),
24748
24696
  suggestions.map((s, i) => {
24749
24697
  const focused = i === selectedRow;
24750
24698
  return /* @__PURE__ */ jsxs30(Box31, { flexDirection: "column", children: [
24751
- /* @__PURE__ */ jsx39(Box31, { children: /* @__PURE__ */ jsx39(Text32, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures7.pointer : " "} ${s.propName}` }) }),
24752
- /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: ` suggested: ${s.suggested.join(", ")}` }),
24753
- /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: ` allowed: ${s.allowed.join(", ")}` })
24699
+ /* @__PURE__ */ jsx39(Box31, { children: /* @__PURE__ */ jsx39(Text32, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures7.pointer : " "} ${s.propName}${s.kinds.length > 0 ? ` (${s.kinds.join(", ")})` : ""}` }) }),
24700
+ /* @__PURE__ */ jsx39(
24701
+ Text32,
24702
+ {
24703
+ color: PALETTE.muted,
24704
+ children: ` suggested: ${s.suggested.length > 0 ? s.suggested.join(", ") : "none"}`
24705
+ }
24706
+ ),
24707
+ /* @__PURE__ */ jsx39(
24708
+ Text32,
24709
+ {
24710
+ color: PALETTE.muted,
24711
+ children: ` allowed: ${s.allowed.length > 0 ? s.allowed.join(", ") : "none (any token)"}`
24712
+ }
24713
+ ),
24714
+ /* @__PURE__ */ jsx39(Text32, { children: " " })
24754
24715
  ] }, s.propName);
24755
24716
  }),
24756
- /* @__PURE__ */ jsx39(Text32, { children: " " }),
24757
- /* @__PURE__ */ jsx39(Text32, { children: "[\u2191/\u2193] move [Enter] edit allowed [Esc] close" })
24717
+ /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "[\u2191/\u2193] move [Enter] edit allowed tokens [Esc] close" })
24758
24718
  ]
24759
24719
  }
24760
24720
  );
@@ -25002,15 +24962,9 @@ function ReviewFinalizeError({
25002
24962
  function ReviewPanelFooter({
25003
24963
  reviewEditor,
25004
24964
  sidebarFocused,
25005
- sidebarFooter,
25006
- livePreview,
25007
- livePreviewSpinner
24965
+ sidebarFooter
25008
24966
  }) {
25009
- return /* @__PURE__ */ jsxs32(Fragment10, { children: [
25010
- reviewEditor.panelOpen === "token-review" ? " [\u2191/\u2193] move [Enter] edit allowed [Esc] close" : sidebarFocused ? sidebarFooter : reviewEditor.showJson ? " [\u2191\u2193] 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" : ""),
25011
- livePreview.status === "running" && /* @__PURE__ */ jsx42(Text34, { children: ` ${livePreviewSpinner} live preview` }),
25012
- livePreview.disabled && /* @__PURE__ */ jsx42(Text34, { children: " \xB7 live preview disabled" })
25013
- ] });
24967
+ return /* @__PURE__ */ jsx42(Fragment10, { children: reviewEditor.panelOpen === "token-review" ? "" : sidebarFocused ? sidebarFooter : reviewEditor.showJson ? " [\u2191\u2193] scroll [Ctrl+u/d] half-page [gg/G] top/bottom [Tab] focus list" : " [Tab] focus list [Enter] edit fields" + (reviewEditor.currentTokenSuggestions().length > 0 ? " [t] review mapped tokens" : "") });
25014
24968
  }
25015
24969
  function ReviewComponentTitle({
25016
24970
  selectedKey,
@@ -25044,9 +24998,7 @@ function ReviewComponentPanel({
25044
24998
  sidebarFocused,
25045
24999
  fieldEditor,
25046
25000
  saveError,
25047
- sidebarFooter,
25048
- livePreview,
25049
- livePreviewSpinner
25001
+ sidebarFooter
25050
25002
  }) {
25051
25003
  const propCount = Object.keys(selectedEntry.$properties).length;
25052
25004
  const slotCount = selectedEntry.$slots ? Object.keys(selectedEntry.$slots).length : 0;
@@ -25083,9 +25035,7 @@ function ReviewComponentPanel({
25083
25035
  {
25084
25036
  reviewEditor,
25085
25037
  sidebarFocused,
25086
- sidebarFooter,
25087
- livePreview,
25088
- livePreviewSpinner
25038
+ sidebarFooter
25089
25039
  }
25090
25040
  ) }) })
25091
25041
  ] }) });
@@ -25629,7 +25579,7 @@ function collectTokenSuggestions(entry, availableTokens = []) {
25629
25579
  const compatiblePaths = new Set(compatible);
25630
25580
  const allowed = availableTokens.length > 0 ? persistedAllowed.filter((path5) => compatiblePaths.has(path5)) : persistedAllowed;
25631
25581
  const paths = availableTokens.length > 0 ? compatible : allowed;
25632
- return { propName, paths, suggested: [...allowed], allowed };
25582
+ return { propName, kinds, paths, suggested: [...allowed], allowed };
25633
25583
  });
25634
25584
  }
25635
25585
 
@@ -26425,7 +26375,7 @@ var HELP_SECTIONS2 = [
26425
26375
  { keys: "P", label: "Component rationale" },
26426
26376
  { keys: "s", label: "Source code snippet" },
26427
26377
  { keys: "J", label: "Toggle JSON" },
26428
- { keys: "t", label: "Token review" }
26378
+ { keys: "t", label: "Review mapped tokens" }
26429
26379
  ]
26430
26380
  },
26431
26381
  {
@@ -27573,9 +27523,7 @@ function GenerateReviewStepView({
27573
27523
  initialFocusTarget: pendingEditorFocus && pendingEditorFocus.componentName === selected.key ? pendingEditorFocus.target : { kind: "description" }
27574
27524
  }
27575
27525
  ),
27576
- saveError: reviewEditor.saveError,
27577
- livePreview: livePreviewHook,
27578
- livePreviewSpinner
27526
+ saveError: reviewEditor.saveError
27579
27527
  }
27580
27528
  ) : /* @__PURE__ */ jsx48(ReviewNoSelection, {})
27581
27529
  ] }),
@@ -27607,7 +27555,7 @@ function GenerateReviewStepView({
27607
27555
  hidden: dialogOpen
27608
27556
  }
27609
27557
  ),
27610
- !dialogOpen && sidebarFocused && /* @__PURE__ */ jsx48(CompactControlBar, { hasGroupRoots, searchActive: searchOpen || searchQuery.length > 0 })
27558
+ !dialogOpen && sidebarFocused && reviewEditor.panelOpen !== "token-review" && /* @__PURE__ */ jsx48(CompactControlBar, { hasGroupRoots, searchActive: searchOpen || searchQuery.length > 0 })
27611
27559
  ] });
27612
27560
  }
27613
27561
 
@@ -28097,12 +28045,20 @@ function diffProperty(name, old, newDef) {
28097
28045
  diffs.push({ key: `${name}-new`, color: PALETTE.success, text: `+ ${name}: ${formatPropDef(newDef)}` });
28098
28046
  return diffs;
28099
28047
  }
28048
+ function formatDefault(value) {
28049
+ const sys = value?.sys;
28050
+ if (sys?.linkType === "Contentful:DesignToken" && typeof sys.urn === "string") {
28051
+ const name = sys.urn.split("/designTokens/")[1];
28052
+ if (name) return name;
28053
+ }
28054
+ return JSON.stringify(value);
28055
+ }
28100
28056
  function formatOldProp(prop) {
28101
28057
  const parts = [];
28102
28058
  if (prop.type) parts.push(prop.type);
28103
28059
  if (prop.category) parts.push(prop.category);
28104
28060
  parts.push(prop.required ? "required" : "optional");
28105
- if (prop.default !== void 0) parts.push(`default=${JSON.stringify(prop.default)}`);
28061
+ if (prop.default !== void 0) parts.push(`default=${formatDefault(prop.default)}`);
28106
28062
  return parts.join(", ");
28107
28063
  }
28108
28064
  function formatPropDef(def) {
@@ -28111,7 +28067,7 @@ function formatPropDef(def) {
28111
28067
  if (def["$category"]) parts.push(def["$category"]);
28112
28068
  if (def["$required"] === true) parts.push("required");
28113
28069
  else parts.push("optional");
28114
- if (def["$default"] !== void 0) parts.push(`default=${JSON.stringify(def["$default"])}`);
28070
+ if (def["$default"] !== void 0) parts.push(`default=${formatDefault(def["$default"])}`);
28115
28071
  return parts.join(", ");
28116
28072
  }
28117
28073
 
package/dist/index.js CHANGED
@@ -21792,6 +21792,7 @@ function GotoBanner({
21792
21792
  borderStyle: "single",
21793
21793
  borderColor: PALETTE.accent,
21794
21794
  paddingX: 1,
21795
+ paddingBottom: 1,
21795
21796
  marginTop: width === void 0 ? 1 : 0,
21796
21797
  width,
21797
21798
  flexShrink: 0,
@@ -21803,7 +21804,7 @@ function GotoBanner({
21803
21804
  return renderRow(row, i, i === highlightIndex);
21804
21805
  }),
21805
21806
  moreBelow > 0 && /* @__PURE__ */ jsx24(Text21, { color: PALETTE.muted, children: ` \u25BC ${moreBelow} more` }),
21806
- footerHint !== void 0 && /* @__PURE__ */ jsx24(Text21, { color: PALETTE.muted, children: footerHint })
21807
+ footerHint !== void 0 && /* @__PURE__ */ jsx24(Box21, { marginTop: 1, children: /* @__PURE__ */ jsx24(Text21, { color: PALETTE.muted, children: footerHint }) })
21807
21808
  ]
21808
21809
  }
21809
21810
  );
@@ -24535,7 +24536,7 @@ function formatAcceptanceSummary(counts) {
24535
24536
  function describeGeneration(input) {
24536
24537
  const agent = capitalize(input.agent);
24537
24538
  return `${formatAcceptanceSummary({ accepted: input.acceptedCount, autoRejected: 0 })}
24538
- ${agent} is reading each selected component and writing a Contentful component definition for it${input.hasTokens ? " Using your design tokens for prop resolution." : ""}`;
24539
+ ${agent} is reading each selected component and writing a Contentful component definition for it.${input.hasTokens ? "\nUsing your design tokens for prop resolution." : ""}`;
24539
24540
  }
24540
24541
  function progressRows2(progress, agent) {
24541
24542
  const name = capitalize(agent);
@@ -26400,7 +26401,6 @@ function FieldEditor({
26400
26401
  const [rationaleOpen, setRationaleOpen] = useState19(false);
26401
26402
  const [rationaleScrollOffset, setRationaleScrollOffset] = useState19(0);
26402
26403
  const [showHelp, setShowHelp] = useState19(false);
26403
- const [pendingDelete, setPendingDelete] = useState19(null);
26404
26404
  const props = editorState.props;
26405
26405
  const slots = editorState.slots;
26406
26406
  const contentPropIndexes = React13.useMemo(
@@ -26492,46 +26492,6 @@ function FieldEditor({
26492
26492
  setEditorState(next);
26493
26493
  onChange(serializeState(next, value));
26494
26494
  };
26495
- const deleteRow = (row) => {
26496
- if (row.kind === "prop") {
26497
- const nextProps = removeAt(editorState.props, row.idx);
26498
- commit({ ...editorState, props: nextProps });
26499
- setPropIdx(Math.max(0, Math.min(row.idx, nextProps.length - 1)));
26500
- const rowsAfter2 = selectableRows.filter((r) => !(r.kind === "prop" && r.idx === row.idx));
26501
- const neighbour2 = rowsAfter2[Math.max(0, selectableRows.findIndex((r) => r.kind === row.kind && r.idx === row.idx) - 1)];
26502
- if (!neighbour2) {
26503
- setInSlots(false);
26504
- setInComponentDesc(true);
26505
- setFocusLevel("componentDescription");
26506
- } else if (neighbour2.kind === "prop") {
26507
- setInSlots(false);
26508
- setPropIdx(neighbour2.idx > row.idx ? neighbour2.idx - 1 : neighbour2.idx);
26509
- setFocusLevel("prop");
26510
- } else {
26511
- setInSlots(true);
26512
- setSlotIdx(neighbour2.idx);
26513
- setFocusLevel("slot");
26514
- }
26515
- return;
26516
- }
26517
- const nextSlots = removeAt(editorState.slots, row.idx);
26518
- commit({ ...editorState, slots: nextSlots });
26519
- const rowsAfter = selectableRows.filter((r) => !(r.kind === "slot" && r.idx === row.idx));
26520
- const neighbour = rowsAfter[Math.max(0, selectableRows.findIndex((r) => r.kind === row.kind && r.idx === row.idx) - 1)];
26521
- if (!neighbour) {
26522
- setInSlots(false);
26523
- setInComponentDesc(true);
26524
- setFocusLevel("componentDescription");
26525
- } else if (neighbour.kind === "slot") {
26526
- setInSlots(true);
26527
- setSlotIdx(neighbour.idx > row.idx ? neighbour.idx - 1 : neighbour.idx);
26528
- setFocusLevel("slot");
26529
- } else {
26530
- setInSlots(false);
26531
- setPropIdx(neighbour.idx);
26532
- setFocusLevel("prop");
26533
- }
26534
- };
26535
26495
  const canonicalize = React13.useCallback((json) => {
26536
26496
  try {
26537
26497
  return JSON.stringify(JSON.parse(json));
@@ -26568,11 +26528,6 @@ function FieldEditor({
26568
26528
  onSave();
26569
26529
  return;
26570
26530
  }
26571
- if (pendingDelete) {
26572
- if (input === "y") deleteRow(pendingDelete);
26573
- setPendingDelete(null);
26574
- return;
26575
- }
26576
26531
  const inDescriptionTextEntryForHelp = focusLevel === "field" && editingField && activeField === "description";
26577
26532
  const inStringDefaultTextEntryForHelp = focusLevel === "field" && editingField && activeField === "default" && currentProp != null && (currentProp.type === "string" || currentProp.type === "token");
26578
26533
  const inValueListTextEntry = editingValue != null;
@@ -26772,11 +26727,6 @@ function FieldEditor({
26772
26727
  }
26773
26728
  return;
26774
26729
  }
26775
- if (input === "d" && !key.ctrl && !key.meta) {
26776
- if (focusLevel === "prop" && currentProp) setPendingDelete({ kind: "prop", idx: propIdx });
26777
- if (focusLevel === "slot" && currentSlot) setPendingDelete({ kind: "slot", idx: slotIdx });
26778
- return;
26779
- }
26780
26730
  if (focusLevel === "slot" && key.return && currentSlot) {
26781
26731
  setFocusLevel("field");
26782
26732
  setActiveField(SLOT_FIELDS[0] ?? null);
@@ -27083,10 +27033,6 @@ function FieldEditor({
27083
27033
  }
27084
27034
  const hasEmptyProperties = props.length === 0 && slots.length === 0;
27085
27035
  const modeLabel = (() => {
27086
- if (pendingDelete) {
27087
- const name = pendingDelete.kind === "prop" ? props[pendingDelete.idx]?.name : slots[pendingDelete.idx]?.name;
27088
- return `Delete ${pendingDelete.kind} "${name}"? [y] delete \xB7 any other key cancels`;
27089
- }
27090
27036
  if (editingValue) {
27091
27037
  return editingValue.mode === "add" ? "Enter to add \xB7 [Esc] to cancel" : "Enter to save edit \xB7 [Esc] to cancel";
27092
27038
  }
@@ -27108,7 +27054,7 @@ function FieldEditor({
27108
27054
  if (rationaleOpen) {
27109
27055
  return "[\u2191\u2193] scroll [i/Esc] close rationale panel";
27110
27056
  }
27111
- return `[\u2191\u2193] navigate [Enter] edit fields [d] delete property [h] help [s] source [Esc] exit panel`;
27057
+ return `[\u2191\u2193] navigate [Enter] edit fields [h] help [s] source [Esc] exit panel`;
27112
27058
  })();
27113
27059
  const rows = [];
27114
27060
  rows.push({ kind: "component-description" });
@@ -27374,7 +27320,6 @@ function FieldEditor({
27374
27320
  /* @__PURE__ */ jsx32(Text27, { bold: true, children: "Row navigation" }),
27375
27321
  /* @__PURE__ */ jsx32(Text27, { children: " \u2191/\u2193 move between rows" }),
27376
27322
  /* @__PURE__ */ jsx32(Text27, { children: " Enter edit fields on the current row" }),
27377
- /* @__PURE__ */ jsx32(Text27, { children: " d delete the current prop or slot (asks to confirm)" }),
27378
27323
  /* @__PURE__ */ jsx32(Text27, { children: " Esc exit the panel" }),
27379
27324
  /* @__PURE__ */ jsx32(Text27, { children: " " }),
27380
27325
  /* @__PURE__ */ jsx32(Text27, { bold: true, children: "Field editing" }),
@@ -27398,7 +27343,7 @@ function FieldEditor({
27398
27343
  /* @__PURE__ */ jsx32(Text27, { color: PALETTE.muted, children: "press ? or Esc to close" })
27399
27344
  ] }),
27400
27345
  validationError && /* @__PURE__ */ jsx32(Text27, { color: PALETTE.error, children: "\u2717 " + validationError }),
27401
- /* @__PURE__ */ jsx32(Box26, { paddingTop: 1, children: /* @__PURE__ */ jsx32(Text27, { color: pendingDelete ? PALETTE.text : PALETTE.muted, children: modeLabel }) })
27346
+ /* @__PURE__ */ jsx32(Box26, { paddingTop: 1, children: /* @__PURE__ */ jsx32(Text27, { color: PALETTE.muted, children: modeLabel }) })
27402
27347
  ]
27403
27348
  }
27404
27349
  );
@@ -27791,8 +27736,8 @@ function TokenReviewPanel({
27791
27736
  borderStyle: "single",
27792
27737
  borderColor: active ? PALETTE.text : void 0,
27793
27738
  children: [
27794
- /* @__PURE__ */ jsx39(Text32, { bold: true, color: active ? void 0 : PALETTE.muted, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
27795
- /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
27739
+ /* @__PURE__ */ jsx39(Text32, { bold: true, color: active ? void 0 : PALETTE.muted, wrap: "truncate", children: `Review mapped tokens \u2014 ${componentName} \xB7 ${current.propName}${current.kinds.length > 0 ? ` (${current.kinds.join(", ")})` : ""}` }),
27740
+ /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, wrap: "truncate", children: `Tick the tokens this property may use (${rangeLabel}).` }),
27796
27741
  /* @__PURE__ */ jsx39(Text32, { children: " " }),
27797
27742
  current.paths.length === 0 && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "(no compatible tokens found for this token kind)" }),
27798
27743
  visiblePaths.map((path5, i) => {
@@ -27825,18 +27770,33 @@ function TokenReviewPanel({
27825
27770
  borderStyle: "single",
27826
27771
  borderColor: active ? PALETTE.text : void 0,
27827
27772
  children: [
27828
- /* @__PURE__ */ jsx39(Text32, { bold: true, color: active ? void 0 : PALETTE.muted, children: `TOKEN REVIEW \u2014 ${componentName}` }),
27773
+ /* @__PURE__ */ jsx39(Text32, { bold: true, color: active ? void 0 : PALETTE.muted, children: `Review mapped tokens \u2014 ${componentName}` }),
27774
+ /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, wrap: "truncate", children: `${componentName} has ${suggestions.length} design ${suggestions.length === 1 ? "prop" : "props"} of type token. Select which tokens are allowed for each property.` }),
27775
+ /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, wrap: "truncate", children: "Suggested tokens come from the agent. Allowed tokens are what editors can pick in Contentful." }),
27776
+ /* @__PURE__ */ jsx39(Text32, { children: " " }),
27829
27777
  suggestions.length === 0 && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "(no token suggestions for this component)" }),
27830
27778
  suggestions.map((s, i) => {
27831
27779
  const focused = i === selectedRow;
27832
27780
  return /* @__PURE__ */ jsxs30(Box31, { flexDirection: "column", children: [
27833
- /* @__PURE__ */ jsx39(Box31, { children: /* @__PURE__ */ jsx39(Text32, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures7.pointer : " "} ${s.propName}` }) }),
27834
- /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: ` suggested: ${s.suggested.join(", ")}` }),
27835
- /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: ` allowed: ${s.allowed.join(", ")}` })
27781
+ /* @__PURE__ */ jsx39(Box31, { children: /* @__PURE__ */ jsx39(Text32, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures7.pointer : " "} ${s.propName}${s.kinds.length > 0 ? ` (${s.kinds.join(", ")})` : ""}` }) }),
27782
+ /* @__PURE__ */ jsx39(
27783
+ Text32,
27784
+ {
27785
+ color: PALETTE.muted,
27786
+ children: ` suggested: ${s.suggested.length > 0 ? s.suggested.join(", ") : "none"}`
27787
+ }
27788
+ ),
27789
+ /* @__PURE__ */ jsx39(
27790
+ Text32,
27791
+ {
27792
+ color: PALETTE.muted,
27793
+ children: ` allowed: ${s.allowed.length > 0 ? s.allowed.join(", ") : "none (any token)"}`
27794
+ }
27795
+ ),
27796
+ /* @__PURE__ */ jsx39(Text32, { children: " " })
27836
27797
  ] }, s.propName);
27837
27798
  }),
27838
- /* @__PURE__ */ jsx39(Text32, { children: " " }),
27839
- /* @__PURE__ */ jsx39(Text32, { children: "[\u2191/\u2193] move [Enter] edit allowed [Esc] close" })
27799
+ /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "[\u2191/\u2193] move [Enter] edit allowed tokens [Esc] close" })
27840
27800
  ]
27841
27801
  }
27842
27802
  );
@@ -28110,15 +28070,9 @@ function ReviewFinalizeError({
28110
28070
  function ReviewPanelFooter({
28111
28071
  reviewEditor,
28112
28072
  sidebarFocused,
28113
- sidebarFooter,
28114
- livePreview,
28115
- livePreviewSpinner
28073
+ sidebarFooter
28116
28074
  }) {
28117
- return /* @__PURE__ */ jsxs32(Fragment10, { children: [
28118
- reviewEditor.panelOpen === "token-review" ? " [\u2191/\u2193] move [Enter] edit allowed [Esc] close" : sidebarFocused ? sidebarFooter : reviewEditor.showJson ? " [\u2191\u2193] 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" : ""),
28119
- livePreview.status === "running" && /* @__PURE__ */ jsx42(Text34, { children: ` ${livePreviewSpinner} live preview` }),
28120
- livePreview.disabled && /* @__PURE__ */ jsx42(Text34, { children: " \xB7 live preview disabled" })
28121
- ] });
28075
+ return /* @__PURE__ */ jsx42(Fragment10, { children: reviewEditor.panelOpen === "token-review" ? "" : sidebarFocused ? sidebarFooter : reviewEditor.showJson ? " [\u2191\u2193] scroll [Ctrl+u/d] half-page [gg/G] top/bottom [Tab] focus list" : " [Tab] focus list [Enter] edit fields" + (reviewEditor.currentTokenSuggestions().length > 0 ? " [t] review mapped tokens" : "") });
28122
28076
  }
28123
28077
  function ReviewComponentTitle({
28124
28078
  selectedKey,
@@ -28152,9 +28106,7 @@ function ReviewComponentPanel({
28152
28106
  sidebarFocused,
28153
28107
  fieldEditor,
28154
28108
  saveError,
28155
- sidebarFooter,
28156
- livePreview,
28157
- livePreviewSpinner
28109
+ sidebarFooter
28158
28110
  }) {
28159
28111
  const propCount = Object.keys(selectedEntry.$properties).length;
28160
28112
  const slotCount = selectedEntry.$slots ? Object.keys(selectedEntry.$slots).length : 0;
@@ -28191,9 +28143,7 @@ function ReviewComponentPanel({
28191
28143
  {
28192
28144
  reviewEditor,
28193
28145
  sidebarFocused,
28194
- sidebarFooter,
28195
- livePreview,
28196
- livePreviewSpinner
28146
+ sidebarFooter
28197
28147
  }
28198
28148
  ) }) })
28199
28149
  ] }) });
@@ -28795,7 +28745,7 @@ function collectTokenSuggestions(entry, availableTokens = []) {
28795
28745
  const compatiblePaths = new Set(compatible);
28796
28746
  const allowed = availableTokens.length > 0 ? persistedAllowed.filter((path5) => compatiblePaths.has(path5)) : persistedAllowed;
28797
28747
  const paths = availableTokens.length > 0 ? compatible : allowed;
28798
- return { propName, paths, suggested: [...allowed], allowed };
28748
+ return { propName, kinds, paths, suggested: [...allowed], allowed };
28799
28749
  });
28800
28750
  }
28801
28751
  var init_token_suggestions = __esm({
@@ -30746,9 +30696,7 @@ function GenerateReviewStepView({
30746
30696
  initialFocusTarget: pendingEditorFocus && pendingEditorFocus.componentName === selected.key ? pendingEditorFocus.target : { kind: "description" }
30747
30697
  }
30748
30698
  ),
30749
- saveError: reviewEditor.saveError,
30750
- livePreview: livePreviewHook,
30751
- livePreviewSpinner
30699
+ saveError: reviewEditor.saveError
30752
30700
  }
30753
30701
  ) : /* @__PURE__ */ jsx48(ReviewNoSelection, {})
30754
30702
  ] }),
@@ -30780,7 +30728,7 @@ function GenerateReviewStepView({
30780
30728
  hidden: dialogOpen
30781
30729
  }
30782
30730
  ),
30783
- !dialogOpen && sidebarFocused && /* @__PURE__ */ jsx48(CompactControlBar, { hasGroupRoots, searchActive: searchOpen || searchQuery.length > 0 })
30731
+ !dialogOpen && sidebarFocused && reviewEditor.panelOpen !== "token-review" && /* @__PURE__ */ jsx48(CompactControlBar, { hasGroupRoots, searchActive: searchOpen || searchQuery.length > 0 })
30784
30732
  ] });
30785
30733
  }
30786
30734
  var HELP_SECTIONS2;
@@ -30862,7 +30810,7 @@ var init_generate_review_step = __esm({
30862
30810
  { keys: "P", label: "Component rationale" },
30863
30811
  { keys: "s", label: "Source code snippet" },
30864
30812
  { keys: "J", label: "Toggle JSON" },
30865
- { keys: "t", label: "Token review" }
30813
+ { keys: "t", label: "Review mapped tokens" }
30866
30814
  ]
30867
30815
  },
30868
30816
  {
@@ -31441,12 +31389,20 @@ function diffProperty(name, old, newDef) {
31441
31389
  diffs.push({ key: `${name}-new`, color: PALETTE.success, text: `+ ${name}: ${formatPropDef(newDef)}` });
31442
31390
  return diffs;
31443
31391
  }
31392
+ function formatDefault(value) {
31393
+ const sys = value?.sys;
31394
+ if (sys?.linkType === "Contentful:DesignToken" && typeof sys.urn === "string") {
31395
+ const name = sys.urn.split("/designTokens/")[1];
31396
+ if (name) return name;
31397
+ }
31398
+ return JSON.stringify(value);
31399
+ }
31444
31400
  function formatOldProp(prop) {
31445
31401
  const parts = [];
31446
31402
  if (prop.type) parts.push(prop.type);
31447
31403
  if (prop.category) parts.push(prop.category);
31448
31404
  parts.push(prop.required ? "required" : "optional");
31449
- if (prop.default !== void 0) parts.push(`default=${JSON.stringify(prop.default)}`);
31405
+ if (prop.default !== void 0) parts.push(`default=${formatDefault(prop.default)}`);
31450
31406
  return parts.join(", ");
31451
31407
  }
31452
31408
  function formatPropDef(def) {
@@ -31455,7 +31411,7 @@ function formatPropDef(def) {
31455
31411
  if (def["$category"]) parts.push(def["$category"]);
31456
31412
  if (def["$required"] === true) parts.push("required");
31457
31413
  else parts.push("optional");
31458
- if (def["$default"] !== void 0) parts.push(`default=${JSON.stringify(def["$default"])}`);
31414
+ if (def["$default"] !== void 0) parts.push(`default=${formatDefault(def["$default"])}`);
31459
31415
  return parts.join(", ");
31460
31416
  }
31461
31417
  var init_preview_diff = __esm({
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.38.1-dev-build-db0347a4.0",
3
+ "version": "2.38.1-dev-build-dda16770.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
3
3
  import type { CdfReviewEntry } from '../types.js';
4
4
  import type { UseReviewEditorResult } from '../use-review-editor.js';
5
- import type { UseLivePreviewReturn } from '../use-live-preview.js';
6
5
  import { type ReviewDetailsEditorProps } from './ReviewDetailsEditor.js';
7
6
  type ReviewDetailsEditorConfig = Pick<ReviewDetailsEditorProps, 'componentRationale' | 'reviewMetadata' | 'reviewEditor' | 'width' | 'height' | 'sourceBorderColor' | 'jsonValue' | 'sidebarFocused' | 'fieldEditor'>;
8
7
  export type ReviewComponentPanelProps = ReviewDetailsEditorConfig & {
@@ -10,8 +9,6 @@ export type ReviewComponentPanelProps = ReviewDetailsEditorConfig & {
10
9
  selectedEntry: CDFComponentEntry;
11
10
  saveError: string | null;
12
11
  sidebarFooter?: React.ReactNode;
13
- livePreview: Pick<UseLivePreviewReturn, 'status' | 'disabled'>;
14
- livePreviewSpinner: string;
15
12
  };
16
13
  type ReviewFieldEditor = ReviewDetailsEditorProps['fieldEditor'];
17
14
  export declare function buildReviewFieldEditor(reviewEditor: UseReviewEditorResult, selectedJson: string, onExit: () => void, overrides?: Partial<ReviewFieldEditor>): ReviewFieldEditor;
@@ -29,5 +26,5 @@ export declare function ReviewFinalizeError({ message, hidden, }: {
29
26
  message: string | null;
30
27
  hidden: boolean;
31
28
  }): React.ReactElement | null;
32
- export declare function ReviewComponentPanel({ selectedKey, selectedEntry, componentRationale, reviewMetadata, reviewEditor, width, height, sourceBorderColor, jsonValue, sidebarFocused, fieldEditor, saveError, sidebarFooter, livePreview, livePreviewSpinner, }: ReviewComponentPanelProps): React.ReactElement;
29
+ export declare function ReviewComponentPanel({ selectedKey, selectedEntry, componentRationale, reviewMetadata, reviewEditor, width, height, sourceBorderColor, jsonValue, sidebarFocused, fieldEditor, saveError, sidebarFooter, }: ReviewComponentPanelProps): React.ReactElement;
33
30
  export {};
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  export type TokenPropSuggestion = {
3
3
  propName: string;
4
+ kinds: string[];
4
5
  paths: string[];
5
6
  suggested: string[];
6
7
  allowed: string[];
@@ -12,6 +12,7 @@ export type TokenReviewToken = {
12
12
  };
13
13
  export type TokenPropSuggestion = {
14
14
  propName: string;
15
+ kinds: string[];
15
16
  paths: string[];
16
17
  suggested: string[];
17
18
  allowed: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.38.1-dev-build-db0347a4.0",
3
+ "version": "2.38.1-dev-build-dda16770.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,8 +45,8 @@
45
45
  "ts-morph": "^27.0.2",
46
46
  "typescript": "^5.9.3",
47
47
  "zod": "^4.6.5",
48
- "@contentful/experience-design-system-types": "2.38.1-dev-build-db0347a4.0",
49
- "@contentful/experience-design-system-backend-pipeline": "2.38.1-dev-build-db0347a4.0"
48
+ "@contentful/experience-design-system-backend-pipeline": "2.38.1-dev-build-dda16770.0",
49
+ "@contentful/experience-design-system-types": "2.38.1-dev-build-dda16770.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@tsconfig/node24": "^24.0.4",