@contentful/experience-design-system-cli 2.38.1-dev-build-2694d816.0 → 2.38.1-dev-build-40e920ee.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 +45 -33
- package/dist/index.js +45 -33
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/09-review/components/ReviewComponentPanel.d.ts +1 -4
- package/dist/src/tui/import/steps/09-review/components/TokenReviewPanel.d.ts +1 -0
- package/dist/src/tui/import/steps/09-review/types.d.ts +1 -0
- package/package.json +3 -3
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
|
|
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);
|
|
@@ -24025,7 +24026,7 @@ function FieldEditor({
|
|
|
24025
24026
|
if (rationaleOpen) {
|
|
24026
24027
|
return "[\u2191\u2193] scroll [i/Esc] close rationale panel";
|
|
24027
24028
|
}
|
|
24028
|
-
return `[\u2191\u2193] navigate
|
|
24029
|
+
return `[\u2191\u2193] navigate [Enter] edit fields [h] help [s] source [Esc] exit panel`;
|
|
24029
24030
|
})();
|
|
24030
24031
|
const rows = [];
|
|
24031
24032
|
rows.push({ kind: "component-description" });
|
|
@@ -24653,8 +24654,8 @@ function TokenReviewPanel({
|
|
|
24653
24654
|
borderStyle: "single",
|
|
24654
24655
|
borderColor: active ? PALETTE.text : void 0,
|
|
24655
24656
|
children: [
|
|
24656
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color: active ? void 0 : PALETTE.muted, wrap: "truncate", children: `
|
|
24657
|
-
/* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, wrap: "truncate", children: `
|
|
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}).` }),
|
|
24658
24659
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
24659
24660
|
current.paths.length === 0 && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "(no compatible tokens found for this token kind)" }),
|
|
24660
24661
|
visiblePaths.map((path5, i) => {
|
|
@@ -24687,18 +24688,33 @@ function TokenReviewPanel({
|
|
|
24687
24688
|
borderStyle: "single",
|
|
24688
24689
|
borderColor: active ? PALETTE.text : void 0,
|
|
24689
24690
|
children: [
|
|
24690
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color: active ? void 0 : PALETTE.muted, children: `
|
|
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: " " }),
|
|
24691
24695
|
suggestions.length === 0 && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "(no token suggestions for this component)" }),
|
|
24692
24696
|
suggestions.map((s, i) => {
|
|
24693
24697
|
const focused = i === selectedRow;
|
|
24694
24698
|
return /* @__PURE__ */ jsxs30(Box31, { flexDirection: "column", children: [
|
|
24695
|
-
/* @__PURE__ */ jsx39(Box31, { children: /* @__PURE__ */ jsx39(Text32, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures7.pointer : " "} ${s.propName}` }) }),
|
|
24696
|
-
/* @__PURE__ */ jsx39(
|
|
24697
|
-
|
|
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: " " })
|
|
24698
24715
|
] }, s.propName);
|
|
24699
24716
|
}),
|
|
24700
|
-
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24701
|
-
/* @__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" })
|
|
24702
24718
|
]
|
|
24703
24719
|
}
|
|
24704
24720
|
);
|
|
@@ -24946,15 +24962,9 @@ function ReviewFinalizeError({
|
|
|
24946
24962
|
function ReviewPanelFooter({
|
|
24947
24963
|
reviewEditor,
|
|
24948
24964
|
sidebarFocused,
|
|
24949
|
-
sidebarFooter
|
|
24950
|
-
livePreview,
|
|
24951
|
-
livePreviewSpinner
|
|
24965
|
+
sidebarFooter
|
|
24952
24966
|
}) {
|
|
24953
|
-
return /* @__PURE__ */
|
|
24954
|
-
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" : ""),
|
|
24955
|
-
livePreview.status === "running" && /* @__PURE__ */ jsx42(Text34, { children: ` ${livePreviewSpinner} live preview` }),
|
|
24956
|
-
livePreview.disabled && /* @__PURE__ */ jsx42(Text34, { children: " \xB7 live preview disabled" })
|
|
24957
|
-
] });
|
|
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" : "") });
|
|
24958
24968
|
}
|
|
24959
24969
|
function ReviewComponentTitle({
|
|
24960
24970
|
selectedKey,
|
|
@@ -24988,9 +24998,7 @@ function ReviewComponentPanel({
|
|
|
24988
24998
|
sidebarFocused,
|
|
24989
24999
|
fieldEditor,
|
|
24990
25000
|
saveError,
|
|
24991
|
-
sidebarFooter
|
|
24992
|
-
livePreview,
|
|
24993
|
-
livePreviewSpinner
|
|
25001
|
+
sidebarFooter
|
|
24994
25002
|
}) {
|
|
24995
25003
|
const propCount = Object.keys(selectedEntry.$properties).length;
|
|
24996
25004
|
const slotCount = selectedEntry.$slots ? Object.keys(selectedEntry.$slots).length : 0;
|
|
@@ -25027,9 +25035,7 @@ function ReviewComponentPanel({
|
|
|
25027
25035
|
{
|
|
25028
25036
|
reviewEditor,
|
|
25029
25037
|
sidebarFocused,
|
|
25030
|
-
sidebarFooter
|
|
25031
|
-
livePreview,
|
|
25032
|
-
livePreviewSpinner
|
|
25038
|
+
sidebarFooter
|
|
25033
25039
|
}
|
|
25034
25040
|
) }) })
|
|
25035
25041
|
] }) });
|
|
@@ -25573,7 +25579,7 @@ function collectTokenSuggestions(entry, availableTokens = []) {
|
|
|
25573
25579
|
const compatiblePaths = new Set(compatible);
|
|
25574
25580
|
const allowed = availableTokens.length > 0 ? persistedAllowed.filter((path5) => compatiblePaths.has(path5)) : persistedAllowed;
|
|
25575
25581
|
const paths = availableTokens.length > 0 ? compatible : allowed;
|
|
25576
|
-
return { propName, paths, suggested: [...allowed], allowed };
|
|
25582
|
+
return { propName, kinds, paths, suggested: [...allowed], allowed };
|
|
25577
25583
|
});
|
|
25578
25584
|
}
|
|
25579
25585
|
|
|
@@ -26369,7 +26375,7 @@ var HELP_SECTIONS2 = [
|
|
|
26369
26375
|
{ keys: "P", label: "Component rationale" },
|
|
26370
26376
|
{ keys: "s", label: "Source code snippet" },
|
|
26371
26377
|
{ keys: "J", label: "Toggle JSON" },
|
|
26372
|
-
{ keys: "t", label: "
|
|
26378
|
+
{ keys: "t", label: "Review mapped tokens" }
|
|
26373
26379
|
]
|
|
26374
26380
|
},
|
|
26375
26381
|
{
|
|
@@ -27517,9 +27523,7 @@ function GenerateReviewStepView({
|
|
|
27517
27523
|
initialFocusTarget: pendingEditorFocus && pendingEditorFocus.componentName === selected.key ? pendingEditorFocus.target : { kind: "description" }
|
|
27518
27524
|
}
|
|
27519
27525
|
),
|
|
27520
|
-
saveError: reviewEditor.saveError
|
|
27521
|
-
livePreview: livePreviewHook,
|
|
27522
|
-
livePreviewSpinner
|
|
27526
|
+
saveError: reviewEditor.saveError
|
|
27523
27527
|
}
|
|
27524
27528
|
) : /* @__PURE__ */ jsx48(ReviewNoSelection, {})
|
|
27525
27529
|
] }),
|
|
@@ -27551,7 +27555,7 @@ function GenerateReviewStepView({
|
|
|
27551
27555
|
hidden: dialogOpen
|
|
27552
27556
|
}
|
|
27553
27557
|
),
|
|
27554
|
-
!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 })
|
|
27555
27559
|
] });
|
|
27556
27560
|
}
|
|
27557
27561
|
|
|
@@ -28030,12 +28034,20 @@ function diffProperty(name, old, newDef) {
|
|
|
28030
28034
|
diffs.push({ key: `${name}-new`, color: PALETTE.success, text: `+ ${name}: ${formatPropDef(newDef)}` });
|
|
28031
28035
|
return diffs;
|
|
28032
28036
|
}
|
|
28037
|
+
function formatDefault(value) {
|
|
28038
|
+
const sys = value?.sys;
|
|
28039
|
+
if (sys?.linkType === "Contentful:DesignToken" && typeof sys.urn === "string") {
|
|
28040
|
+
const name = sys.urn.split("/designTokens/")[1];
|
|
28041
|
+
if (name) return name;
|
|
28042
|
+
}
|
|
28043
|
+
return JSON.stringify(value);
|
|
28044
|
+
}
|
|
28033
28045
|
function formatOldProp(prop) {
|
|
28034
28046
|
const parts = [];
|
|
28035
28047
|
if (prop.type) parts.push(prop.type);
|
|
28036
28048
|
if (prop.category) parts.push(prop.category);
|
|
28037
28049
|
parts.push(prop.required ? "required" : "optional");
|
|
28038
|
-
if (prop.default !== void 0) parts.push(`default=${
|
|
28050
|
+
if (prop.default !== void 0) parts.push(`default=${formatDefault(prop.default)}`);
|
|
28039
28051
|
return parts.join(", ");
|
|
28040
28052
|
}
|
|
28041
28053
|
function formatPropDef(def) {
|
|
@@ -28044,7 +28056,7 @@ function formatPropDef(def) {
|
|
|
28044
28056
|
if (def["$category"]) parts.push(def["$category"]);
|
|
28045
28057
|
if (def["$required"] === true) parts.push("required");
|
|
28046
28058
|
else parts.push("optional");
|
|
28047
|
-
if (def["$default"] !== void 0) parts.push(`default=${
|
|
28059
|
+
if (def["$default"] !== void 0) parts.push(`default=${formatDefault(def["$default"])}`);
|
|
28048
28060
|
return parts.join(", ");
|
|
28049
28061
|
}
|
|
28050
28062
|
|
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
|
|
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);
|
|
@@ -27053,7 +27054,7 @@ function FieldEditor({
|
|
|
27053
27054
|
if (rationaleOpen) {
|
|
27054
27055
|
return "[\u2191\u2193] scroll [i/Esc] close rationale panel";
|
|
27055
27056
|
}
|
|
27056
|
-
return `[\u2191\u2193] navigate
|
|
27057
|
+
return `[\u2191\u2193] navigate [Enter] edit fields [h] help [s] source [Esc] exit panel`;
|
|
27057
27058
|
})();
|
|
27058
27059
|
const rows = [];
|
|
27059
27060
|
rows.push({ kind: "component-description" });
|
|
@@ -27735,8 +27736,8 @@ function TokenReviewPanel({
|
|
|
27735
27736
|
borderStyle: "single",
|
|
27736
27737
|
borderColor: active ? PALETTE.text : void 0,
|
|
27737
27738
|
children: [
|
|
27738
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color: active ? void 0 : PALETTE.muted, wrap: "truncate", children: `
|
|
27739
|
-
/* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, wrap: "truncate", children: `
|
|
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}).` }),
|
|
27740
27741
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
27741
27742
|
current.paths.length === 0 && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "(no compatible tokens found for this token kind)" }),
|
|
27742
27743
|
visiblePaths.map((path5, i) => {
|
|
@@ -27769,18 +27770,33 @@ function TokenReviewPanel({
|
|
|
27769
27770
|
borderStyle: "single",
|
|
27770
27771
|
borderColor: active ? PALETTE.text : void 0,
|
|
27771
27772
|
children: [
|
|
27772
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color: active ? void 0 : PALETTE.muted, children: `
|
|
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: " " }),
|
|
27773
27777
|
suggestions.length === 0 && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "(no token suggestions for this component)" }),
|
|
27774
27778
|
suggestions.map((s, i) => {
|
|
27775
27779
|
const focused = i === selectedRow;
|
|
27776
27780
|
return /* @__PURE__ */ jsxs30(Box31, { flexDirection: "column", children: [
|
|
27777
|
-
/* @__PURE__ */ jsx39(Box31, { children: /* @__PURE__ */ jsx39(Text32, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures7.pointer : " "} ${s.propName}` }) }),
|
|
27778
|
-
/* @__PURE__ */ jsx39(
|
|
27779
|
-
|
|
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: " " })
|
|
27780
27797
|
] }, s.propName);
|
|
27781
27798
|
}),
|
|
27782
|
-
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
27783
|
-
/* @__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" })
|
|
27784
27800
|
]
|
|
27785
27801
|
}
|
|
27786
27802
|
);
|
|
@@ -28054,15 +28070,9 @@ function ReviewFinalizeError({
|
|
|
28054
28070
|
function ReviewPanelFooter({
|
|
28055
28071
|
reviewEditor,
|
|
28056
28072
|
sidebarFocused,
|
|
28057
|
-
sidebarFooter
|
|
28058
|
-
livePreview,
|
|
28059
|
-
livePreviewSpinner
|
|
28073
|
+
sidebarFooter
|
|
28060
28074
|
}) {
|
|
28061
|
-
return /* @__PURE__ */
|
|
28062
|
-
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" : ""),
|
|
28063
|
-
livePreview.status === "running" && /* @__PURE__ */ jsx42(Text34, { children: ` ${livePreviewSpinner} live preview` }),
|
|
28064
|
-
livePreview.disabled && /* @__PURE__ */ jsx42(Text34, { children: " \xB7 live preview disabled" })
|
|
28065
|
-
] });
|
|
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" : "") });
|
|
28066
28076
|
}
|
|
28067
28077
|
function ReviewComponentTitle({
|
|
28068
28078
|
selectedKey,
|
|
@@ -28096,9 +28106,7 @@ function ReviewComponentPanel({
|
|
|
28096
28106
|
sidebarFocused,
|
|
28097
28107
|
fieldEditor,
|
|
28098
28108
|
saveError,
|
|
28099
|
-
sidebarFooter
|
|
28100
|
-
livePreview,
|
|
28101
|
-
livePreviewSpinner
|
|
28109
|
+
sidebarFooter
|
|
28102
28110
|
}) {
|
|
28103
28111
|
const propCount = Object.keys(selectedEntry.$properties).length;
|
|
28104
28112
|
const slotCount = selectedEntry.$slots ? Object.keys(selectedEntry.$slots).length : 0;
|
|
@@ -28135,9 +28143,7 @@ function ReviewComponentPanel({
|
|
|
28135
28143
|
{
|
|
28136
28144
|
reviewEditor,
|
|
28137
28145
|
sidebarFocused,
|
|
28138
|
-
sidebarFooter
|
|
28139
|
-
livePreview,
|
|
28140
|
-
livePreviewSpinner
|
|
28146
|
+
sidebarFooter
|
|
28141
28147
|
}
|
|
28142
28148
|
) }) })
|
|
28143
28149
|
] }) });
|
|
@@ -28739,7 +28745,7 @@ function collectTokenSuggestions(entry, availableTokens = []) {
|
|
|
28739
28745
|
const compatiblePaths = new Set(compatible);
|
|
28740
28746
|
const allowed = availableTokens.length > 0 ? persistedAllowed.filter((path5) => compatiblePaths.has(path5)) : persistedAllowed;
|
|
28741
28747
|
const paths = availableTokens.length > 0 ? compatible : allowed;
|
|
28742
|
-
return { propName, paths, suggested: [...allowed], allowed };
|
|
28748
|
+
return { propName, kinds, paths, suggested: [...allowed], allowed };
|
|
28743
28749
|
});
|
|
28744
28750
|
}
|
|
28745
28751
|
var init_token_suggestions = __esm({
|
|
@@ -30690,9 +30696,7 @@ function GenerateReviewStepView({
|
|
|
30690
30696
|
initialFocusTarget: pendingEditorFocus && pendingEditorFocus.componentName === selected.key ? pendingEditorFocus.target : { kind: "description" }
|
|
30691
30697
|
}
|
|
30692
30698
|
),
|
|
30693
|
-
saveError: reviewEditor.saveError
|
|
30694
|
-
livePreview: livePreviewHook,
|
|
30695
|
-
livePreviewSpinner
|
|
30699
|
+
saveError: reviewEditor.saveError
|
|
30696
30700
|
}
|
|
30697
30701
|
) : /* @__PURE__ */ jsx48(ReviewNoSelection, {})
|
|
30698
30702
|
] }),
|
|
@@ -30724,7 +30728,7 @@ function GenerateReviewStepView({
|
|
|
30724
30728
|
hidden: dialogOpen
|
|
30725
30729
|
}
|
|
30726
30730
|
),
|
|
30727
|
-
!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 })
|
|
30728
30732
|
] });
|
|
30729
30733
|
}
|
|
30730
30734
|
var HELP_SECTIONS2;
|
|
@@ -30806,7 +30810,7 @@ var init_generate_review_step = __esm({
|
|
|
30806
30810
|
{ keys: "P", label: "Component rationale" },
|
|
30807
30811
|
{ keys: "s", label: "Source code snippet" },
|
|
30808
30812
|
{ keys: "J", label: "Toggle JSON" },
|
|
30809
|
-
{ keys: "t", label: "
|
|
30813
|
+
{ keys: "t", label: "Review mapped tokens" }
|
|
30810
30814
|
]
|
|
30811
30815
|
},
|
|
30812
30816
|
{
|
|
@@ -31374,12 +31378,20 @@ function diffProperty(name, old, newDef) {
|
|
|
31374
31378
|
diffs.push({ key: `${name}-new`, color: PALETTE.success, text: `+ ${name}: ${formatPropDef(newDef)}` });
|
|
31375
31379
|
return diffs;
|
|
31376
31380
|
}
|
|
31381
|
+
function formatDefault(value) {
|
|
31382
|
+
const sys = value?.sys;
|
|
31383
|
+
if (sys?.linkType === "Contentful:DesignToken" && typeof sys.urn === "string") {
|
|
31384
|
+
const name = sys.urn.split("/designTokens/")[1];
|
|
31385
|
+
if (name) return name;
|
|
31386
|
+
}
|
|
31387
|
+
return JSON.stringify(value);
|
|
31388
|
+
}
|
|
31377
31389
|
function formatOldProp(prop) {
|
|
31378
31390
|
const parts = [];
|
|
31379
31391
|
if (prop.type) parts.push(prop.type);
|
|
31380
31392
|
if (prop.category) parts.push(prop.category);
|
|
31381
31393
|
parts.push(prop.required ? "required" : "optional");
|
|
31382
|
-
if (prop.default !== void 0) parts.push(`default=${
|
|
31394
|
+
if (prop.default !== void 0) parts.push(`default=${formatDefault(prop.default)}`);
|
|
31383
31395
|
return parts.join(", ");
|
|
31384
31396
|
}
|
|
31385
31397
|
function formatPropDef(def) {
|
|
@@ -31388,7 +31400,7 @@ function formatPropDef(def) {
|
|
|
31388
31400
|
if (def["$category"]) parts.push(def["$category"]);
|
|
31389
31401
|
if (def["$required"] === true) parts.push("required");
|
|
31390
31402
|
else parts.push("optional");
|
|
31391
|
-
if (def["$default"] !== void 0) parts.push(`default=${
|
|
31403
|
+
if (def["$default"] !== void 0) parts.push(`default=${formatDefault(def["$default"])}`);
|
|
31392
31404
|
return parts.join(", ");
|
|
31393
31405
|
}
|
|
31394
31406
|
var init_preview_diff = __esm({
|
package/dist/package.json
CHANGED
|
@@ -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,
|
|
29
|
+
export declare function ReviewComponentPanel({ selectedKey, selectedEntry, componentRationale, reviewMetadata, reviewEditor, width, height, sourceBorderColor, jsonValue, sidebarFocused, fieldEditor, saveError, sidebarFooter, }: ReviewComponentPanelProps): React.ReactElement;
|
|
33
30
|
export {};
|
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-40e920ee.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-backend-pipeline": "2.38.1-dev-build-
|
|
49
|
-
"@contentful/experience-design-system-types": "2.38.1-dev-build-
|
|
48
|
+
"@contentful/experience-design-system-backend-pipeline": "2.38.1-dev-build-40e920ee.0",
|
|
49
|
+
"@contentful/experience-design-system-types": "2.38.1-dev-build-40e920ee.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tsconfig/node24": "^24.0.4",
|