@contentful/experience-design-system-cli 2.38.1-dev-build-db0347a4.0 → 2.38.1-dev-build-2bb2d130.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 +2 -58
- package/dist/index.js +2 -58
- package/dist/package.json +1 -1
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -23372,7 +23372,6 @@ function FieldEditor({
|
|
|
23372
23372
|
const [rationaleOpen, setRationaleOpen] = useState19(false);
|
|
23373
23373
|
const [rationaleScrollOffset, setRationaleScrollOffset] = useState19(0);
|
|
23374
23374
|
const [showHelp, setShowHelp] = useState19(false);
|
|
23375
|
-
const [pendingDelete, setPendingDelete] = useState19(null);
|
|
23376
23375
|
const props = editorState.props;
|
|
23377
23376
|
const slots = editorState.slots;
|
|
23378
23377
|
const contentPropIndexes = React13.useMemo(
|
|
@@ -23464,46 +23463,6 @@ function FieldEditor({
|
|
|
23464
23463
|
setEditorState(next);
|
|
23465
23464
|
onChange(serializeState(next, value));
|
|
23466
23465
|
};
|
|
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
23466
|
const canonicalize = React13.useCallback((json) => {
|
|
23508
23467
|
try {
|
|
23509
23468
|
return JSON.stringify(JSON.parse(json));
|
|
@@ -23540,11 +23499,6 @@ function FieldEditor({
|
|
|
23540
23499
|
onSave();
|
|
23541
23500
|
return;
|
|
23542
23501
|
}
|
|
23543
|
-
if (pendingDelete) {
|
|
23544
|
-
if (input === "y") deleteRow(pendingDelete);
|
|
23545
|
-
setPendingDelete(null);
|
|
23546
|
-
return;
|
|
23547
|
-
}
|
|
23548
23502
|
const inDescriptionTextEntryForHelp = focusLevel === "field" && editingField && activeField === "description";
|
|
23549
23503
|
const inStringDefaultTextEntryForHelp = focusLevel === "field" && editingField && activeField === "default" && currentProp != null && (currentProp.type === "string" || currentProp.type === "token");
|
|
23550
23504
|
const inValueListTextEntry = editingValue != null;
|
|
@@ -23744,11 +23698,6 @@ function FieldEditor({
|
|
|
23744
23698
|
}
|
|
23745
23699
|
return;
|
|
23746
23700
|
}
|
|
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
23701
|
if (focusLevel === "slot" && key.return && currentSlot) {
|
|
23753
23702
|
setFocusLevel("field");
|
|
23754
23703
|
setActiveField(SLOT_FIELDS[0] ?? null);
|
|
@@ -24055,10 +24004,6 @@ function FieldEditor({
|
|
|
24055
24004
|
}
|
|
24056
24005
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
24057
24006
|
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
24007
|
if (editingValue) {
|
|
24063
24008
|
return editingValue.mode === "add" ? "Enter to add \xB7 [Esc] to cancel" : "Enter to save edit \xB7 [Esc] to cancel";
|
|
24064
24009
|
}
|
|
@@ -24080,7 +24025,7 @@ function FieldEditor({
|
|
|
24080
24025
|
if (rationaleOpen) {
|
|
24081
24026
|
return "[\u2191\u2193] scroll [i/Esc] close rationale panel";
|
|
24082
24027
|
}
|
|
24083
|
-
return `[\u2191\u2193] navigate [Enter] edit fields [
|
|
24028
|
+
return `[\u2191\u2193] navigate rows [Enter] edit fields [s] source [${propRationaleKey}] prop rationale [${componentRationaleKey}] component rationale [h] help [Esc] exit panel`;
|
|
24084
24029
|
})();
|
|
24085
24030
|
const rows = [];
|
|
24086
24031
|
rows.push({ kind: "component-description" });
|
|
@@ -24346,7 +24291,6 @@ function FieldEditor({
|
|
|
24346
24291
|
/* @__PURE__ */ jsx32(Text27, { bold: true, children: "Row navigation" }),
|
|
24347
24292
|
/* @__PURE__ */ jsx32(Text27, { children: " \u2191/\u2193 move between rows" }),
|
|
24348
24293
|
/* @__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
24294
|
/* @__PURE__ */ jsx32(Text27, { children: " Esc exit the panel" }),
|
|
24351
24295
|
/* @__PURE__ */ jsx32(Text27, { children: " " }),
|
|
24352
24296
|
/* @__PURE__ */ jsx32(Text27, { bold: true, children: "Field editing" }),
|
|
@@ -24370,7 +24314,7 @@ function FieldEditor({
|
|
|
24370
24314
|
/* @__PURE__ */ jsx32(Text27, { color: PALETTE.muted, children: "press ? or Esc to close" })
|
|
24371
24315
|
] }),
|
|
24372
24316
|
validationError && /* @__PURE__ */ jsx32(Text27, { color: PALETTE.error, children: "\u2717 " + validationError }),
|
|
24373
|
-
/* @__PURE__ */ jsx32(Box26, { paddingTop: 1, children: /* @__PURE__ */ jsx32(Text27, { color:
|
|
24317
|
+
/* @__PURE__ */ jsx32(Box26, { paddingTop: 1, children: /* @__PURE__ */ jsx32(Text27, { color: PALETTE.muted, children: modeLabel }) })
|
|
24374
24318
|
]
|
|
24375
24319
|
}
|
|
24376
24320
|
);
|
package/dist/index.js
CHANGED
|
@@ -26400,7 +26400,6 @@ function FieldEditor({
|
|
|
26400
26400
|
const [rationaleOpen, setRationaleOpen] = useState19(false);
|
|
26401
26401
|
const [rationaleScrollOffset, setRationaleScrollOffset] = useState19(0);
|
|
26402
26402
|
const [showHelp, setShowHelp] = useState19(false);
|
|
26403
|
-
const [pendingDelete, setPendingDelete] = useState19(null);
|
|
26404
26403
|
const props = editorState.props;
|
|
26405
26404
|
const slots = editorState.slots;
|
|
26406
26405
|
const contentPropIndexes = React13.useMemo(
|
|
@@ -26492,46 +26491,6 @@ function FieldEditor({
|
|
|
26492
26491
|
setEditorState(next);
|
|
26493
26492
|
onChange(serializeState(next, value));
|
|
26494
26493
|
};
|
|
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
26494
|
const canonicalize = React13.useCallback((json) => {
|
|
26536
26495
|
try {
|
|
26537
26496
|
return JSON.stringify(JSON.parse(json));
|
|
@@ -26568,11 +26527,6 @@ function FieldEditor({
|
|
|
26568
26527
|
onSave();
|
|
26569
26528
|
return;
|
|
26570
26529
|
}
|
|
26571
|
-
if (pendingDelete) {
|
|
26572
|
-
if (input === "y") deleteRow(pendingDelete);
|
|
26573
|
-
setPendingDelete(null);
|
|
26574
|
-
return;
|
|
26575
|
-
}
|
|
26576
26530
|
const inDescriptionTextEntryForHelp = focusLevel === "field" && editingField && activeField === "description";
|
|
26577
26531
|
const inStringDefaultTextEntryForHelp = focusLevel === "field" && editingField && activeField === "default" && currentProp != null && (currentProp.type === "string" || currentProp.type === "token");
|
|
26578
26532
|
const inValueListTextEntry = editingValue != null;
|
|
@@ -26772,11 +26726,6 @@ function FieldEditor({
|
|
|
26772
26726
|
}
|
|
26773
26727
|
return;
|
|
26774
26728
|
}
|
|
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
26729
|
if (focusLevel === "slot" && key.return && currentSlot) {
|
|
26781
26730
|
setFocusLevel("field");
|
|
26782
26731
|
setActiveField(SLOT_FIELDS[0] ?? null);
|
|
@@ -27083,10 +27032,6 @@ function FieldEditor({
|
|
|
27083
27032
|
}
|
|
27084
27033
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
27085
27034
|
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
27035
|
if (editingValue) {
|
|
27091
27036
|
return editingValue.mode === "add" ? "Enter to add \xB7 [Esc] to cancel" : "Enter to save edit \xB7 [Esc] to cancel";
|
|
27092
27037
|
}
|
|
@@ -27108,7 +27053,7 @@ function FieldEditor({
|
|
|
27108
27053
|
if (rationaleOpen) {
|
|
27109
27054
|
return "[\u2191\u2193] scroll [i/Esc] close rationale panel";
|
|
27110
27055
|
}
|
|
27111
|
-
return `[\u2191\u2193] navigate [Enter] edit fields [
|
|
27056
|
+
return `[\u2191\u2193] navigate rows [Enter] edit fields [s] source [${propRationaleKey}] prop rationale [${componentRationaleKey}] component rationale [h] help [Esc] exit panel`;
|
|
27112
27057
|
})();
|
|
27113
27058
|
const rows = [];
|
|
27114
27059
|
rows.push({ kind: "component-description" });
|
|
@@ -27374,7 +27319,6 @@ function FieldEditor({
|
|
|
27374
27319
|
/* @__PURE__ */ jsx32(Text27, { bold: true, children: "Row navigation" }),
|
|
27375
27320
|
/* @__PURE__ */ jsx32(Text27, { children: " \u2191/\u2193 move between rows" }),
|
|
27376
27321
|
/* @__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
27322
|
/* @__PURE__ */ jsx32(Text27, { children: " Esc exit the panel" }),
|
|
27379
27323
|
/* @__PURE__ */ jsx32(Text27, { children: " " }),
|
|
27380
27324
|
/* @__PURE__ */ jsx32(Text27, { bold: true, children: "Field editing" }),
|
|
@@ -27398,7 +27342,7 @@ function FieldEditor({
|
|
|
27398
27342
|
/* @__PURE__ */ jsx32(Text27, { color: PALETTE.muted, children: "press ? or Esc to close" })
|
|
27399
27343
|
] }),
|
|
27400
27344
|
validationError && /* @__PURE__ */ jsx32(Text27, { color: PALETTE.error, children: "\u2717 " + validationError }),
|
|
27401
|
-
/* @__PURE__ */ jsx32(Box26, { paddingTop: 1, children: /* @__PURE__ */ jsx32(Text27, { color:
|
|
27345
|
+
/* @__PURE__ */ jsx32(Box26, { paddingTop: 1, children: /* @__PURE__ */ jsx32(Text27, { color: PALETTE.muted, children: modeLabel }) })
|
|
27402
27346
|
]
|
|
27403
27347
|
}
|
|
27404
27348
|
);
|
package/dist/package.json
CHANGED
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-
|
|
3
|
+
"version": "2.38.1-dev-build-2bb2d130.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-
|
|
49
|
-
"@contentful/experience-design-system-
|
|
48
|
+
"@contentful/experience-design-system-backend-pipeline": "2.38.1-dev-build-2bb2d130.0",
|
|
49
|
+
"@contentful/experience-design-system-types": "2.38.1-dev-build-2bb2d130.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tsconfig/node24": "^24.0.4",
|