@contentful/experience-design-system-cli 2.26.7-dev-build-8206e92.0 → 2.26.7-dev-build-f5a509c.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-f5a509c.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -37,6 +37,8 @@ type FieldEditorProps = {
37
37
  kind: 'prop' | 'slot';
38
38
  name: string;
39
39
  };
40
+ /** Hide non-importable property categories from the form without removing them from its saved state. */
41
+ showHiddenProps?: boolean;
40
42
  };
41
43
  export declare function simulateGraphWithCandidate(projectSlotGraph: ComponentSlotInfo[], selfName: string, currentSlots: {
42
44
  name: string;
@@ -55,5 +57,5 @@ export declare function computeAllowedComponentReplacementCandidates(projectSlot
55
57
  name: string;
56
58
  allowedComponents: string[];
57
59
  }[], 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;
60
+ 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
61
  export {};
package/dist/src/index.js CHANGED
@@ -22000,7 +22000,8 @@ function FieldEditor({
22000
22000
  currentComponentName,
22001
22001
  onDirtyChange,
22002
22002
  discardTrigger,
22003
- initialFocusTarget
22003
+ initialFocusTarget,
22004
+ showHiddenProps = true
22004
22005
  }) {
22005
22006
  const { state: initialState, error: parseError } = parseToState(value);
22006
22007
  const [editorState, setEditorState] = useState23(initialState);
@@ -22081,12 +22082,34 @@ function FieldEditor({
22081
22082
  const [showHelp, setShowHelp] = useState23(false);
22082
22083
  const props = editorState.props;
22083
22084
  const slots = editorState.slots;
22085
+ const visiblePropIndexes = React23.useMemo(
22086
+ () => props.flatMap(
22087
+ (prop, index) => showHiddenProps || prop.category !== "state" && prop.category !== "unattached" ? [index] : []
22088
+ ),
22089
+ [props, showHiddenProps]
22090
+ );
22091
+ const visiblePropPosition = visiblePropIndexes.indexOf(propIdx);
22084
22092
  const textEntryActive = focusLevel === "field" && activeField === "description" || focusLevel === "field" && activeField === "default" && (editorState.props[propIdx]?.type === "string" || editorState.props[propIdx]?.type === "token") || editingValue != null;
22085
22093
  React23.useEffect(() => {
22086
22094
  onTextEntryActiveChange?.(textEntryActive);
22087
22095
  }, [textEntryActive, onTextEntryActiveChange]);
22088
22096
  const currentProp = props[propIdx] ?? null;
22089
22097
  const currentSlot = slots[slotIdx] ?? null;
22098
+ React23.useEffect(() => {
22099
+ if (showHiddenProps || inSlots || inComponentDesc || visiblePropPosition >= 0) return;
22100
+ if (visiblePropIndexes.length > 0) {
22101
+ setPropIdx(visiblePropIndexes[0]);
22102
+ return;
22103
+ }
22104
+ if (slots.length > 0) {
22105
+ setInSlots(true);
22106
+ setSlotIdx(0);
22107
+ setFocusLevel("slot");
22108
+ return;
22109
+ }
22110
+ setInComponentDesc(true);
22111
+ setFocusLevel("componentDescription");
22112
+ }, [inComponentDesc, inSlots, showHiddenProps, slots.length, visiblePropIndexes, visiblePropPosition]);
22090
22113
  const commit = (next) => {
22091
22114
  setEditorState(next);
22092
22115
  onChange(serializeState(next, value));
@@ -22288,8 +22311,8 @@ function FieldEditor({
22288
22311
  }
22289
22312
  if (focusLevel === "prop") {
22290
22313
  if (key.upArrow || input === "k") {
22291
- if (propIdx > 0) {
22292
- setPropIdx(propIdx - 1);
22314
+ if (visiblePropPosition > 0) {
22315
+ setPropIdx(visiblePropIndexes[visiblePropPosition - 1]);
22293
22316
  } else {
22294
22317
  setFocusLevel("componentDescription");
22295
22318
  setInSlots(false);
@@ -22298,8 +22321,8 @@ function FieldEditor({
22298
22321
  return;
22299
22322
  }
22300
22323
  if (key.downArrow || input === "j") {
22301
- if (propIdx < props.length - 1) {
22302
- setPropIdx(propIdx + 1);
22324
+ if (visiblePropPosition >= 0 && visiblePropPosition < visiblePropIndexes.length - 1) {
22325
+ setPropIdx(visiblePropIndexes[visiblePropPosition + 1]);
22303
22326
  } else if (slots.length > 0) {
22304
22327
  setInSlots(true);
22305
22328
  setSlotIdx(0);
@@ -22320,9 +22343,9 @@ function FieldEditor({
22320
22343
  return;
22321
22344
  }
22322
22345
  if (key.downArrow || input === "j") {
22323
- if (props.length > 0) {
22346
+ if (visiblePropIndexes.length > 0) {
22324
22347
  setFocusLevel("prop");
22325
- setPropIdx(0);
22348
+ setPropIdx(visiblePropIndexes[0]);
22326
22349
  setInSlots(false);
22327
22350
  setInComponentDesc(false);
22328
22351
  } else if (slots.length > 0) {
@@ -22345,9 +22368,9 @@ function FieldEditor({
22345
22368
  if (key.upArrow || input === "k") {
22346
22369
  if (slotIdx > 0) {
22347
22370
  setSlotIdx(slotIdx - 1);
22348
- } else if (props.length > 0) {
22371
+ } else if (visiblePropIndexes.length > 0) {
22349
22372
  setInSlots(false);
22350
- setPropIdx(props.length - 1);
22373
+ setPropIdx(visiblePropIndexes[visiblePropIndexes.length - 1]);
22351
22374
  setFocusLevel("prop");
22352
22375
  }
22353
22376
  return;
@@ -22692,9 +22715,9 @@ function FieldEditor({
22692
22715
  })();
22693
22716
  const rows = [];
22694
22717
  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 }));
22718
+ if (visiblePropIndexes.length > 0) {
22719
+ rows.push({ kind: "header", label: `\u2500\u2500 PROPERTIES (${visiblePropIndexes.length}) `, section: "properties" });
22720
+ visiblePropIndexes.forEach((idx) => rows.push({ kind: "prop", idx }));
22698
22721
  }
22699
22722
  if (slots.length > 0) {
22700
22723
  rows.push({ kind: "header", label: `\u2500\u2500 SLOTS (${slots.length}) `, section: "slots" });
@@ -25211,6 +25234,7 @@ function GenerateReviewStep({
25211
25234
  FieldEditor,
25212
25235
  {
25213
25236
  value: draftValue || selectedJson,
25237
+ showHiddenProps,
25214
25238
  width: panelWidth,
25215
25239
  height: PANEL_HEIGHT,
25216
25240
  active: !sidebarFocused,
@@ -26120,6 +26144,7 @@ function AtomicGenerateReviewStep({
26120
26144
  FieldEditor,
26121
26145
  {
26122
26146
  value: draftValue || selectedJson,
26147
+ showHiddenProps,
26123
26148
  width: panelWidth,
26124
26149
  height: PANEL_HEIGHT2,
26125
26150
  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-f5a509c.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-f5a509c.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-f5a509c.0",
55
+ "@contentful/experience-design-system-generation": "2.26.7-dev-build-f5a509c.0",
56
+ "@contentful/experience-design-system-client": "2.26.7-dev-build-f5a509c.0"
57
57
  },
58
58
  "repository": {
59
59
  "type": "git",