@contentful/experience-design-system-cli 2.27.1-dev-build-5821de5.0 → 2.27.1-dev-build-16b0c21.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 +2 -2
- package/dist/src/index.js +89 -59
- package/package.json +6 -6
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.27.1-dev-build-
|
|
3
|
+
"version": "2.27.1-dev-build-16b0c21.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@contentful/experience-design-system-types": "workspace:*",
|
|
42
|
-
"@segment/analytics-node": "^3.
|
|
42
|
+
"@segment/analytics-node": "^3.0.0",
|
|
43
43
|
"@vue/compiler-sfc": "^3.5.31",
|
|
44
44
|
"commander": "^13.1.0",
|
|
45
45
|
"ink": "^4.4.1",
|
package/dist/src/index.js
CHANGED
|
@@ -21755,8 +21755,7 @@ function PropRow({
|
|
|
21755
21755
|
] }),
|
|
21756
21756
|
/* @__PURE__ */ jsx44(Text43, { dimColor: !selected, children: "type:" }),
|
|
21757
21757
|
activeField === "type" ? /* @__PURE__ */ jsx44(Picker, { value: prop.type, active: true }) : /* @__PURE__ */ jsx44(Text43, { color: selected ? PALETTE.warning : PALETTE.inverse, children: prop.type }),
|
|
21758
|
-
/* @__PURE__ */ jsx44(
|
|
21759
|
-
activeField === "category" ? /* @__PURE__ */ jsx44(Picker, { value: prop.category, active: true }) : /* @__PURE__ */ jsx44(Text43, { color: selected ? PALETTE.info : PALETTE.inverse, children: prop.category }),
|
|
21758
|
+
activeField === "category" && /* @__PURE__ */ jsx44(Picker, { value: prop.category, active: true }),
|
|
21760
21759
|
/* @__PURE__ */ jsx44(Text43, { dimColor: !selected, children: "req:" }),
|
|
21761
21760
|
activeField === "required" ? /* @__PURE__ */ jsx44(Toggle, { value: prop.required, active: true }) : /* @__PURE__ */ jsx44(Toggle, { value: prop.required, active: false }),
|
|
21762
21761
|
prop.type === "token" && /* @__PURE__ */ jsxs43(Fragment12, { children: [
|
|
@@ -22089,13 +22088,58 @@ function FieldEditor({
|
|
|
22089
22088
|
const [showHelp, setShowHelp] = useState23(false);
|
|
22090
22089
|
const props = editorState.props;
|
|
22091
22090
|
const slots = editorState.slots;
|
|
22092
|
-
const
|
|
22093
|
-
() => props.flatMap(
|
|
22094
|
-
|
|
22095
|
-
|
|
22091
|
+
const contentPropIndexes = React23.useMemo(
|
|
22092
|
+
() => props.flatMap((prop, index) => prop.category === "content" ? [index] : []),
|
|
22093
|
+
[props]
|
|
22094
|
+
);
|
|
22095
|
+
const designPropIndexes = React23.useMemo(
|
|
22096
|
+
() => props.flatMap((prop, index) => prop.category === "design" ? [index] : []),
|
|
22097
|
+
[props]
|
|
22098
|
+
);
|
|
22099
|
+
const hiddenPropIndexes = React23.useMemo(
|
|
22100
|
+
() => showHiddenProps ? props.flatMap((prop, index) => prop.category === "state" || prop.category === "unattached" ? [index] : []) : [],
|
|
22096
22101
|
[props, showHiddenProps]
|
|
22097
22102
|
);
|
|
22103
|
+
const visiblePropIndexes = React23.useMemo(
|
|
22104
|
+
() => [...contentPropIndexes, ...designPropIndexes, ...hiddenPropIndexes],
|
|
22105
|
+
[contentPropIndexes, designPropIndexes, hiddenPropIndexes]
|
|
22106
|
+
);
|
|
22107
|
+
const propGroups = React23.useMemo(
|
|
22108
|
+
() => [
|
|
22109
|
+
{ kind: "content", label: "\u2500\u2500 CONTENT", indexes: contentPropIndexes },
|
|
22110
|
+
{ kind: "design", label: "\u2500\u2500 DESIGN", indexes: designPropIndexes },
|
|
22111
|
+
{ kind: "hidden", label: "\u2500\u2500 OTHER / HIDDEN", indexes: hiddenPropIndexes }
|
|
22112
|
+
],
|
|
22113
|
+
[contentPropIndexes, designPropIndexes, hiddenPropIndexes]
|
|
22114
|
+
);
|
|
22115
|
+
const selectableRows = React23.useMemo(
|
|
22116
|
+
() => [
|
|
22117
|
+
...contentPropIndexes.map((idx) => ({ kind: "prop", idx })),
|
|
22118
|
+
...designPropIndexes.map((idx) => ({ kind: "prop", idx })),
|
|
22119
|
+
...slots.map((_, idx) => ({ kind: "slot", idx })),
|
|
22120
|
+
...hiddenPropIndexes.map((idx) => ({ kind: "prop", idx }))
|
|
22121
|
+
],
|
|
22122
|
+
[contentPropIndexes, designPropIndexes, hiddenPropIndexes, slots]
|
|
22123
|
+
);
|
|
22098
22124
|
const visiblePropPosition = visiblePropIndexes.indexOf(propIdx);
|
|
22125
|
+
const selectedSelectableIndex = React23.useMemo(
|
|
22126
|
+
() => selectableRows.findIndex(
|
|
22127
|
+
(row) => inSlots ? row.kind === "slot" && row.idx === slotIdx : row.kind === "prop" && row.idx === propIdx
|
|
22128
|
+
),
|
|
22129
|
+
[inSlots, propIdx, selectableRows, slotIdx]
|
|
22130
|
+
);
|
|
22131
|
+
const focusSelectableRow = (row) => {
|
|
22132
|
+
setInComponentDesc(false);
|
|
22133
|
+
if (row.kind === "prop") {
|
|
22134
|
+
setInSlots(false);
|
|
22135
|
+
setPropIdx(row.idx);
|
|
22136
|
+
setFocusLevel("prop");
|
|
22137
|
+
} else {
|
|
22138
|
+
setInSlots(true);
|
|
22139
|
+
setSlotIdx(row.idx);
|
|
22140
|
+
setFocusLevel("slot");
|
|
22141
|
+
}
|
|
22142
|
+
};
|
|
22099
22143
|
const textEntryActive = focusLevel === "field" && activeField === "description" || focusLevel === "field" && activeField === "default" && (editorState.props[propIdx]?.type === "string" || editorState.props[propIdx]?.type === "token") || editingValue != null;
|
|
22100
22144
|
React23.useEffect(() => {
|
|
22101
22145
|
onTextEntryActiveChange?.(textEntryActive);
|
|
@@ -22316,51 +22360,13 @@ function FieldEditor({
|
|
|
22316
22360
|
}
|
|
22317
22361
|
return;
|
|
22318
22362
|
}
|
|
22319
|
-
if (focusLevel === "prop") {
|
|
22320
|
-
if (key.upArrow || input === "k") {
|
|
22321
|
-
if (visiblePropPosition > 0) {
|
|
22322
|
-
setPropIdx(visiblePropIndexes[visiblePropPosition - 1]);
|
|
22323
|
-
} else {
|
|
22324
|
-
setFocusLevel("componentDescription");
|
|
22325
|
-
setInSlots(false);
|
|
22326
|
-
setInComponentDesc(true);
|
|
22327
|
-
}
|
|
22328
|
-
return;
|
|
22329
|
-
}
|
|
22330
|
-
if (key.downArrow || input === "j") {
|
|
22331
|
-
if (visiblePropPosition >= 0 && visiblePropPosition < visiblePropIndexes.length - 1) {
|
|
22332
|
-
setPropIdx(visiblePropIndexes[visiblePropPosition + 1]);
|
|
22333
|
-
} else if (slots.length > 0) {
|
|
22334
|
-
setInSlots(true);
|
|
22335
|
-
setSlotIdx(0);
|
|
22336
|
-
setFocusLevel("slot");
|
|
22337
|
-
}
|
|
22338
|
-
return;
|
|
22339
|
-
}
|
|
22340
|
-
if (key.return && currentProp) {
|
|
22341
|
-
setFocusLevel("field");
|
|
22342
|
-
setActiveField(propFields(currentProp)[0] ?? null);
|
|
22343
|
-
setTextCursor(currentProp.description.length);
|
|
22344
|
-
return;
|
|
22345
|
-
}
|
|
22346
|
-
return;
|
|
22347
|
-
}
|
|
22348
22363
|
if (focusLevel === "componentDescription") {
|
|
22349
22364
|
if (key.upArrow || input === "k") {
|
|
22350
22365
|
return;
|
|
22351
22366
|
}
|
|
22352
22367
|
if (key.downArrow || input === "j") {
|
|
22353
|
-
|
|
22354
|
-
|
|
22355
|
-
setPropIdx(visiblePropIndexes[0]);
|
|
22356
|
-
setInSlots(false);
|
|
22357
|
-
setInComponentDesc(false);
|
|
22358
|
-
} else if (slots.length > 0) {
|
|
22359
|
-
setFocusLevel("slot");
|
|
22360
|
-
setSlotIdx(0);
|
|
22361
|
-
setInSlots(true);
|
|
22362
|
-
setInComponentDesc(false);
|
|
22363
|
-
}
|
|
22368
|
+
const firstSelectableRow = selectableRows[0];
|
|
22369
|
+
if (firstSelectableRow) focusSelectableRow(firstSelectableRow);
|
|
22364
22370
|
return;
|
|
22365
22371
|
}
|
|
22366
22372
|
if (key.return) {
|
|
@@ -22371,29 +22377,35 @@ function FieldEditor({
|
|
|
22371
22377
|
}
|
|
22372
22378
|
return;
|
|
22373
22379
|
}
|
|
22374
|
-
if (focusLevel === "slot") {
|
|
22380
|
+
if (focusLevel === "prop" || focusLevel === "slot") {
|
|
22375
22381
|
if (key.upArrow || input === "k") {
|
|
22376
|
-
if (
|
|
22377
|
-
|
|
22378
|
-
} else if (
|
|
22382
|
+
if (selectedSelectableIndex > 0) {
|
|
22383
|
+
focusSelectableRow(selectableRows[selectedSelectableIndex - 1]);
|
|
22384
|
+
} else if (selectedSelectableIndex === 0) {
|
|
22385
|
+
setFocusLevel("componentDescription");
|
|
22379
22386
|
setInSlots(false);
|
|
22380
|
-
|
|
22381
|
-
setFocusLevel("prop");
|
|
22387
|
+
setInComponentDesc(true);
|
|
22382
22388
|
}
|
|
22383
22389
|
return;
|
|
22384
22390
|
}
|
|
22385
22391
|
if (key.downArrow || input === "j") {
|
|
22386
|
-
if (
|
|
22387
|
-
|
|
22392
|
+
if (selectedSelectableIndex >= 0 && selectedSelectableIndex < selectableRows.length - 1) {
|
|
22393
|
+
focusSelectableRow(selectableRows[selectedSelectableIndex + 1]);
|
|
22388
22394
|
}
|
|
22389
22395
|
return;
|
|
22390
22396
|
}
|
|
22391
|
-
if (key.return && currentSlot) {
|
|
22397
|
+
if (focusLevel === "slot" && key.return && currentSlot) {
|
|
22392
22398
|
setFocusLevel("field");
|
|
22393
22399
|
setActiveField(SLOT_FIELDS[0] ?? null);
|
|
22394
22400
|
setTextCursor(currentSlot.description.length);
|
|
22395
22401
|
return;
|
|
22396
22402
|
}
|
|
22403
|
+
if (focusLevel === "prop" && key.return && currentProp) {
|
|
22404
|
+
setFocusLevel("field");
|
|
22405
|
+
setActiveField(propFields(currentProp)[0] ?? null);
|
|
22406
|
+
setTextCursor(currentProp.description.length);
|
|
22407
|
+
return;
|
|
22408
|
+
}
|
|
22397
22409
|
return;
|
|
22398
22410
|
}
|
|
22399
22411
|
if (focusLevel === "field") {
|
|
@@ -22722,14 +22734,24 @@ function FieldEditor({
|
|
|
22722
22734
|
})();
|
|
22723
22735
|
const rows = [];
|
|
22724
22736
|
rows.push({ kind: "component-description" });
|
|
22725
|
-
|
|
22726
|
-
|
|
22727
|
-
|
|
22737
|
+
for (const group of propGroups.filter((candidate) => candidate.kind !== "hidden")) {
|
|
22738
|
+
if (group.indexes.length === 0) continue;
|
|
22739
|
+
rows.push({ kind: "header", label: `${group.label} (${group.indexes.length}) `, section: group.kind });
|
|
22740
|
+
group.indexes.forEach((idx) => rows.push({ kind: "prop", idx }));
|
|
22728
22741
|
}
|
|
22729
22742
|
if (slots.length > 0) {
|
|
22730
22743
|
rows.push({ kind: "header", label: `\u2500\u2500 SLOTS (${slots.length}) `, section: "slots" });
|
|
22731
22744
|
slots.forEach((_, i) => rows.push({ kind: "slot", idx: i }));
|
|
22732
22745
|
}
|
|
22746
|
+
const hiddenGroup = propGroups.find((group) => group.kind === "hidden");
|
|
22747
|
+
if (hiddenGroup && hiddenGroup.indexes.length > 0) {
|
|
22748
|
+
rows.push({
|
|
22749
|
+
kind: "header",
|
|
22750
|
+
label: `${hiddenGroup.label} (${hiddenGroup.indexes.length}) `,
|
|
22751
|
+
section: "hidden"
|
|
22752
|
+
});
|
|
22753
|
+
hiddenGroup.indexes.forEach((idx) => rows.push({ kind: "prop", idx }));
|
|
22754
|
+
}
|
|
22733
22755
|
const selectedRowIdx = rows.findIndex(
|
|
22734
22756
|
(r) => r.kind === "prop" && !inSlots && !inComponentDesc && r.idx === propIdx || r.kind === "slot" && inSlots && r.idx === slotIdx || r.kind === "component-description" && inComponentDesc
|
|
22735
22757
|
);
|
|
@@ -22748,7 +22770,15 @@ function FieldEditor({
|
|
|
22748
22770
|
hasEmptyProperties && /* @__PURE__ */ jsx44(Text43, { 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." }),
|
|
22749
22771
|
/* @__PURE__ */ jsx44(Box41, { flexDirection: "column", width: innerWidth, children: visibleRowSlice.map((row, i) => {
|
|
22750
22772
|
if (row.kind === "header") {
|
|
22751
|
-
return /* @__PURE__ */ jsx44(
|
|
22773
|
+
return /* @__PURE__ */ jsx44(
|
|
22774
|
+
Text43,
|
|
22775
|
+
{
|
|
22776
|
+
bold: true,
|
|
22777
|
+
color: row.section === "slots" ? PALETTE.info : row.section === "hidden" ? PALETTE.warning : PALETTE.success,
|
|
22778
|
+
children: row.label
|
|
22779
|
+
},
|
|
22780
|
+
`header-${i}`
|
|
22781
|
+
);
|
|
22752
22782
|
}
|
|
22753
22783
|
if (row.kind === "component-description") {
|
|
22754
22784
|
const isSelected2 = inComponentDesc;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.27.1-dev-build-
|
|
3
|
+
"version": "2.27.1-dev-build-16b0c21.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"skills/"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@segment/analytics-node": "^3.
|
|
32
|
+
"@segment/analytics-node": "^3.0.0",
|
|
33
33
|
"@vue/compiler-sfc": "^3.5.31",
|
|
34
34
|
"commander": "^13.1.0",
|
|
35
35
|
"ink": "^4.4.1",
|
|
@@ -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.27.1-dev-build-
|
|
42
|
+
"@contentful/experience-design-system-types": "2.27.1-dev-build-16b0c21.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.27.1-dev-build-
|
|
55
|
-
"@contentful/experience-design-system-
|
|
56
|
-
"@contentful/experience-design-system-
|
|
54
|
+
"@contentful/experience-design-system-client": "2.27.1-dev-build-16b0c21.0",
|
|
55
|
+
"@contentful/experience-design-system-generation": "2.27.1-dev-build-16b0c21.0",
|
|
56
|
+
"@contentful/experience-design-system-extraction": "2.27.1-dev-build-16b0c21.0"
|
|
57
57
|
},
|
|
58
58
|
"repository": {
|
|
59
59
|
"type": "git",
|