@contentful/experience-design-system-cli 2.37.1-dev-build-7a46c9e6.0 → 2.37.1-dev-build-444a2d6a.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 +12 -27
- package/dist/index.js +12 -27
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.d.ts +4 -4
- package/dist/src/tui/import/steps/07-scope-gate/state.d.ts +3 -2
- package/dist/src/tui/import/steps/07-scope-gate/use-scope-gate.d.ts +2 -2
- package/legacy/dist/src/analyze/select/tui/components/GroupedSidebar.d.ts +1 -3
- package/legacy/dist/src/import/tui/handoff.d.ts +2 -4
- package/legacy/dist/src/index.js +30 -40
- package/legacy/package.json +1 -1
- package/package.json +4 -4
package/dist/app.js
CHANGED
|
@@ -7429,9 +7429,6 @@ function PreviewBadge({
|
|
|
7429
7429
|
|
|
7430
7430
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.tsx
|
|
7431
7431
|
import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
7432
|
-
function slotEdgeKey(parent, child) {
|
|
7433
|
-
return `${parent}\u2192${child}`;
|
|
7434
|
-
}
|
|
7435
7432
|
var GLYPH_EXPAND_COLLAPSED = "\u25B8";
|
|
7436
7433
|
var GLYPH_EXPAND_EXPANDED = "\u25BE";
|
|
7437
7434
|
var GLYPH_TREE_MID = "\u251C\u2500";
|
|
@@ -7880,7 +7877,7 @@ function GroupedSidebar(props) {
|
|
|
7880
7877
|
const badge = itemName ? previewBadge(previewAnnotationByKey?.get(itemName)) : null;
|
|
7881
7878
|
const showInheritance = rs !== void 0 && row.kind !== "cycle" && row.kind !== "empty" && row.kind !== "group-root";
|
|
7882
7879
|
const supportsSelectionGlyph = selectionStateByKey !== void 0 && itemName !== void 0 && (row.kind === "standalone" || row.kind === "group-root" || row.kind === "group-child" || row.kind === "flat" || row.kind === "empty" || row.kind === "cycle");
|
|
7883
|
-
const edgeExcluded = row.kind === "group-child" && row.parentName !== void 0 && itemName !== void 0 && excludedSlotEdges?.
|
|
7880
|
+
const edgeExcluded = row.kind === "group-child" && row.parentName !== void 0 && itemName !== void 0 && excludedSlotEdges?.some((edge) => edge.parent === row.parentName && edge.child === itemName) === true;
|
|
7884
7881
|
const selState = supportsSelectionGlyph ? edgeExcluded ? "undecided" : selectionStateByKey.get(itemName) ?? "undecided" : void 0;
|
|
7885
7882
|
const isCycleRow = row.kind === "cycle";
|
|
7886
7883
|
const selStyle = selectionGlyphStyleFor(selState, isCycleRow);
|
|
@@ -8812,14 +8809,20 @@ function rejectNeedsConfirmation(graph, name, state) {
|
|
|
8812
8809
|
const ancestors = toReject.filter((n) => n !== name);
|
|
8813
8810
|
return ancestors.length + toDeselect.length >= 2;
|
|
8814
8811
|
}
|
|
8815
|
-
function
|
|
8812
|
+
function withEdgeExcluded(edges, edge, excluded) {
|
|
8813
|
+
const others = edges.filter((e) => e.parent !== edge.parent || e.child !== edge.child);
|
|
8814
|
+
return excluded ? [...others, edge] : others;
|
|
8815
|
+
}
|
|
8816
|
+
function partitionDecisions(components, state, excludedEdges) {
|
|
8816
8817
|
const accepted = [];
|
|
8817
8818
|
const rejected = [];
|
|
8818
8819
|
for (const c2 of components) {
|
|
8819
8820
|
if (state.get(c2.name) === "accepted") accepted.push(c2.name);
|
|
8820
8821
|
else rejected.push(c2.name);
|
|
8821
8822
|
}
|
|
8822
|
-
|
|
8823
|
+
const rejectedNames = new Set(rejected);
|
|
8824
|
+
const excludedSlotEdges = excludedEdges.filter((e) => !rejectedNames.has(e.parent) && !rejectedNames.has(e.child));
|
|
8825
|
+
return { accepted, rejected, excludedSlotEdges };
|
|
8823
8826
|
}
|
|
8824
8827
|
|
|
8825
8828
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/use-scope-gate.ts
|
|
@@ -8827,7 +8830,7 @@ function useScopeGate({ components, onConfirm, onQuit }) {
|
|
|
8827
8830
|
const { columns: totalWidth, rows: terminalRows } = useTerminalSize();
|
|
8828
8831
|
const columnPlan = useMemo2(() => computeColumnWidths(totalWidth), [totalWidth]);
|
|
8829
8832
|
const [decisions, setDecisions] = useState12(/* @__PURE__ */ new Map());
|
|
8830
|
-
const [excludedEdges, setExcludedEdges] = useState12(
|
|
8833
|
+
const [excludedEdges, setExcludedEdges] = useState12([]);
|
|
8831
8834
|
const [nav, setNav] = useState12({ cursor: 0, scrollOffset: 0 });
|
|
8832
8835
|
const [focusedColumn, setFocusedColumn] = useState12("main");
|
|
8833
8836
|
const [addedComponentsCursor, setAddedComponentsCursor] = useState12(0);
|
|
@@ -9005,22 +9008,7 @@ function useScopeGate({ components, onConfirm, onQuit }) {
|
|
|
9005
9008
|
const child = groupedItems[row.itemIdx]?.key;
|
|
9006
9009
|
return child ? { parent: row.parentName, child } : void 0;
|
|
9007
9010
|
};
|
|
9008
|
-
const setEdgeExcluded = (edge, excluded) =>
|
|
9009
|
-
setExcludedEdges((prev) => {
|
|
9010
|
-
const next = new Set(prev);
|
|
9011
|
-
const key = slotEdgeKey(edge.parent, edge.child);
|
|
9012
|
-
if (excluded) next.add(key);
|
|
9013
|
-
else next.delete(key);
|
|
9014
|
-
return next;
|
|
9015
|
-
});
|
|
9016
|
-
};
|
|
9017
|
-
const confirmedEdges = (rejected) => {
|
|
9018
|
-
const rejectedSet = new Set(rejected);
|
|
9019
|
-
return [...excludedEdges].map((key) => {
|
|
9020
|
-
const [parent, child] = key.split("\u2192");
|
|
9021
|
-
return { parent, child };
|
|
9022
|
-
}).filter((edge) => !rejectedSet.has(edge.parent) && !rejectedSet.has(edge.child));
|
|
9023
|
-
};
|
|
9011
|
+
const setEdgeExcluded = (edge, excluded) => setExcludedEdges((prev) => withEdgeExcluded(prev, edge, excluded));
|
|
9024
9012
|
const jumpCursorTo = (name) => {
|
|
9025
9013
|
let idx = -1;
|
|
9026
9014
|
for (let i = 0; i < visibleRows.length; i++) {
|
|
@@ -9120,10 +9108,7 @@ function useScopeGate({ components, onConfirm, onQuit }) {
|
|
|
9120
9108
|
onQuit();
|
|
9121
9109
|
return;
|
|
9122
9110
|
case "confirm":
|
|
9123
|
-
|
|
9124
|
-
const partition = partitionDecisions(components, decisions);
|
|
9125
|
-
onConfirm({ ...partition, excludedSlotEdges: confirmedEdges(partition.rejected) });
|
|
9126
|
-
}
|
|
9111
|
+
onConfirm(partitionDecisions(components, decisions, excludedEdges));
|
|
9127
9112
|
return;
|
|
9128
9113
|
case "close-help":
|
|
9129
9114
|
setShowHelp(false);
|
package/dist/index.js
CHANGED
|
@@ -10185,9 +10185,6 @@ var init_badge = __esm({
|
|
|
10185
10185
|
import figures4 from "figures";
|
|
10186
10186
|
import { Box as Box17, Text as Text19 } from "ink";
|
|
10187
10187
|
import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
10188
|
-
function slotEdgeKey(parent, child) {
|
|
10189
|
-
return `${parent}\u2192${child}`;
|
|
10190
|
-
}
|
|
10191
10188
|
function isEmpty(entry) {
|
|
10192
10189
|
return Object.keys(entry.$properties ?? {}).length === 0 && Object.keys(entry.$slots ?? {}).length === 0;
|
|
10193
10190
|
}
|
|
@@ -10630,7 +10627,7 @@ function GroupedSidebar(props) {
|
|
|
10630
10627
|
const badge = itemName ? previewBadge(previewAnnotationByKey?.get(itemName)) : null;
|
|
10631
10628
|
const showInheritance = rs !== void 0 && row.kind !== "cycle" && row.kind !== "empty" && row.kind !== "group-root";
|
|
10632
10629
|
const supportsSelectionGlyph = selectionStateByKey !== void 0 && itemName !== void 0 && (row.kind === "standalone" || row.kind === "group-root" || row.kind === "group-child" || row.kind === "flat" || row.kind === "empty" || row.kind === "cycle");
|
|
10633
|
-
const edgeExcluded = row.kind === "group-child" && row.parentName !== void 0 && itemName !== void 0 && excludedSlotEdges?.
|
|
10630
|
+
const edgeExcluded = row.kind === "group-child" && row.parentName !== void 0 && itemName !== void 0 && excludedSlotEdges?.some((edge) => edge.parent === row.parentName && edge.child === itemName) === true;
|
|
10634
10631
|
const selState = supportsSelectionGlyph ? edgeExcluded ? "undecided" : selectionStateByKey.get(itemName) ?? "undecided" : void 0;
|
|
10635
10632
|
const isCycleRow = row.kind === "cycle";
|
|
10636
10633
|
const selStyle = selectionGlyphStyleFor(selState, isCycleRow);
|
|
@@ -11694,14 +11691,20 @@ function rejectNeedsConfirmation(graph, name, state) {
|
|
|
11694
11691
|
const ancestors = toReject.filter((n) => n !== name);
|
|
11695
11692
|
return ancestors.length + toDeselect.length >= 2;
|
|
11696
11693
|
}
|
|
11697
|
-
function
|
|
11694
|
+
function withEdgeExcluded(edges, edge, excluded) {
|
|
11695
|
+
const others = edges.filter((e) => e.parent !== edge.parent || e.child !== edge.child);
|
|
11696
|
+
return excluded ? [...others, edge] : others;
|
|
11697
|
+
}
|
|
11698
|
+
function partitionDecisions(components, state, excludedEdges) {
|
|
11698
11699
|
const accepted = [];
|
|
11699
11700
|
const rejected = [];
|
|
11700
11701
|
for (const c2 of components) {
|
|
11701
11702
|
if (state.get(c2.name) === "accepted") accepted.push(c2.name);
|
|
11702
11703
|
else rejected.push(c2.name);
|
|
11703
11704
|
}
|
|
11704
|
-
|
|
11705
|
+
const rejectedNames = new Set(rejected);
|
|
11706
|
+
const excludedSlotEdges = excludedEdges.filter((e) => !rejectedNames.has(e.parent) && !rejectedNames.has(e.child));
|
|
11707
|
+
return { accepted, rejected, excludedSlotEdges };
|
|
11705
11708
|
}
|
|
11706
11709
|
var init_state = __esm({
|
|
11707
11710
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/state.ts"() {
|
|
@@ -11717,7 +11720,7 @@ function useScopeGate({ components, onConfirm, onQuit }) {
|
|
|
11717
11720
|
const { columns: totalWidth, rows: terminalRows } = useTerminalSize();
|
|
11718
11721
|
const columnPlan = useMemo2(() => computeColumnWidths(totalWidth), [totalWidth]);
|
|
11719
11722
|
const [decisions, setDecisions] = useState12(/* @__PURE__ */ new Map());
|
|
11720
|
-
const [excludedEdges, setExcludedEdges] = useState12(
|
|
11723
|
+
const [excludedEdges, setExcludedEdges] = useState12([]);
|
|
11721
11724
|
const [nav, setNav] = useState12({ cursor: 0, scrollOffset: 0 });
|
|
11722
11725
|
const [focusedColumn, setFocusedColumn] = useState12("main");
|
|
11723
11726
|
const [addedComponentsCursor, setAddedComponentsCursor] = useState12(0);
|
|
@@ -11895,22 +11898,7 @@ function useScopeGate({ components, onConfirm, onQuit }) {
|
|
|
11895
11898
|
const child = groupedItems[row.itemIdx]?.key;
|
|
11896
11899
|
return child ? { parent: row.parentName, child } : void 0;
|
|
11897
11900
|
};
|
|
11898
|
-
const setEdgeExcluded = (edge, excluded) =>
|
|
11899
|
-
setExcludedEdges((prev) => {
|
|
11900
|
-
const next = new Set(prev);
|
|
11901
|
-
const key = slotEdgeKey(edge.parent, edge.child);
|
|
11902
|
-
if (excluded) next.add(key);
|
|
11903
|
-
else next.delete(key);
|
|
11904
|
-
return next;
|
|
11905
|
-
});
|
|
11906
|
-
};
|
|
11907
|
-
const confirmedEdges = (rejected) => {
|
|
11908
|
-
const rejectedSet = new Set(rejected);
|
|
11909
|
-
return [...excludedEdges].map((key) => {
|
|
11910
|
-
const [parent, child] = key.split("\u2192");
|
|
11911
|
-
return { parent, child };
|
|
11912
|
-
}).filter((edge) => !rejectedSet.has(edge.parent) && !rejectedSet.has(edge.child));
|
|
11913
|
-
};
|
|
11901
|
+
const setEdgeExcluded = (edge, excluded) => setExcludedEdges((prev) => withEdgeExcluded(prev, edge, excluded));
|
|
11914
11902
|
const jumpCursorTo = (name) => {
|
|
11915
11903
|
let idx = -1;
|
|
11916
11904
|
for (let i = 0; i < visibleRows.length; i++) {
|
|
@@ -12010,10 +11998,7 @@ function useScopeGate({ components, onConfirm, onQuit }) {
|
|
|
12010
11998
|
onQuit();
|
|
12011
11999
|
return;
|
|
12012
12000
|
case "confirm":
|
|
12013
|
-
|
|
12014
|
-
const partition = partitionDecisions(components, decisions);
|
|
12015
|
-
onConfirm({ ...partition, excludedSlotEdges: confirmedEdges(partition.rejected) });
|
|
12016
|
-
}
|
|
12001
|
+
onConfirm(partitionDecisions(components, decisions, excludedEdges));
|
|
12017
12002
|
return;
|
|
12018
12003
|
case "close-help":
|
|
12019
12004
|
setShowHelp(false);
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
|
|
3
3
|
import { type ComponentGraphNode, type NodeStatus } from '../../graph/composite-closure.js';
|
|
4
|
+
import type { ParentChildEdge } from '../../types.js';
|
|
4
5
|
import type { PreviewAnnotation, RenderStatus } from '../types.js';
|
|
5
6
|
export interface GroupedSidebarItem {
|
|
6
7
|
key: string;
|
|
@@ -27,8 +28,8 @@ export interface GroupedSidebarProps {
|
|
|
27
28
|
alwaysExpanded?: boolean;
|
|
28
29
|
showFlatTier?: boolean;
|
|
29
30
|
selectionStateByKey?: Map<string, 'accepted' | 'rejected' | 'undecided'>;
|
|
30
|
-
/**
|
|
31
|
-
excludedSlotEdges?:
|
|
31
|
+
/** Slot edges the user removed; their nested rows render unchecked. */
|
|
32
|
+
excludedSlotEdges?: ParentChildEdge[];
|
|
32
33
|
aiFlaggedByKey?: Map<string, boolean>;
|
|
33
34
|
dimPredicate?: (componentKey: string) => boolean;
|
|
34
35
|
viewMode?: 'grouped' | 'flat';
|
|
@@ -36,7 +37,6 @@ export interface GroupedSidebarProps {
|
|
|
36
37
|
graph: ComponentGraphNode[];
|
|
37
38
|
filterVisibleKeys?: Set<string>;
|
|
38
39
|
}
|
|
39
|
-
export declare function slotEdgeKey(parent: string, child: string): string;
|
|
40
40
|
type RowKind = 'cycle' | 'empty' | 'group-root' | 'group-child' | 'standalone' | 'flat' | 'flat-header';
|
|
41
41
|
export interface VisibleRow {
|
|
42
42
|
kind: RowKind;
|
|
@@ -48,7 +48,7 @@ export interface VisibleRow {
|
|
|
48
48
|
cycleChild?: boolean;
|
|
49
49
|
itemIdx: number;
|
|
50
50
|
rootName?: string;
|
|
51
|
-
/**
|
|
51
|
+
/** The parent whose slot the nested row sits in. */
|
|
52
52
|
parentName?: string;
|
|
53
53
|
}
|
|
54
54
|
export declare function buildVisibleRows(props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ScopeGraph } from './graph/index.js';
|
|
2
|
-
import type { Decision, ScopeComponent, ScopeDecisions } from './types.js';
|
|
2
|
+
import type { Decision, ParentChildEdge, ScopeComponent, ScopeDecisions } from './types.js';
|
|
3
3
|
export type DecisionState = Map<string, Decision>;
|
|
4
4
|
export type DecisionAction = {
|
|
5
5
|
type: 'accept';
|
|
@@ -15,5 +15,6 @@ export type DecisionAction = {
|
|
|
15
15
|
export declare function reduceDecisions(state: DecisionState, action: DecisionAction, components: ScopeComponent[], graph: ScopeGraph): DecisionState;
|
|
16
16
|
/** Whether rejecting `name` touches 2 or more other components, so the screen has to ask first. */
|
|
17
17
|
export declare function rejectNeedsConfirmation(graph: ScopeGraph, name: string, state: DecisionState): boolean;
|
|
18
|
+
export declare function withEdgeExcluded(edges: ParentChildEdge[], edge: ParentChildEdge, excluded: boolean): ParentChildEdge[];
|
|
18
19
|
/** Everything not accepted counts as rejected, as legacy's `partition` did. */
|
|
19
|
-
export declare function partitionDecisions(components: ScopeComponent[], state: DecisionState): ScopeDecisions;
|
|
20
|
+
export declare function partitionDecisions(components: ScopeComponent[], state: DecisionState, excludedEdges: ParentChildEdge[]): ScopeDecisions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ScopeComponent, ScopeDecisions } from './types.js';
|
|
1
|
+
import type { ParentChildEdge, ScopeComponent, ScopeDecisions } from './types.js';
|
|
2
2
|
interface UseScopeGateOptions {
|
|
3
3
|
components: ScopeComponent[];
|
|
4
4
|
onConfirm: (decisions: ScopeDecisions) => void;
|
|
@@ -20,7 +20,7 @@ export declare function useScopeGate({ components, onConfirm, onQuit }: UseScope
|
|
|
20
20
|
panelLayout: import("./columns.js").ScopeGatePanelLayout;
|
|
21
21
|
visibleCount: number;
|
|
22
22
|
panelMaxRows: number;
|
|
23
|
-
excludedEdges:
|
|
23
|
+
excludedEdges: ParentChildEdge[];
|
|
24
24
|
groupedItems: import("./graph/index.js").SidebarItem[];
|
|
25
25
|
graph: import("./graph/index.js").ScopeGraph;
|
|
26
26
|
hasGroupRoots: boolean;
|
|
@@ -28,7 +28,6 @@ export interface GroupedSidebarProps {
|
|
|
28
28
|
alwaysExpanded?: boolean;
|
|
29
29
|
showFlatTier?: boolean;
|
|
30
30
|
selectionStateByKey?: Map<string, 'accepted' | 'rejected' | 'undecided'>;
|
|
31
|
-
excludedSlotEdges?: Set<string>;
|
|
32
31
|
aiFlaggedByKey?: Map<string, boolean>;
|
|
33
32
|
dimPredicate?: (componentKey: string) => boolean;
|
|
34
33
|
viewMode?: 'grouped' | 'flat';
|
|
@@ -36,7 +35,6 @@ export interface GroupedSidebarProps {
|
|
|
36
35
|
graph: ComponentGraphNode[];
|
|
37
36
|
filterVisibleKeys?: Set<string>;
|
|
38
37
|
}
|
|
39
|
-
export declare function slotEdgeKey(parent: string, child: string): string;
|
|
40
38
|
type RowKind = 'cycle' | 'empty' | 'group-root' | 'group-child' | 'standalone' | 'flat' | 'flat-header';
|
|
41
39
|
export interface VisibleRow {
|
|
42
40
|
kind: RowKind;
|
|
@@ -48,7 +46,7 @@ export interface VisibleRow {
|
|
|
48
46
|
cycleChild?: boolean;
|
|
49
47
|
itemIdx: number;
|
|
50
48
|
rootName?: string;
|
|
51
|
-
/**
|
|
49
|
+
/** The parent whose slot the nested row sits in. */
|
|
52
50
|
parentName?: string;
|
|
53
51
|
}
|
|
54
52
|
export declare function buildVisibleRows(props: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ImportHandoff } from '@contentful/experience-design-system-types/handoff';
|
|
2
|
+
import type { ParentChildEdge } from '../../session/db.js';
|
|
2
3
|
/** The wizard state the early stages produce. Every field is one the stage used to write. */
|
|
3
4
|
export interface HandoffState {
|
|
4
5
|
credentialsSkipped: boolean;
|
|
@@ -18,10 +19,7 @@ export interface HandoffScope {
|
|
|
18
19
|
decisions: {
|
|
19
20
|
accepted: string[];
|
|
20
21
|
rejected: string[];
|
|
21
|
-
excludedSlotEdges:
|
|
22
|
-
parent: string;
|
|
23
|
-
child: string;
|
|
24
|
-
}>;
|
|
22
|
+
excludedSlotEdges: ParentChildEdge[];
|
|
25
23
|
};
|
|
26
24
|
/** Components the cache check (finished and restored before the wizard started) found already generated. */
|
|
27
25
|
cachedNames: string[];
|
package/legacy/dist/src/index.js
CHANGED
|
@@ -19418,9 +19418,6 @@ var init_Sidebar = __esm({
|
|
|
19418
19418
|
import figures from "figures";
|
|
19419
19419
|
import { Box as Box18, Text as Text19 } from "ink";
|
|
19420
19420
|
import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
19421
|
-
function slotEdgeKey(parent, child) {
|
|
19422
|
-
return `${parent}\u2192${child}`;
|
|
19423
|
-
}
|
|
19424
19421
|
function isEmpty(entry) {
|
|
19425
19422
|
return Object.keys(entry.$properties ?? {}).length === 0 && Object.keys(entry.$slots ?? {}).length === 0;
|
|
19426
19423
|
}
|
|
@@ -19832,7 +19829,6 @@ function GroupedSidebar(props) {
|
|
|
19832
19829
|
showFlatTier,
|
|
19833
19830
|
viewMode,
|
|
19834
19831
|
selectionStateByKey,
|
|
19835
|
-
excludedSlotEdges,
|
|
19836
19832
|
aiFlaggedByKey,
|
|
19837
19833
|
dimPredicate,
|
|
19838
19834
|
visibleRows: providedRows,
|
|
@@ -19863,8 +19859,7 @@ function GroupedSidebar(props) {
|
|
|
19863
19859
|
const badge = itemName ? previewBadge(previewAnnotationByKey?.get(itemName)) : null;
|
|
19864
19860
|
const showInheritance = rs !== void 0 && row.kind !== "cycle" && row.kind !== "empty" && row.kind !== "group-root";
|
|
19865
19861
|
const supportsSelectionGlyph = selectionStateByKey !== void 0 && itemName !== void 0 && (row.kind === "standalone" || row.kind === "group-root" || row.kind === "group-child" || row.kind === "flat" || row.kind === "empty" || row.kind === "cycle");
|
|
19866
|
-
const
|
|
19867
|
-
const selState = supportsSelectionGlyph ? edgeExcluded ? "undecided" : selectionStateByKey.get(itemName) ?? "undecided" : void 0;
|
|
19862
|
+
const selState = supportsSelectionGlyph ? selectionStateByKey.get(itemName) ?? "undecided" : void 0;
|
|
19868
19863
|
const isCycleRow = row.kind === "cycle";
|
|
19869
19864
|
const selStyle = selectionGlyphStyleFor(selState, isCycleRow);
|
|
19870
19865
|
const selGlyph = selStyle.glyph;
|
|
@@ -25279,55 +25274,50 @@ function GenerateReviewStepView({
|
|
|
25279
25274
|
const cycle = cycleRows[cyclesCursor];
|
|
25280
25275
|
return cycle ? enumerateCycleBreaks(cycle, components) : [];
|
|
25281
25276
|
}, [cycleRows, cyclesCursor, components]);
|
|
25282
|
-
const
|
|
25283
|
-
const target = components.find((component) => component.key === edge.fromComponent);
|
|
25284
|
-
const slot = target?.entry.$slots?.[edge.slotName];
|
|
25285
|
-
if (!target || !slot || !Array.isArray(slot.$allowedComponents)) return;
|
|
25286
|
-
const nextEntry = {
|
|
25287
|
-
...target.entry,
|
|
25288
|
-
$slots: {
|
|
25289
|
-
...target.entry.$slots,
|
|
25290
|
-
[edge.slotName]: {
|
|
25291
|
-
...slot,
|
|
25292
|
-
$allowedComponents: slot.$allowedComponents.filter((value) => value !== edge.toComponent)
|
|
25293
|
-
}
|
|
25294
|
-
}
|
|
25295
|
-
};
|
|
25277
|
+
const saveSlotChange = (parentKey, nextEntry, historyLabel) => {
|
|
25296
25278
|
const next = components.map(
|
|
25297
|
-
(component) => component.key ===
|
|
25279
|
+
(component) => component.key === parentKey ? { ...component, entry: nextEntry } : component
|
|
25298
25280
|
);
|
|
25299
25281
|
setComponents(next);
|
|
25300
25282
|
const db = openPipelineDb();
|
|
25301
25283
|
try {
|
|
25302
|
-
storeCDFComponents(db, extractSessionId, [{ key:
|
|
25284
|
+
storeCDFComponents(db, extractSessionId, [{ key: parentKey, entry: nextEntry }]);
|
|
25303
25285
|
} finally {
|
|
25304
25286
|
db.close();
|
|
25305
25287
|
}
|
|
25306
25288
|
recomputeCycles(next);
|
|
25307
25289
|
livePreviewHook.trigger();
|
|
25308
|
-
pushHistorySnapshot(next,
|
|
25290
|
+
pushHistorySnapshot(next, historyLabel);
|
|
25291
|
+
};
|
|
25292
|
+
const handleBreakEdge = (edge) => {
|
|
25293
|
+
const target = components.find((component) => component.key === edge.fromComponent);
|
|
25294
|
+
const slot = target?.entry.$slots?.[edge.slotName];
|
|
25295
|
+
if (!target || !slot || !Array.isArray(slot.$allowedComponents)) return;
|
|
25296
|
+
saveSlotChange(
|
|
25297
|
+
target.key,
|
|
25298
|
+
{
|
|
25299
|
+
...target.entry,
|
|
25300
|
+
$slots: {
|
|
25301
|
+
...target.entry.$slots,
|
|
25302
|
+
[edge.slotName]: {
|
|
25303
|
+
...slot,
|
|
25304
|
+
$allowedComponents: slot.$allowedComponents.filter((value) => value !== edge.toComponent)
|
|
25305
|
+
}
|
|
25306
|
+
}
|
|
25307
|
+
},
|
|
25308
|
+
"break-cycle-edge"
|
|
25309
|
+
);
|
|
25309
25310
|
};
|
|
25310
25311
|
const handleRemoveSlotChild = (parentKey, childKey) => {
|
|
25311
25312
|
const parent = components.find((component) => component.key === parentKey);
|
|
25312
25313
|
if (!parent?.entry.$slots) return;
|
|
25313
|
-
const slots =
|
|
25314
|
-
|
|
25315
|
-
|
|
25316
|
-
|
|
25317
|
-
|
|
25318
|
-
const next = components.map(
|
|
25319
|
-
(component) => component.key === parentKey ? { ...component, entry: nextEntry } : component
|
|
25314
|
+
const slots = Object.fromEntries(
|
|
25315
|
+
Object.entries(parent.entry.$slots).map(([slotName, slot]) => [
|
|
25316
|
+
slotName,
|
|
25317
|
+
Array.isArray(slot.$allowedComponents) ? { ...slot, $allowedComponents: slot.$allowedComponents.filter((value) => value !== childKey) } : slot
|
|
25318
|
+
])
|
|
25320
25319
|
);
|
|
25321
|
-
|
|
25322
|
-
const db = openPipelineDb();
|
|
25323
|
-
try {
|
|
25324
|
-
storeCDFComponents(db, extractSessionId, [{ key: parentKey, entry: nextEntry }]);
|
|
25325
|
-
} finally {
|
|
25326
|
-
db.close();
|
|
25327
|
-
}
|
|
25328
|
-
recomputeCycles(next);
|
|
25329
|
-
livePreviewHook.trigger();
|
|
25330
|
-
pushHistorySnapshot(next, "remove-slot-child");
|
|
25320
|
+
saveSlotChange(parentKey, { ...parent.entry, $slots: slots }, "remove-slot-child");
|
|
25331
25321
|
};
|
|
25332
25322
|
const handleRejectComponent = (key) => {
|
|
25333
25323
|
const rejectCascade = computeRejectCascade(key, componentGraph);
|
package/legacy/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.37.1-dev-build-
|
|
3
|
+
"version": "2.37.1-dev-build-444a2d6a.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -45,9 +45,9 @@
|
|
|
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-
|
|
50
|
-
"@contentful/experience-design-system-
|
|
48
|
+
"@contentful/experience-design-system-generation": "2.37.1-dev-build-444a2d6a.0",
|
|
49
|
+
"@contentful/experience-design-system-types": "2.37.1-dev-build-444a2d6a.0",
|
|
50
|
+
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-444a2d6a.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@tsconfig/node24": "^24.0.4",
|