@contentful/experience-design-system-cli 2.14.2 → 2.15.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/README.md +64 -2
- package/dist/package.json +3 -2
- package/dist/src/analyze/command.d.ts +11 -0
- package/dist/src/analyze/command.js +298 -3
- package/dist/src/analyze/composite-closure.d.ts +25 -0
- package/dist/src/analyze/composite-closure.js +0 -0
- package/dist/src/analyze/composition/agent-parser/author-prompt.d.ts +4 -0
- package/dist/src/analyze/composition/agent-parser/author-prompt.js +22 -0
- package/dist/src/analyze/composition/agent-parser/extract-parser.d.ts +8 -0
- package/dist/src/analyze/composition/agent-parser/extract-parser.js +44 -0
- package/dist/src/analyze/composition/agent-parser/load-prompt.d.ts +7 -0
- package/dist/src/analyze/composition/agent-parser/load-prompt.js +31 -0
- package/dist/src/analyze/composition/agent-parser/resolve-via-parser.d.ts +46 -0
- package/dist/src/analyze/composition/agent-parser/resolve-via-parser.js +88 -0
- package/dist/src/analyze/composition/agent-parser/sandbox.d.ts +45 -0
- package/dist/src/analyze/composition/agent-parser/sandbox.js +187 -0
- package/dist/src/analyze/composition/apply-mapping.d.ts +22 -0
- package/dist/src/analyze/composition/apply-mapping.js +67 -0
- package/dist/src/analyze/composition/candidate-critic-agent.d.ts +7 -0
- package/dist/src/analyze/composition/candidate-critic-agent.js +39 -0
- package/dist/src/analyze/composition/candidate-critic.d.ts +32 -0
- package/dist/src/analyze/composition/candidate-critic.js +63 -0
- package/dist/src/analyze/composition/candidate-files.d.ts +34 -0
- package/dist/src/analyze/composition/candidate-files.js +131 -0
- package/dist/src/analyze/composition/composition-cache-key.d.ts +19 -0
- package/dist/src/analyze/composition/composition-cache-key.js +19 -0
- package/dist/src/analyze/composition/interchange-schema.d.ts +37 -0
- package/dist/src/analyze/composition/interchange-schema.js +61 -0
- package/dist/src/analyze/composition/merge-edges.d.ts +19 -0
- package/dist/src/analyze/composition/merge-edges.js +50 -0
- package/dist/src/analyze/composition/parse-map-edges.d.ts +16 -0
- package/dist/src/analyze/composition/parse-map-edges.js +55 -0
- package/dist/src/analyze/composition/resolve-mapping-cli.d.ts +23 -0
- package/dist/src/analyze/composition/resolve-mapping-cli.js +29 -0
- package/dist/src/analyze/composition/resolve-mapping.d.ts +59 -0
- package/dist/src/analyze/composition/resolve-mapping.js +94 -0
- package/dist/src/analyze/cycle-detection.d.ts +27 -0
- package/dist/src/analyze/cycle-detection.js +234 -0
- package/dist/src/analyze/cycle-view.d.ts +7 -0
- package/dist/src/analyze/cycle-view.js +28 -0
- package/dist/src/analyze/fuzzy-search.d.ts +3 -0
- package/dist/src/analyze/fuzzy-search.js +55 -0
- package/dist/src/analyze/issue-inheritance.d.ts +12 -0
- package/dist/src/analyze/issue-inheritance.js +108 -0
- package/dist/src/analyze/lineage.d.ts +29 -0
- package/dist/src/analyze/lineage.js +0 -0
- package/dist/src/analyze/scope-gate-cascade.d.ts +11 -0
- package/dist/src/analyze/scope-gate-cascade.js +170 -0
- package/dist/src/analyze/search-neighborhood.d.ts +3 -0
- package/dist/src/analyze/search-neighborhood.js +56 -0
- package/dist/src/analyze/select/tui/App.js +5 -16
- package/dist/src/analyze/select/tui/components/ComponentRationalePanel.d.ts +0 -4
- package/dist/src/analyze/select/tui/components/ComponentRationalePanel.js +3 -15
- package/dist/src/analyze/select/tui/components/FieldEditor.d.ts +29 -38
- package/dist/src/analyze/select/tui/components/FieldEditor.js +309 -185
- package/dist/src/analyze/select/tui/components/FinalizeDialog.d.ts +13 -1
- package/dist/src/analyze/select/tui/components/FinalizeDialog.js +23 -2
- package/dist/src/analyze/select/tui/components/GotoBanner.d.ts +31 -0
- package/dist/src/analyze/select/tui/components/GotoBanner.js +30 -0
- package/dist/src/analyze/select/tui/components/GroupedSidebar.d.ts +91 -0
- package/dist/src/analyze/select/tui/components/GroupedSidebar.js +497 -0
- package/dist/src/analyze/select/tui/components/HelpOverlay.d.ts +13 -1
- package/dist/src/analyze/select/tui/components/HelpOverlay.js +9 -3
- package/dist/src/analyze/select/tui/components/JsonEditor.js +3 -3
- package/dist/src/analyze/select/tui/components/LineagePanel.d.ts +14 -0
- package/dist/src/analyze/select/tui/components/LineagePanel.js +22 -0
- package/dist/src/analyze/select/tui/components/RationalePanel.d.ts +0 -7
- package/dist/src/analyze/select/tui/components/RationalePanel.js +3 -15
- package/dist/src/analyze/select/tui/components/Sidebar.d.ts +0 -6
- package/dist/src/analyze/select/tui/components/Sidebar.js +11 -27
- package/dist/src/analyze/select/tui/components/StatusBar.js +2 -1
- package/dist/src/analyze/select/tui/components/removed-components-text.d.ts +7 -0
- package/dist/src/analyze/select/tui/components/removed-components-text.js +11 -0
- package/dist/src/analyze/select/tui/hooks/useImmediateInput.d.ts +1 -5
- package/dist/src/analyze/select/tui/hooks/useImmediateInput.js +8 -10
- package/dist/src/analyze/select/tui/theme.d.ts +15 -0
- package/dist/src/analyze/select/tui/theme.js +28 -0
- package/dist/src/analyze/selection-cascade.d.ts +3 -0
- package/dist/src/analyze/selection-cascade.js +19 -0
- package/dist/src/analyze/slot-graph.d.ts +11 -0
- package/dist/src/analyze/slot-graph.js +17 -0
- package/dist/src/apply/api-client.d.ts +2 -1
- package/dist/src/apply/api-client.js +40 -6
- package/dist/src/apply/command.d.ts +17 -1
- package/dist/src/apply/command.js +69 -11
- package/dist/src/apply/error-parser.d.ts +16 -0
- package/dist/src/apply/error-parser.js +117 -0
- package/dist/src/apply/tui/ServerPreviewView.js +3 -1
- package/dist/src/credentials-store.d.ts +6 -0
- package/dist/src/credentials-store.js +5 -1
- package/dist/src/generate/agent-runner.d.ts +6 -0
- package/dist/src/generate/agent-runner.js +24 -8
- package/dist/src/import/command.js +69 -31
- package/dist/src/import/cycle-auto-reject.d.ts +4 -0
- package/dist/src/import/cycle-auto-reject.js +14 -0
- package/dist/src/import/orchestrator.d.ts +20 -7
- package/dist/src/import/orchestrator.js +139 -35
- package/dist/src/import/strip-allowed-components.d.ts +18 -0
- package/dist/src/import/strip-allowed-components.js +22 -0
- package/dist/src/import/tui/CustomPromptBanner.d.ts +0 -5
- package/dist/src/import/tui/CustomPromptBanner.js +2 -1
- package/dist/src/import/tui/WizardApp.d.ts +10 -74
- package/dist/src/import/tui/WizardApp.js +234 -246
- package/dist/src/import/tui/ai-flag.d.ts +5 -0
- package/dist/src/import/tui/ai-flag.js +6 -0
- package/dist/src/import/tui/autocomplete.d.ts +5 -0
- package/dist/src/import/tui/autocomplete.js +32 -0
- package/dist/src/import/tui/components/AutoFilterBanner.d.ts +10 -0
- package/dist/src/import/tui/components/AutoFilterBanner.js +19 -0
- package/dist/src/import/tui/components/CounterStrip.d.ts +12 -0
- package/dist/src/import/tui/components/CounterStrip.js +12 -0
- package/dist/src/import/tui/components/LegendEntry.d.ts +2 -0
- package/dist/src/import/tui/components/LegendEntry.js +6 -0
- package/dist/src/import/tui/cycle-panel-scroll.d.ts +8 -0
- package/dist/src/import/tui/cycle-panel-scroll.js +33 -0
- package/dist/src/import/tui/final-review-host.d.ts +3 -7
- package/dist/src/import/tui/final-review-host.js +9 -4
- package/dist/src/import/tui/group-collapse.d.ts +2 -0
- package/dist/src/import/tui/group-collapse.js +11 -0
- package/dist/src/import/tui/history.d.ts +22 -0
- package/dist/src/import/tui/history.js +53 -0
- package/dist/src/import/tui/hooks/useLineage.d.ts +32 -0
- package/dist/src/import/tui/hooks/useLineage.js +50 -0
- package/dist/src/import/tui/hooks/useOverlayPanel.d.ts +13 -0
- package/dist/src/import/tui/hooks/useOverlayPanel.js +27 -0
- package/dist/src/import/tui/lineage-layout.d.ts +75 -0
- package/dist/src/import/tui/lineage-layout.js +82 -0
- package/dist/src/import/tui/runLivePreview.d.ts +11 -0
- package/dist/src/import/tui/runLivePreview.js +7 -1
- package/dist/src/import/tui/scope-gate-columns.d.ts +31 -0
- package/dist/src/import/tui/scope-gate-columns.js +94 -0
- package/dist/src/import/tui/scope-gate-host.d.ts +3 -1
- package/dist/src/import/tui/scope-gate-host.js +11 -3
- package/dist/src/import/tui/sidebar-width.d.ts +1 -0
- package/dist/src/import/tui/sidebar-width.js +3 -0
- package/dist/src/import/tui/step-filters.d.ts +19 -0
- package/dist/src/import/tui/step-filters.js +42 -0
- package/dist/src/import/tui/steps/AtomicGenerateReviewStep.d.ts +42 -0
- package/dist/src/import/tui/steps/AtomicGenerateReviewStep.js +726 -0
- package/dist/src/import/tui/steps/AtomicScopeGateStep.d.ts +3 -0
- package/dist/src/import/tui/steps/AtomicScopeGateStep.js +211 -0
- package/dist/src/import/tui/steps/CredentialsStep.js +5 -18
- package/dist/src/import/tui/steps/DoneStep.d.ts +0 -2
- package/dist/src/import/tui/steps/DoneStep.js +3 -2
- package/dist/src/import/tui/steps/ErrorStep.js +2 -1
- package/dist/src/import/tui/steps/GenerateReviewStep.d.ts +19 -25
- package/dist/src/import/tui/steps/GenerateReviewStep.js +1258 -229
- package/dist/src/import/tui/steps/PathValidationStep.js +3 -2
- package/dist/src/import/tui/steps/PreviewStep.js +2 -1
- package/dist/src/import/tui/steps/PushDecisionGateStep.d.ts +0 -7
- package/dist/src/import/tui/steps/PushDecisionGateStep.js +3 -6
- package/dist/src/import/tui/steps/PushingStep.js +2 -1
- package/dist/src/import/tui/steps/RunningStep.d.ts +4 -1
- package/dist/src/import/tui/steps/RunningStep.js +3 -2
- package/dist/src/import/tui/steps/ScopeGateStep.d.ts +24 -0
- package/dist/src/import/tui/steps/ScopeGateStep.js +850 -193
- package/dist/src/import/tui/steps/TokenInputStep.js +2 -1
- package/dist/src/import/tui/steps/WelcomeStep.js +2 -1
- package/dist/src/import/tui/steps/WizardPreviewStep.d.ts +6 -0
- package/dist/src/import/tui/steps/WizardPreviewStep.js +95 -56
- package/dist/src/import/tui/steps/auto-reject-decision.d.ts +7 -0
- package/dist/src/import/tui/steps/auto-reject-decision.js +9 -0
- package/dist/src/import/tui/steps/breaking-change-format.d.ts +2 -0
- package/dist/src/import/tui/steps/breaking-change-format.js +24 -0
- package/dist/src/import/tui/steps/enumerate-cycle-breaks.d.ts +14 -0
- package/dist/src/import/tui/steps/enumerate-cycle-breaks.js +0 -0
- package/dist/src/import/tui/steps/preview-diff.js +48 -5
- package/dist/src/import/tui/useFinalizePreview.d.ts +34 -0
- package/dist/src/import/tui/useFinalizePreview.js +0 -0
- package/dist/src/import/tui/useLivePreview.d.ts +3 -0
- package/dist/src/import/tui/useLivePreview.js +1 -0
- package/dist/src/import/tui/wizard-state-transitions.d.ts +5 -59
- package/dist/src/import/tui/wizard-state-transitions.js +5 -60
- package/dist/src/lib/composition-mode.d.ts +28 -0
- package/dist/src/lib/composition-mode.js +37 -0
- package/dist/src/lib/prompt-overrides.d.ts +38 -0
- package/dist/src/lib/prompt-overrides.js +69 -0
- package/dist/src/print/command.js +19 -1
- package/dist/src/runs/modify-launcher.d.ts +3 -0
- package/dist/src/runs/modify-launcher.js +2 -0
- package/dist/src/runs/replay-helpers.js +1 -0
- package/dist/src/runs/run-picker.js +2 -18
- package/dist/src/runs/store.d.ts +4 -0
- package/dist/src/session/db.d.ts +23 -40
- package/dist/src/session/db.js +110 -138
- package/dist/src/setup/composition-mode-prompt.d.ts +14 -0
- package/dist/src/setup/composition-mode-prompt.js +37 -0
- package/package.json +5 -4
- package/prompts/composition-dir-critic.md +7 -0
- package/prompts/composition-edges.md +8 -0
- package/prompts/composition-parser-repair-empty.md +1 -0
- package/prompts/composition-parser-repair-error.md +2 -0
- package/prompts/composition-parser.md +42 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Closure } from '../../analyze/composite-closure.js';
|
|
2
|
+
/** Structural subset of ScopeComponent needed by these helpers. */
|
|
3
|
+
export interface ScopeComponentLike {
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export type Decision = 'accepted' | 'rejected' | 'undecided';
|
|
7
|
+
export declare const THREE_COLUMN_MIN_WIDTH = 120;
|
|
8
|
+
export declare function computeColumnWidths(totalWidth: number): {
|
|
9
|
+
layout: 'single' | 'three-column';
|
|
10
|
+
main: number;
|
|
11
|
+
added: number;
|
|
12
|
+
groups: number;
|
|
13
|
+
};
|
|
14
|
+
export interface AddedComponentEntry {
|
|
15
|
+
name: string;
|
|
16
|
+
isCycle: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface AddedGroupEntry {
|
|
19
|
+
name: string;
|
|
20
|
+
depCount: number;
|
|
21
|
+
isCycle: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function buildAddedComponentsList(components: ScopeComponentLike[], stateByKey: Map<string, Decision>, cycleParticipants?: Set<string>): AddedComponentEntry[];
|
|
24
|
+
export declare function buildAddedGroupsList(closures: Map<string, Closure>, stateByKey: Map<string, Decision>, cycleParticipants?: Set<string>, cycleUnits?: Map<string, Set<string>>): AddedGroupEntry[];
|
|
25
|
+
export declare function computeCounters(components: ScopeComponentLike[], closures: Map<string, Closure>, stateByKey: Map<string, Decision>): {
|
|
26
|
+
accepted: number;
|
|
27
|
+
rejected: number;
|
|
28
|
+
undecided: number;
|
|
29
|
+
groups: number;
|
|
30
|
+
total: number;
|
|
31
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { computeSidebarWidth } from './sidebar-width.js';
|
|
2
|
+
export const THREE_COLUMN_MIN_WIDTH = 120;
|
|
3
|
+
export function computeColumnWidths(totalWidth) {
|
|
4
|
+
if (totalWidth < THREE_COLUMN_MIN_WIDTH) {
|
|
5
|
+
return { layout: 'single', main: computeSidebarWidth(totalWidth), added: 0, groups: 0 };
|
|
6
|
+
}
|
|
7
|
+
const main = computeSidebarWidth(totalWidth);
|
|
8
|
+
const remaining = Math.max(0, totalWidth - main - 4);
|
|
9
|
+
const added = Math.floor(remaining * 0.45);
|
|
10
|
+
const groups = Math.max(0, remaining - added - 2);
|
|
11
|
+
return { layout: 'three-column', main, added, groups };
|
|
12
|
+
}
|
|
13
|
+
export function buildAddedComponentsList(components, stateByKey, cycleParticipants = new Set()) {
|
|
14
|
+
const cycleTier = [];
|
|
15
|
+
const restTier = [];
|
|
16
|
+
// Selection state is keyed by name, so components sharing a name (real
|
|
17
|
+
// collisions across files) collapse to one accepted entry — dedupe by name
|
|
18
|
+
// to avoid duplicate rows and non-unique React keys downstream.
|
|
19
|
+
const seen = new Set();
|
|
20
|
+
for (const c of components) {
|
|
21
|
+
if (stateByKey.get(c.name) !== 'accepted')
|
|
22
|
+
continue;
|
|
23
|
+
if (seen.has(c.name))
|
|
24
|
+
continue;
|
|
25
|
+
seen.add(c.name);
|
|
26
|
+
if (cycleParticipants.has(c.name))
|
|
27
|
+
cycleTier.push({ name: c.name, isCycle: true });
|
|
28
|
+
else
|
|
29
|
+
restTier.push({ name: c.name, isCycle: false });
|
|
30
|
+
}
|
|
31
|
+
cycleTier.sort((a, b) => a.name.localeCompare(b.name));
|
|
32
|
+
restTier.sort((a, b) => a.name.localeCompare(b.name));
|
|
33
|
+
return [...cycleTier, ...restTier];
|
|
34
|
+
}
|
|
35
|
+
export function buildAddedGroupsList(closures, stateByKey, cycleParticipants = new Set(), cycleUnits = new Map()) {
|
|
36
|
+
const cycleTier = [];
|
|
37
|
+
const restTier = [];
|
|
38
|
+
const seenNames = new Set();
|
|
39
|
+
for (const [root, closure] of closures.entries()) {
|
|
40
|
+
if (closure.nodes.length <= 1)
|
|
41
|
+
continue;
|
|
42
|
+
if (stateByKey.get(root) !== 'accepted')
|
|
43
|
+
continue;
|
|
44
|
+
const entry = {
|
|
45
|
+
name: root,
|
|
46
|
+
depCount: closure.nodes.length - 1,
|
|
47
|
+
isCycle: cycleParticipants.has(root),
|
|
48
|
+
};
|
|
49
|
+
if (entry.isCycle)
|
|
50
|
+
cycleTier.push(entry);
|
|
51
|
+
else
|
|
52
|
+
restTier.push(entry);
|
|
53
|
+
seenNames.add(root);
|
|
54
|
+
}
|
|
55
|
+
const seenUnits = new Set();
|
|
56
|
+
for (const unit of cycleUnits.values()) {
|
|
57
|
+
if (seenUnits.has(unit))
|
|
58
|
+
continue;
|
|
59
|
+
seenUnits.add(unit);
|
|
60
|
+
for (const member of unit) {
|
|
61
|
+
if (stateByKey.get(member) !== 'accepted')
|
|
62
|
+
continue;
|
|
63
|
+
if (seenNames.has(member))
|
|
64
|
+
continue;
|
|
65
|
+
seenNames.add(member);
|
|
66
|
+
cycleTier.push({ name: member, depCount: unit.size - 1, isCycle: true });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
cycleTier.sort((a, b) => a.name.localeCompare(b.name));
|
|
70
|
+
restTier.sort((a, b) => a.name.localeCompare(b.name));
|
|
71
|
+
return [...cycleTier, ...restTier];
|
|
72
|
+
}
|
|
73
|
+
export function computeCounters(components, closures, stateByKey) {
|
|
74
|
+
let accepted = 0;
|
|
75
|
+
let rejected = 0;
|
|
76
|
+
let undecided = 0;
|
|
77
|
+
for (const c of components) {
|
|
78
|
+
const s = stateByKey.get(c.name) ?? 'undecided';
|
|
79
|
+
if (s === 'accepted')
|
|
80
|
+
accepted++;
|
|
81
|
+
else if (s === 'rejected')
|
|
82
|
+
rejected++;
|
|
83
|
+
else
|
|
84
|
+
undecided++;
|
|
85
|
+
}
|
|
86
|
+
let groups = 0;
|
|
87
|
+
for (const [root, closure] of closures.entries()) {
|
|
88
|
+
if (closure.nodes.length <= 1)
|
|
89
|
+
continue;
|
|
90
|
+
if (stateByKey.get(root) === 'accepted')
|
|
91
|
+
groups++;
|
|
92
|
+
}
|
|
93
|
+
return { accepted, rejected, undecided, groups, total: components.length };
|
|
94
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ScopeComponent } from './steps/ScopeGateStep.js';
|
|
3
|
+
import type { CompositionMode } from '../../lib/composition-mode.js';
|
|
3
4
|
export type { ScopeComponent };
|
|
4
5
|
export type AutoFilterStatus = 'idle' | 'running' | 'complete' | 'cancelled' | 'failed';
|
|
5
6
|
export type ScopeGateHostProps = {
|
|
6
7
|
components: ReadonlyArray<ScopeComponent>;
|
|
7
8
|
autoAccept: boolean;
|
|
9
|
+
compositionMode?: CompositionMode;
|
|
8
10
|
onConfirm: (decisions: {
|
|
9
11
|
accepted: string[];
|
|
10
12
|
rejected: string[];
|
|
@@ -18,4 +20,4 @@ export type ScopeGateHostProps = {
|
|
|
18
20
|
aiFilterError?: string | null;
|
|
19
21
|
onCancelAutoFilter?: () => void;
|
|
20
22
|
};
|
|
21
|
-
export declare function ScopeGateHost({ components, autoAccept, onConfirm, onQuit, aiFilterStatus, aiFilterProgress, aiFilterError, onCancelAutoFilter, }: ScopeGateHostProps): React.ReactElement;
|
|
23
|
+
export declare function ScopeGateHost({ components, autoAccept, compositionMode, onConfirm, onQuit, aiFilterStatus, aiFilterProgress, aiFilterError, onCancelAutoFilter, }: ScopeGateHostProps): React.ReactElement;
|
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
|
+
import { PALETTE } from '../../analyze/select/tui/theme.js';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { ScopeGateStep } from './steps/ScopeGateStep.js';
|
|
5
|
-
|
|
6
|
+
import { AtomicScopeGateStep } from './steps/AtomicScopeGateStep.js';
|
|
7
|
+
export function ScopeGateHost({ components, autoAccept, compositionMode = 'atomic', onConfirm, onQuit, aiFilterStatus = 'idle', aiFilterProgress = null, aiFilterError = null, onCancelAutoFilter, }) {
|
|
6
8
|
if (components.length === 0) {
|
|
7
|
-
return (_jsx(Box, { paddingX: 2, paddingY: 1, children: _jsx(Text, { color:
|
|
9
|
+
return (_jsx(Box, { paddingX: 2, paddingY: 1, children: _jsx(Text, { color: PALETTE.error, children: "Error: no components found for this session \u2014 please re-run analyze extract." }) }));
|
|
8
10
|
}
|
|
9
11
|
if (autoAccept) {
|
|
10
12
|
return _jsx(ScopeGateAutoAccept, { components: components, onConfirm: onConfirm });
|
|
11
13
|
}
|
|
14
|
+
// Atomic mode (spec T9): render the pre-composite flat step. It never imports
|
|
15
|
+
// the graph/closures/cycles/cascade primitives, so this host fork is the
|
|
16
|
+
// single point where "atomic bypasses the graph" is guaranteed on the
|
|
17
|
+
// interactive path.
|
|
18
|
+
if (compositionMode === 'atomic') {
|
|
19
|
+
return (_jsx(AtomicScopeGateStep, { components: [...components], onConfirm: onConfirm, onQuit: onQuit, aiFilterStatus: aiFilterStatus, aiFilterProgress: aiFilterProgress, aiFilterError: aiFilterError, onCancelAutoFilter: onCancelAutoFilter }));
|
|
20
|
+
}
|
|
12
21
|
return (_jsx(ScopeGateStep, { components: [...components], onConfirm: onConfirm, onQuit: onQuit, aiFilterStatus: aiFilterStatus, aiFilterProgress: aiFilterProgress, aiFilterError: aiFilterError, onCancelAutoFilter: onCancelAutoFilter }));
|
|
13
22
|
}
|
|
14
23
|
function ScopeGateAutoAccept({ components, onConfirm, }) {
|
|
15
24
|
React.useEffect(() => {
|
|
16
25
|
onConfirm({ accepted: components.map((c) => c.name), rejected: [] });
|
|
17
|
-
// fire once on mount; deps intentionally empty so a re-render with new components doesn't double-confirm
|
|
18
26
|
}, []);
|
|
19
27
|
return (_jsx(Box, { paddingX: 2, paddingY: 1, children: _jsxs(Text, { dimColor: true, children: ["Auto-accepting ", components.length, " components..."] }) }));
|
|
20
28
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function computeSidebarWidth(terminalWidth: number): number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type FilterCategory = 'broken' | 'cycles' | 'deleted';
|
|
2
|
+
export interface FilterDataSources {
|
|
3
|
+
/** Component keys that participate in a slot cycle. */
|
|
4
|
+
cycles?: Iterable<string>;
|
|
5
|
+
/** Component keys the step considers "broken" (issue/warning/AI-flagged). */
|
|
6
|
+
broken?: Iterable<string>;
|
|
7
|
+
/** Component keys marked for deletion (GenerateReview only). */
|
|
8
|
+
deleted?: Iterable<string>;
|
|
9
|
+
}
|
|
10
|
+
export declare function computeFilterKeys(input: {
|
|
11
|
+
filters: Iterable<FilterCategory>;
|
|
12
|
+
data: FilterDataSources;
|
|
13
|
+
}): Set<string> | undefined;
|
|
14
|
+
export declare function intersectFilterKeys(a: Set<string> | undefined, b: Set<string> | undefined): Set<string> | undefined;
|
|
15
|
+
export declare function buildFlatDimPredicate(input: {
|
|
16
|
+
viewMode: 'grouped' | 'flat';
|
|
17
|
+
searchQuery: string;
|
|
18
|
+
filterVisibleKeys: Set<string> | undefined;
|
|
19
|
+
}): ((componentKey: string) => boolean) | undefined;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { fuzzyMatches } from '../../analyze/fuzzy-search.js';
|
|
2
|
+
export function computeFilterKeys(input) {
|
|
3
|
+
const active = new Set(input.filters);
|
|
4
|
+
if (active.size === 0)
|
|
5
|
+
return undefined;
|
|
6
|
+
const out = new Set();
|
|
7
|
+
if (active.has('cycles'))
|
|
8
|
+
for (const k of input.data.cycles ?? [])
|
|
9
|
+
out.add(k);
|
|
10
|
+
if (active.has('broken'))
|
|
11
|
+
for (const k of input.data.broken ?? [])
|
|
12
|
+
out.add(k);
|
|
13
|
+
if (active.has('deleted'))
|
|
14
|
+
for (const k of input.data.deleted ?? [])
|
|
15
|
+
out.add(k);
|
|
16
|
+
return out;
|
|
17
|
+
}
|
|
18
|
+
export function intersectFilterKeys(a, b) {
|
|
19
|
+
if (a === undefined)
|
|
20
|
+
return b;
|
|
21
|
+
if (b === undefined)
|
|
22
|
+
return a;
|
|
23
|
+
const out = new Set();
|
|
24
|
+
for (const k of a)
|
|
25
|
+
if (b.has(k))
|
|
26
|
+
out.add(k);
|
|
27
|
+
return out;
|
|
28
|
+
}
|
|
29
|
+
export function buildFlatDimPredicate(input) {
|
|
30
|
+
const hasSearch = input.searchQuery.length > 0;
|
|
31
|
+
const isFlat = input.viewMode === 'flat';
|
|
32
|
+
const keys = isFlat ? input.filterVisibleKeys : undefined;
|
|
33
|
+
if (!hasSearch && keys === undefined)
|
|
34
|
+
return undefined;
|
|
35
|
+
return (name) => {
|
|
36
|
+
if (hasSearch && !fuzzyMatches(input.searchQuery, name))
|
|
37
|
+
return true;
|
|
38
|
+
if (keys !== undefined && !keys.has(name))
|
|
39
|
+
return true;
|
|
40
|
+
return false;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
|
|
3
|
+
type GenerateReviewStepProps = {
|
|
4
|
+
extractSessionId: string;
|
|
5
|
+
onFinalize: (accepted: number, rejected: number, unresolved: number) => void;
|
|
6
|
+
onQuit: () => void;
|
|
7
|
+
/**
|
|
8
|
+
* Feature 2 (live preview after every save). When `true` (default), the
|
|
9
|
+
* wizard re-runs `previewImport` after each successful FieldEditor Ctrl+S
|
|
10
|
+
* (debounced 500ms) and refreshes the sidebar's previewAnnotation badges.
|
|
11
|
+
* Operator opts out via `experiences import --no-live-preview`.
|
|
12
|
+
*/
|
|
13
|
+
livePreview?: boolean;
|
|
14
|
+
spaceId?: string;
|
|
15
|
+
environmentId?: string;
|
|
16
|
+
cmaToken?: string;
|
|
17
|
+
host?: string;
|
|
18
|
+
tokensPath?: string;
|
|
19
|
+
/**
|
|
20
|
+
* INTEG-4411 refined: initial value for the inline `finalizeError` banner.
|
|
21
|
+
* The wizard sets this when it routes back to `final-review` after the
|
|
22
|
+
* preview API returned an empty diff (pure no-op push). Cleared on the
|
|
23
|
+
* next `a` / `A` keystroke.
|
|
24
|
+
*/
|
|
25
|
+
initialFinalizeError?: string | null;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Sort components for the final-review sidebar so the underlying data array
|
|
29
|
+
* matches the visual order. Empty components (zero classified $properties)
|
|
30
|
+
* surface at the top via the warning-tier path in Sidebar.tsx; we mirror that
|
|
31
|
+
* here so `selectedIdx` indexes into the same order the user sees. Without
|
|
32
|
+
* this, j/k navigation lands on different rows than the visually-selected
|
|
33
|
+
* one (INTEG-4259).
|
|
34
|
+
*
|
|
35
|
+
* Within each tier (empty / non-empty) we tie-break alphabetically by `key`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function sortComponentsForSidebar<T extends {
|
|
38
|
+
key: string;
|
|
39
|
+
entry: CDFComponentEntry;
|
|
40
|
+
}>(components: T[]): T[];
|
|
41
|
+
export declare function AtomicGenerateReviewStep({ extractSessionId, onFinalize, onQuit, livePreview, spaceId, environmentId, cmaToken, host, tokensPath, initialFinalizeError, }: GenerateReviewStepProps): React.ReactElement;
|
|
42
|
+
export {};
|