@contentful/experience-design-system-cli 2.26.7-dev-build-8206e92.0 → 2.26.7-dev-build-cdb420a.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.26.7-dev-build-8206e92.0",
3
+ "version": "2.26.7-dev-build-cdb420a.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -37,6 +37,7 @@ type FieldEditorProps = {
37
37
  kind: 'prop' | 'slot';
38
38
  name: string;
39
39
  };
40
+ showHiddenProps?: boolean;
40
41
  };
41
42
  export declare function simulateGraphWithCandidate(projectSlotGraph: ComponentSlotInfo[], selfName: string, currentSlots: {
42
43
  name: string;
@@ -55,5 +56,5 @@ export declare function computeAllowedComponentReplacementCandidates(projectSlot
55
56
  name: string;
56
57
  allowedComponents: string[];
57
58
  }[], targetSlotName: string, replaceIndex: number): string[];
58
- export declare function FieldEditor({ value, width, height, active, onChange, onSave, onDiscard, onExit, metadata, onTogglePropRationale, propRationaleKey, onToggleComponentRationale, componentRationaleKey, onToggleSourceExternal, onTextEntryActiveChange, projectSlotGraph, currentComponentName, onDirtyChange, discardTrigger, initialFocusTarget, }: FieldEditorProps): React.ReactElement;
59
+ export declare function FieldEditor({ value, width, height, active, onChange, onSave, onDiscard, onExit, metadata, onTogglePropRationale, propRationaleKey, onToggleComponentRationale, componentRationaleKey, onToggleSourceExternal, onTextEntryActiveChange, projectSlotGraph, currentComponentName, onDirtyChange, discardTrigger, initialFocusTarget, showHiddenProps, }: FieldEditorProps): React.ReactElement;
59
60
  export {};
@@ -3,11 +3,5 @@ type ReviewJsonComponent = {
3
3
  key: string;
4
4
  entry: CDFComponentEntry;
5
5
  };
6
- /**
7
- * Builds the exact JSON string rendered by the read-only review panel.
8
- *
9
- * The FieldEditor intentionally continues to use the unfiltered component
10
- * definition so toggling the panel never changes what an operator can save.
11
- */
12
6
  export declare function getReviewJsonPanelValue(selected: ReviewJsonComponent | null, showHiddenProps: boolean): string;
13
7
  export {};
package/dist/src/index.js CHANGED
@@ -8596,9 +8596,6 @@ function applyDbMigrations(db) {
8596
8596
  ALTER TABLE raw_props__new RENAME TO raw_props;
8597
8597
  CREATE INDEX IF NOT EXISTS idx_raw_props_session ON raw_props(session_id, component_id);
8598
8598
 
8599
- -- Rows written by a pre-migration exclude_prop still say cdf_type = 'excluded'
8600
- -- with cdf_category = NULL. Backfill them into the new unattached shape so an
8601
- -- in-flight local session doesn't end up with an unprintable half-migrated row.
8602
8599
  UPDATE raw_props
8603
8600
  SET cdf_category = 'unattached',
8604
8601
  cdf_type = CASE WHEN type = 'boolean' THEN 'boolean' ELSE 'string' END,
@@ -22000,7 +21997,8 @@ function FieldEditor({
22000
21997
  currentComponentName,
22001
21998
  onDirtyChange,
22002
21999
  discardTrigger,
22003
- initialFocusTarget
22000
+ initialFocusTarget,
22001
+ showHiddenProps = true
22004
22002
  }) {
22005
22003
  const { state: initialState, error: parseError } = parseToState(value);
22006
22004
  const [editorState, setEditorState] = useState23(initialState);
@@ -22081,12 +22079,34 @@ function FieldEditor({
22081
22079
  const [showHelp, setShowHelp] = useState23(false);
22082
22080
  const props = editorState.props;
22083
22081
  const slots = editorState.slots;
22082
+ const visiblePropIndexes = React23.useMemo(
22083
+ () => props.flatMap(
22084
+ (prop, index) => showHiddenProps || prop.category !== "state" && prop.category !== "unattached" ? [index] : []
22085
+ ),
22086
+ [props, showHiddenProps]
22087
+ );
22088
+ const visiblePropPosition = visiblePropIndexes.indexOf(propIdx);
22084
22089
  const textEntryActive = focusLevel === "field" && activeField === "description" || focusLevel === "field" && activeField === "default" && (editorState.props[propIdx]?.type === "string" || editorState.props[propIdx]?.type === "token") || editingValue != null;
22085
22090
  React23.useEffect(() => {
22086
22091
  onTextEntryActiveChange?.(textEntryActive);
22087
22092
  }, [textEntryActive, onTextEntryActiveChange]);
22088
22093
  const currentProp = props[propIdx] ?? null;
22089
22094
  const currentSlot = slots[slotIdx] ?? null;
22095
+ React23.useEffect(() => {
22096
+ if (showHiddenProps || inSlots || inComponentDesc || visiblePropPosition >= 0) return;
22097
+ if (visiblePropIndexes.length > 0) {
22098
+ setPropIdx(visiblePropIndexes[0]);
22099
+ return;
22100
+ }
22101
+ if (slots.length > 0) {
22102
+ setInSlots(true);
22103
+ setSlotIdx(0);
22104
+ setFocusLevel("slot");
22105
+ return;
22106
+ }
22107
+ setInComponentDesc(true);
22108
+ setFocusLevel("componentDescription");
22109
+ }, [inComponentDesc, inSlots, showHiddenProps, slots.length, visiblePropIndexes, visiblePropPosition]);
22090
22110
  const commit = (next) => {
22091
22111
  setEditorState(next);
22092
22112
  onChange(serializeState(next, value));
@@ -22288,8 +22308,8 @@ function FieldEditor({
22288
22308
  }
22289
22309
  if (focusLevel === "prop") {
22290
22310
  if (key.upArrow || input === "k") {
22291
- if (propIdx > 0) {
22292
- setPropIdx(propIdx - 1);
22311
+ if (visiblePropPosition > 0) {
22312
+ setPropIdx(visiblePropIndexes[visiblePropPosition - 1]);
22293
22313
  } else {
22294
22314
  setFocusLevel("componentDescription");
22295
22315
  setInSlots(false);
@@ -22298,8 +22318,8 @@ function FieldEditor({
22298
22318
  return;
22299
22319
  }
22300
22320
  if (key.downArrow || input === "j") {
22301
- if (propIdx < props.length - 1) {
22302
- setPropIdx(propIdx + 1);
22321
+ if (visiblePropPosition >= 0 && visiblePropPosition < visiblePropIndexes.length - 1) {
22322
+ setPropIdx(visiblePropIndexes[visiblePropPosition + 1]);
22303
22323
  } else if (slots.length > 0) {
22304
22324
  setInSlots(true);
22305
22325
  setSlotIdx(0);
@@ -22320,9 +22340,9 @@ function FieldEditor({
22320
22340
  return;
22321
22341
  }
22322
22342
  if (key.downArrow || input === "j") {
22323
- if (props.length > 0) {
22343
+ if (visiblePropIndexes.length > 0) {
22324
22344
  setFocusLevel("prop");
22325
- setPropIdx(0);
22345
+ setPropIdx(visiblePropIndexes[0]);
22326
22346
  setInSlots(false);
22327
22347
  setInComponentDesc(false);
22328
22348
  } else if (slots.length > 0) {
@@ -22345,9 +22365,9 @@ function FieldEditor({
22345
22365
  if (key.upArrow || input === "k") {
22346
22366
  if (slotIdx > 0) {
22347
22367
  setSlotIdx(slotIdx - 1);
22348
- } else if (props.length > 0) {
22368
+ } else if (visiblePropIndexes.length > 0) {
22349
22369
  setInSlots(false);
22350
- setPropIdx(props.length - 1);
22370
+ setPropIdx(visiblePropIndexes[visiblePropIndexes.length - 1]);
22351
22371
  setFocusLevel("prop");
22352
22372
  }
22353
22373
  return;
@@ -22692,9 +22712,9 @@ function FieldEditor({
22692
22712
  })();
22693
22713
  const rows = [];
22694
22714
  rows.push({ kind: "component-description" });
22695
- if (props.length > 0) {
22696
- rows.push({ kind: "header", label: `\u2500\u2500 PROPERTIES (${props.length}) `, section: "properties" });
22697
- props.forEach((_, i) => rows.push({ kind: "prop", idx: i }));
22715
+ if (visiblePropIndexes.length > 0) {
22716
+ rows.push({ kind: "header", label: `\u2500\u2500 PROPERTIES (${visiblePropIndexes.length}) `, section: "properties" });
22717
+ visiblePropIndexes.forEach((idx) => rows.push({ kind: "prop", idx }));
22698
22718
  }
22699
22719
  if (slots.length > 0) {
22700
22720
  rows.push({ kind: "header", label: `\u2500\u2500 SLOTS (${slots.length}) `, section: "slots" });
@@ -25211,6 +25231,7 @@ function GenerateReviewStep({
25211
25231
  FieldEditor,
25212
25232
  {
25213
25233
  value: draftValue || selectedJson,
25234
+ showHiddenProps,
25214
25235
  width: panelWidth,
25215
25236
  height: PANEL_HEIGHT,
25216
25237
  active: !sidebarFocused,
@@ -26120,6 +26141,7 @@ function AtomicGenerateReviewStep({
26120
26141
  FieldEditor,
26121
26142
  {
26122
26143
  value: draftValue || selectedJson,
26144
+ showHiddenProps,
26123
26145
  width: panelWidth,
26124
26146
  height: PANEL_HEIGHT2,
26125
26147
  active: !sidebarFocused,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.26.7-dev-build-8206e92.0",
3
+ "version": "2.26.7-dev-build-cdb420a.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  "svelte": "^5.56.4",
40
40
  "ts-morph": "^27.0.2",
41
41
  "typescript": "^5.9.3",
42
- "@contentful/experience-design-system-types": "2.26.7-dev-build-8206e92.0"
42
+ "@contentful/experience-design-system-types": "2.26.7-dev-build-cdb420a.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@tsconfig/node24": "^24.0.4",
@@ -51,9 +51,9 @@
51
51
  "ink-testing-library": "^4.0.0",
52
52
  "typescript-eslint": "^8.67.0",
53
53
  "vitest": "^4.0.16",
54
- "@contentful/experience-design-system-client": "2.26.7-dev-build-8206e92.0",
55
- "@contentful/experience-design-system-extraction": "2.26.7-dev-build-8206e92.0",
56
- "@contentful/experience-design-system-generation": "2.26.7-dev-build-8206e92.0"
54
+ "@contentful/experience-design-system-extraction": "2.26.7-dev-build-cdb420a.0",
55
+ "@contentful/experience-design-system-generation": "2.26.7-dev-build-cdb420a.0",
56
+ "@contentful/experience-design-system-client": "2.26.7-dev-build-cdb420a.0"
57
57
  },
58
58
  "repository": {
59
59
  "type": "git",