@contentful/experience-design-system-cli 2.37.1-dev-build-dbc9f30e.0 → 2.37.1-dev-build-8b126ca1.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.d.ts +2 -6
- package/dist/app.js +8558 -448
- package/dist/index.js +9021 -516
- package/dist/package.json +1 -1
- package/dist/src/commands/import-options.d.ts +0 -1
- package/dist/src/tui/import/steps/07-scope-gate/graph/cycle-detection.d.ts +5 -0
- package/dist/src/tui/import/steps/09-review/components/ComponentRationalePanel.d.ts +10 -0
- package/dist/src/tui/import/steps/09-review/components/FieldEditor.d.ts +67 -0
- package/dist/src/tui/import/steps/09-review/components/FinalizeDialog.d.ts +22 -0
- package/dist/src/tui/import/steps/09-review/components/HighlightedLine.d.ts +9 -0
- package/dist/src/tui/import/steps/09-review/components/JsonPanel.d.ts +11 -0
- package/dist/src/tui/import/steps/09-review/components/LivePreviewSummary.d.ts +14 -0
- package/dist/src/tui/import/steps/09-review/components/QuitDialog.d.ts +8 -0
- package/dist/src/tui/import/steps/09-review/components/RationaleLine.d.ts +21 -0
- package/dist/src/tui/import/steps/09-review/components/RationalePanel.d.ts +15 -0
- package/dist/src/tui/import/steps/09-review/components/ReviewComponentPanel.d.ts +33 -0
- package/dist/src/tui/import/steps/09-review/components/ReviewDetailsEditor.d.ts +15 -0
- package/dist/src/tui/import/steps/09-review/components/ReviewDialogs.d.ts +28 -0
- package/dist/src/tui/import/steps/09-review/components/ReviewStatus.d.ts +15 -0
- package/dist/src/tui/import/steps/09-review/components/ScrollablePanel.d.ts +14 -0
- package/dist/src/tui/import/steps/09-review/components/TokenReviewPanel.d.ts +30 -0
- package/dist/src/tui/import/steps/09-review/components/removed-components-text.d.ts +7 -0
- package/dist/src/tui/import/steps/09-review/components/wrap-text.d.ts +1 -0
- package/dist/src/tui/import/steps/09-review/generate-review-step.d.ts +37 -0
- package/dist/src/tui/import/steps/09-review/graph/cycle-auto-reject.d.ts +4 -0
- package/dist/src/tui/import/steps/09-review/graph/cycle-view.d.ts +7 -0
- package/dist/src/tui/import/steps/09-review/graph/issue-inheritance.d.ts +8 -0
- package/dist/src/tui/import/steps/09-review/graph/selection-cascade.d.ts +3 -0
- package/dist/src/tui/import/steps/09-review/helpers/auto-reject-decision.d.ts +7 -0
- package/dist/src/tui/import/steps/09-review/helpers/breaking-change-format.d.ts +2 -0
- package/dist/src/tui/import/steps/09-review/helpers/cycle-panel-scroll.d.ts +8 -0
- package/dist/src/tui/import/steps/09-review/helpers/enumerate-cycle-breaks.d.ts +14 -0
- package/dist/src/tui/import/steps/09-review/helpers/sidebar-width.d.ts +1 -0
- package/dist/src/tui/import/steps/09-review/history.d.ts +23 -0
- package/dist/src/tui/import/steps/09-review/preview-annotations.d.ts +26 -0
- package/dist/src/tui/import/steps/09-review/review-details-panel.d.ts +26 -0
- package/dist/src/tui/import/steps/09-review/review-input.d.ts +39 -0
- package/dist/src/tui/import/steps/09-review/review-json-panel.d.ts +7 -0
- package/dist/src/tui/import/steps/09-review/run-live-preview.d.ts +45 -0
- package/dist/src/tui/import/steps/09-review/scroll-offset.d.ts +30 -0
- package/dist/src/tui/import/steps/09-review/session.d.ts +26 -0
- package/dist/src/tui/import/steps/09-review/theme.d.ts +9 -0
- package/dist/src/tui/import/steps/09-review/token-suggestions.d.ts +8 -0
- package/dist/src/tui/import/steps/09-review/types.d.ts +19 -0
- package/dist/src/tui/import/steps/09-review/use-finalize-preview.d.ts +39 -0
- package/dist/src/tui/import/steps/09-review/use-live-preview.d.ts +39 -0
- package/dist/src/tui/import/steps/09-review/use-review-editor.d.ts +47 -0
- package/dist/src/tui/import/steps/09-review/use-review-preview.d.ts +25 -0
- package/dist/src/tui/import/steps/09-review/use-review-session.d.ts +65 -0
- package/dist/src/tui/import/steps/09-review/use-review-surface-state.d.ts +12 -0
- package/dist/src/tui/import/steps/10-flow/components/CustomPromptBanner.d.ts +5 -0
- package/dist/src/tui/import/steps/10-flow/components/SpaceEnvironment.d.ts +7 -0
- package/dist/src/tui/import/steps/10-flow/components/StepHeader.d.ts +8 -0
- package/dist/src/tui/import/steps/10-flow/flow/build-flow-start.d.ts +21 -0
- package/dist/src/tui/import/steps/10-flow/flow/controller.d.ts +65 -0
- package/dist/src/tui/import/steps/10-flow/flow/preview.d.ts +56 -0
- package/dist/src/tui/import/steps/10-flow/flow/push.d.ts +43 -0
- package/dist/src/tui/import/steps/10-flow/flow/save.d.ts +50 -0
- package/dist/src/tui/import/steps/10-flow/flow/screen.d.ts +17 -0
- package/dist/src/tui/import/steps/10-flow/flow/types.d.ts +71 -0
- package/dist/src/tui/import/steps/10-flow/flow/use-flow.d.ts +9 -0
- package/dist/src/tui/import/steps/10-flow/screens/DoneStep.d.ts +28 -0
- package/dist/src/tui/import/steps/10-flow/screens/PathPrompt.d.ts +8 -0
- package/dist/src/tui/import/steps/10-flow/screens/PushingStep.d.ts +9 -0
- package/dist/src/tui/import/steps/10-flow/screens/WizardPreviewStep.d.ts +20 -0
- package/dist/src/tui/import/steps/10-flow/support/contentful-urls.d.ts +15 -0
- package/dist/src/tui/import/steps/10-flow/support/path-utils.d.ts +15 -0
- package/dist/src/tui/import/steps/10-flow/support/preview-confirmation-input.d.ts +5 -0
- package/dist/src/tui/import/steps/10-flow/support/preview-diff.d.ts +10 -0
- package/dist/src/tui/import/steps/10-flow/support/push-progress.d.ts +9 -0
- package/dist/src/tui/import/steps/10-flow/support/run-print-files-helpers.d.ts +26 -0
- package/dist/src/tui/import/steps/10-flow/support/run-teaser.d.ts +5 -0
- package/dist/src/tui/import/steps/10-flow/support/use-blinking-cursor.d.ts +1 -0
- package/dist/src/tui/import/steps/10-flow/support/use-timed-spinner.d.ts +4 -0
- package/dist/src/tui/import/steps/10-flow/support/wizard-state-transitions.d.ts +17 -0
- package/dist/src/tui/import/steps/10-flow/theme.d.ts +13 -0
- package/dist/src/tui/import/steps/preview-validation-error/logic.d.ts +12 -0
- package/dist/src/tui/import/steps/preview-validation-error/screen.d.ts +11 -0
- package/dist/src/tui/user-agent.d.ts +5 -0
- package/legacy/package.json +1 -1
- package/package.json +4 -4
- package/dist/src/tui/import/spawn-v1-import.d.ts +0 -36
- package/dist/src/tui/import/terminal-input.d.ts +0 -2
package/dist/package.json
CHANGED
|
@@ -20,3 +20,8 @@ export interface ComponentSlotInfo {
|
|
|
20
20
|
export declare function findSlotCycles(components: ComponentSlotInfo[]): SlotCycle[];
|
|
21
21
|
export declare function suggestCycleBreakEdge(cycle: SlotCycle, allCycles: SlotCycle[]): SlotEdge;
|
|
22
22
|
export declare function formatCyclePath(cycle: SlotCycle, maxHops?: number): string;
|
|
23
|
+
export interface CyclePathSegment {
|
|
24
|
+
kind: 'component' | 'slot' | 'arrow';
|
|
25
|
+
text: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function formatCyclePathSegments(cycle: SlotCycle, maxHops?: number): CyclePathSegment[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ComponentRationale } from '@contentful/experience-design-system-backend-pipeline';
|
|
3
|
+
export type ComponentRationalePanelProps = {
|
|
4
|
+
data: ComponentRationale;
|
|
5
|
+
scrollOffset: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
active: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function ComponentRationalePanel({ data, scrollOffset, width, height, active, }: ComponentRationalePanelProps): React.ReactElement;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { findSlotCycles, type ComponentSlotInfo } from '../../07-scope-gate/graph/cycle-detection.js';
|
|
3
|
+
type PropMetadata = {
|
|
4
|
+
rationale?: string | null;
|
|
5
|
+
sourceStartLine?: number | null;
|
|
6
|
+
sourceEndLine?: number | null;
|
|
7
|
+
};
|
|
8
|
+
export type FieldEditorMetadata = {
|
|
9
|
+
/** Absolute path to the component's source file. Null/undefined = unknown. */
|
|
10
|
+
sourcePath?: string | null;
|
|
11
|
+
/** Full source text of the component (used by the source-view panel). */
|
|
12
|
+
componentSource?: string | null;
|
|
13
|
+
/** Per-prop metadata keyed by prop name. */
|
|
14
|
+
props?: Record<string, PropMetadata>;
|
|
15
|
+
};
|
|
16
|
+
export type FieldEditorProps = {
|
|
17
|
+
value: string;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
fixedHeight?: boolean;
|
|
21
|
+
active?: boolean;
|
|
22
|
+
onChange: (value: string) => void;
|
|
23
|
+
onSave: () => void;
|
|
24
|
+
onDiscard: () => void;
|
|
25
|
+
onExit?: () => void;
|
|
26
|
+
metadata?: FieldEditorMetadata;
|
|
27
|
+
onTogglePropRationale?: () => void;
|
|
28
|
+
propRationaleKey?: string;
|
|
29
|
+
onToggleComponentRationale?: () => void;
|
|
30
|
+
componentRationaleKey?: string;
|
|
31
|
+
onToggleSourceExternal?: () => void;
|
|
32
|
+
onTextEntryActiveChange?: (active: boolean) => void;
|
|
33
|
+
projectSlotGraph?: ComponentSlotInfo[];
|
|
34
|
+
currentComponentName?: string;
|
|
35
|
+
onDirtyChange?: (isDirty: boolean) => void;
|
|
36
|
+
discardTrigger?: number;
|
|
37
|
+
initialFocusTarget?: {
|
|
38
|
+
kind: 'description';
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'prop' | 'slot';
|
|
41
|
+
name: string;
|
|
42
|
+
};
|
|
43
|
+
showHiddenProps?: boolean;
|
|
44
|
+
showInlineRationales?: boolean;
|
|
45
|
+
/** Pinned inside the box above the rows, in row and field-edit modes. Counts as `headerHeight` rows. */
|
|
46
|
+
header?: React.ReactNode;
|
|
47
|
+
headerHeight?: number;
|
|
48
|
+
};
|
|
49
|
+
export declare function simulateGraphWithCandidate(projectSlotGraph: ComponentSlotInfo[], selfName: string, currentSlots: {
|
|
50
|
+
name: string;
|
|
51
|
+
allowedComponents: string[];
|
|
52
|
+
}[], targetSlotName: string, candidate: string): ComponentSlotInfo[];
|
|
53
|
+
export declare function introducesNewCycle(before: ReturnType<typeof findSlotCycles>, next: ReturnType<typeof findSlotCycles>): boolean;
|
|
54
|
+
export declare function computeAllowedComponentCandidates(projectSlotGraph: ComponentSlotInfo[], selfName: string, currentSlots: {
|
|
55
|
+
name: string;
|
|
56
|
+
allowedComponents: string[];
|
|
57
|
+
}[], targetSlotName: string): string[];
|
|
58
|
+
export declare function simulateGraphWithReplacement(projectSlotGraph: ComponentSlotInfo[], selfName: string, currentSlots: {
|
|
59
|
+
name: string;
|
|
60
|
+
allowedComponents: string[];
|
|
61
|
+
}[], targetSlotName: string, replaceIndex: number, candidate: string): ComponentSlotInfo[];
|
|
62
|
+
export declare function computeAllowedComponentReplacementCandidates(projectSlotGraph: ComponentSlotInfo[], selfName: string, currentSlots: {
|
|
63
|
+
name: string;
|
|
64
|
+
allowedComponents: string[];
|
|
65
|
+
}[], targetSlotName: string, replaceIndex: number): string[];
|
|
66
|
+
export declare function FieldEditor({ value, width, height, fixedHeight, active, onChange, onSave, onDiscard, onExit, metadata, onTogglePropRationale, propRationaleKey, onToggleComponentRationale, componentRationaleKey, onToggleSourceExternal, onTextEntryActiveChange, projectSlotGraph, currentComponentName, onDirtyChange, discardTrigger, initialFocusTarget, showHiddenProps, showInlineRationales, header, headerHeight, }: FieldEditorProps): React.ReactElement;
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ComponentTypeSummary } from '@contentful/experience-design-system-types';
|
|
3
|
+
/** Max removed-component lines shown at once; the rest scroll with arrow keys.
|
|
4
|
+
* Exported so the parent's scroll-offset clamping stays in sync. */
|
|
5
|
+
export declare const FINALIZE_REMOVED_WINDOW = 6;
|
|
6
|
+
type FinalizeDialogProps = {
|
|
7
|
+
accepted: number;
|
|
8
|
+
rejected: number;
|
|
9
|
+
needsReview: number;
|
|
10
|
+
onConfirm: () => void;
|
|
11
|
+
onCancel: () => void;
|
|
12
|
+
/** Components that will be DELETED from the target space on push, from a
|
|
13
|
+
* preview scoped to the accepted set. */
|
|
14
|
+
removed?: ComponentTypeSummary[];
|
|
15
|
+
/** Status of the accepted-set preview fired when the dialog opened. While
|
|
16
|
+
* 'running', the deletion section shows a spinner instead of a (stale) list. */
|
|
17
|
+
previewStatus?: 'idle' | 'running' | 'done' | 'error';
|
|
18
|
+
/** Scroll offset into the removed list (owned by the parent; arrow keys adjust it). */
|
|
19
|
+
removedScrollOffset?: number;
|
|
20
|
+
};
|
|
21
|
+
export declare function FinalizeDialog({ accepted, rejected, needsReview, onConfirm, onCancel, removed, previewStatus, removedScrollOffset, }: FinalizeDialogProps): React.ReactElement;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type JsonPanelProps = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
scrollOffset: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
active: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function JsonPanel({ label, value, scrollOffset, width, height, active }: JsonPanelProps): React.ReactElement;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PreviewAnnotation } from '../types.js';
|
|
3
|
+
import type { UseLivePreviewReturn } from '../use-live-preview.js';
|
|
4
|
+
type LivePreviewSummaryProps = {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
previewAnnotations: ReadonlyMap<string, PreviewAnnotation>;
|
|
7
|
+
status: UseLivePreviewReturn['status'];
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
spinner: string;
|
|
10
|
+
removedCount?: number;
|
|
11
|
+
showRemovedListHint?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare function LivePreviewSummary({ enabled, previewAnnotations, status, disabled, spinner, removedCount, showRemovedListHint, }: LivePreviewSummaryProps): React.ReactElement | null;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type QuitDialogProps = {
|
|
3
|
+
hasUnsavedDrafts: boolean;
|
|
4
|
+
onConfirm: () => void;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }: QuitDialogProps): React.ReactElement;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type RationaleLineData = {
|
|
3
|
+
kind: 'heading';
|
|
4
|
+
text: string;
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'text';
|
|
7
|
+
text: string;
|
|
8
|
+
dim?: boolean;
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'label';
|
|
11
|
+
text: string;
|
|
12
|
+
prefix?: string;
|
|
13
|
+
suffix?: string;
|
|
14
|
+
color?: string;
|
|
15
|
+
} | {
|
|
16
|
+
kind: 'blank';
|
|
17
|
+
};
|
|
18
|
+
export declare function RationaleLine({ line, active }: {
|
|
19
|
+
line: RationaleLineData;
|
|
20
|
+
active: boolean;
|
|
21
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type RationaleRow = {
|
|
3
|
+
name: string;
|
|
4
|
+
kind: 'prop' | 'slot';
|
|
5
|
+
rationale: string;
|
|
6
|
+
};
|
|
7
|
+
export type RationalePanelProps = {
|
|
8
|
+
componentName: string;
|
|
9
|
+
rows: RationaleRow[];
|
|
10
|
+
scrollOffset: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
active: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare function RationalePanel({ componentName, rows, scrollOffset, width, height, active, }: RationalePanelProps): React.ReactElement;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
|
|
3
|
+
import type { CdfReviewEntry } from '../types.js';
|
|
4
|
+
import type { UseReviewEditorResult } from '../use-review-editor.js';
|
|
5
|
+
import type { UseLivePreviewReturn } from '../use-live-preview.js';
|
|
6
|
+
import { type ReviewDetailsEditorProps } from './ReviewDetailsEditor.js';
|
|
7
|
+
type ReviewDetailsEditorConfig = Pick<ReviewDetailsEditorProps, 'componentRationale' | 'reviewMetadata' | 'reviewEditor' | 'width' | 'height' | 'sourceBorderColor' | 'jsonValue' | 'sidebarFocused' | 'fieldEditor'>;
|
|
8
|
+
export type ReviewComponentPanelProps = ReviewDetailsEditorConfig & {
|
|
9
|
+
selectedKey: string;
|
|
10
|
+
selectedEntry: CDFComponentEntry;
|
|
11
|
+
saveError: string | null;
|
|
12
|
+
sidebarFooter?: React.ReactNode;
|
|
13
|
+
livePreview: Pick<UseLivePreviewReturn, 'status' | 'disabled'>;
|
|
14
|
+
livePreviewSpinner: string;
|
|
15
|
+
};
|
|
16
|
+
type ReviewFieldEditor = ReviewDetailsEditorProps['fieldEditor'];
|
|
17
|
+
export declare function buildReviewFieldEditor(reviewEditor: UseReviewEditorResult, selectedJson: string, onExit: () => void, overrides?: Partial<ReviewFieldEditor>): ReviewFieldEditor;
|
|
18
|
+
export declare function getReviewSelectionState(components: ReadonlyArray<CdfReviewEntry>, selectedIdx: number, showHiddenProps: boolean): {
|
|
19
|
+
selected: CdfReviewEntry | null;
|
|
20
|
+
selectedJson: string;
|
|
21
|
+
visibleJsonPanelValue: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function ReviewEmptyComponentsWarning({ count, hidden, }: {
|
|
24
|
+
count: number;
|
|
25
|
+
hidden: boolean;
|
|
26
|
+
}): React.ReactElement | null;
|
|
27
|
+
export declare function ReviewNoSelection(): React.ReactElement;
|
|
28
|
+
export declare function ReviewFinalizeError({ message, hidden, }: {
|
|
29
|
+
message: string | null;
|
|
30
|
+
hidden: boolean;
|
|
31
|
+
}): React.ReactElement | null;
|
|
32
|
+
export declare function ReviewComponentPanel({ selectedKey, selectedEntry, componentRationale, reviewMetadata, reviewEditor, width, height, sourceBorderColor, jsonValue, sidebarFocused, fieldEditor, saveError, sidebarFooter, livePreview, livePreviewSpinner, }: ReviewComponentPanelProps): React.ReactElement;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FieldEditorProps } from './FieldEditor.js';
|
|
3
|
+
import { type ReviewDetailsPanelProps } from '../review-details-panel.js';
|
|
4
|
+
import type { UseReviewEditorResult } from '../use-review-editor.js';
|
|
5
|
+
type ReviewEditorPanelState = Pick<UseReviewEditorResult, 'panelOpen' | 'panelScrollOffset' | 'tokenReviewRow' | 'tokenReviewEditing' | 'tokenReviewEditCursor' | 'tokenReviewEditSelection' | 'showJson' | 'jsonScrollOffset' | 'currentTokenSuggestions'>;
|
|
6
|
+
export type ReviewDetailsEditorProps = Omit<ReviewDetailsPanelProps, 'editor' | 'panelOpen' | 'panelScrollOffset' | 'tokenSuggestions' | 'tokenReviewRow' | 'tokenReviewEditing' | 'tokenReviewEditCursor' | 'tokenReviewEditSelection' | 'showJson' | 'jsonScrollOffset'> & {
|
|
7
|
+
reviewEditor: ReviewEditorPanelState;
|
|
8
|
+
/** Drawn inside the editor box, above the rows, in both row and field-edit modes. */
|
|
9
|
+
header?: React.ReactNode;
|
|
10
|
+
fieldEditor: Omit<FieldEditorProps, 'active' | 'height' | 'metadata' | 'width'> & {
|
|
11
|
+
key?: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare function ReviewDetailsEditor({ selectedKey, componentRationale, reviewMetadata, width, height, sourceBorderColor, jsonValue, sidebarFocused, reviewEditor, fieldEditor, header, }: ReviewDetailsEditorProps): React.ReactElement;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ComponentTypeSummary } from '@contentful/experience-design-system-types';
|
|
3
|
+
import type { UseFinalizePreviewReturn } from '../use-finalize-preview.js';
|
|
4
|
+
import type { UseReviewSurfaceStateResult } from '../use-review-surface-state.js';
|
|
5
|
+
import { type ReviewStatusEntry } from './ReviewStatus.js';
|
|
6
|
+
export type ReviewFinalizeDialogsProps = {
|
|
7
|
+
showFinalize: boolean;
|
|
8
|
+
showQuit: boolean;
|
|
9
|
+
components: ReadonlyArray<ReviewStatusEntry>;
|
|
10
|
+
removed?: ComponentTypeSummary[];
|
|
11
|
+
previewStatus?: 'idle' | 'running' | 'done' | 'error';
|
|
12
|
+
removedScrollOffset?: number;
|
|
13
|
+
onFinalizeConfirm: () => void;
|
|
14
|
+
onFinalizeCancel: () => void;
|
|
15
|
+
onQuitConfirm: () => void;
|
|
16
|
+
onQuitCancel: () => void;
|
|
17
|
+
};
|
|
18
|
+
export declare function ReviewFinalizeDialogs({ showFinalize, showQuit, components, removed, previewStatus, removedScrollOffset, onFinalizeConfirm, onFinalizeCancel, onQuitConfirm, onQuitCancel, }: ReviewFinalizeDialogsProps): React.ReactElement;
|
|
19
|
+
export declare function ReviewStepDialogs({ surfaceState, components, finalizePreview, onFinalize, onQuit, }: {
|
|
20
|
+
surfaceState: UseReviewSurfaceStateResult;
|
|
21
|
+
components: ReadonlyArray<ReviewStatusEntry>;
|
|
22
|
+
finalizePreview: UseFinalizePreviewReturn;
|
|
23
|
+
onFinalize: () => void;
|
|
24
|
+
onQuit: () => void;
|
|
25
|
+
}): React.ReactElement;
|
|
26
|
+
export declare function ReviewReloadDialog({ open }: {
|
|
27
|
+
open: boolean;
|
|
28
|
+
}): React.ReactElement | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReviewComponentStatus } from '../types.js';
|
|
3
|
+
export type ReviewStatusCounts = {
|
|
4
|
+
accepted: number;
|
|
5
|
+
rejected: number;
|
|
6
|
+
needsReview: number;
|
|
7
|
+
};
|
|
8
|
+
export type ReviewStatusEntry = {
|
|
9
|
+
status: ReviewComponentStatus;
|
|
10
|
+
};
|
|
11
|
+
export declare function countReviewStatuses(entries: ReadonlyArray<ReviewStatusEntry>): ReviewStatusCounts;
|
|
12
|
+
export declare function ReviewLoadingState(): React.ReactElement;
|
|
13
|
+
export declare function ReviewLoadError({ message }: {
|
|
14
|
+
message: string;
|
|
15
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type ScrollablePanelProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
active: boolean;
|
|
7
|
+
totalLines: number;
|
|
8
|
+
visibleStart: number;
|
|
9
|
+
visibleEnd: number;
|
|
10
|
+
borderColor?: string;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export declare function ScrollablePanel({ title, width, height, active, totalLines, visibleStart, visibleEnd, borderColor, children, }: ScrollablePanelProps): React.ReactElement;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
|
|
3
|
+
export type TokenPropSuggestion = {
|
|
4
|
+
propName: string;
|
|
5
|
+
paths: string[];
|
|
6
|
+
suggested: string[];
|
|
7
|
+
allowed: string[];
|
|
8
|
+
};
|
|
9
|
+
export type TokenReviewToken = {
|
|
10
|
+
path: string;
|
|
11
|
+
kind: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Design-token props on `entry` with a declared token kind. `paths` is the
|
|
15
|
+
* full compatible token universe when a token catalog is available; `allowed`
|
|
16
|
+
* remains the current subset.
|
|
17
|
+
*/
|
|
18
|
+
export declare function collectTokenSuggestions(entry: CDFComponentEntry, availableTokens?: TokenReviewToken[]): TokenPropSuggestion[];
|
|
19
|
+
export type TokenReviewPanelProps = {
|
|
20
|
+
componentName: string;
|
|
21
|
+
suggestions: TokenPropSuggestion[];
|
|
22
|
+
selectedRow: number;
|
|
23
|
+
editing: boolean;
|
|
24
|
+
editCursor: number;
|
|
25
|
+
editSelection: Set<string>;
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
active: boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare function TokenReviewPanel({ componentName, suggestions, selectedRow, editing, editCursor, editSelection, width, height, active, }: TokenReviewPanelProps): React.ReactElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentTypeSummary } from '@contentful/experience-design-system-types';
|
|
2
|
+
/** Header line for the removed-components surfaces (deletion panel + finalize
|
|
3
|
+
* dialog). Kept in one place so both read identically. `withExpandHint` adds
|
|
4
|
+
* the panel's "[d] to expand/collapse" affordance, which the dialog omits. */
|
|
5
|
+
export declare function removedComponentsHeader(count: number, withExpandHint: boolean): string;
|
|
6
|
+
/** One bullet line per removed component, matching the deletion panel. */
|
|
7
|
+
export declare function removedComponentLine(rc: ComponentTypeSummary): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function wrapText(text: string, innerWidth: number): string[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BreakingChange, CDFComponentEntry, ComponentTypeSummary, DownstreamImpact, ServerPreviewResponse } from '@contentful/experience-design-system-types';
|
|
3
|
+
type GenerateReviewStepProps = {
|
|
4
|
+
extractSessionId: string | null;
|
|
5
|
+
tokenSessionId?: string | null;
|
|
6
|
+
onFinalize: (accepted: number, rejected: number, unresolved: number) => void;
|
|
7
|
+
onQuit: () => void;
|
|
8
|
+
livePreview?: boolean;
|
|
9
|
+
spaceId?: string;
|
|
10
|
+
environmentId?: string;
|
|
11
|
+
cmaToken?: string;
|
|
12
|
+
host?: string;
|
|
13
|
+
tokensPath?: string;
|
|
14
|
+
initialFinalizeError?: string | null;
|
|
15
|
+
};
|
|
16
|
+
export declare function sortComponentsForSidebar<T extends {
|
|
17
|
+
key: string;
|
|
18
|
+
entry: CDFComponentEntry;
|
|
19
|
+
}>(components: T[], cycleParticipants?: Set<string>): T[];
|
|
20
|
+
export { computeCycleAutoRejectTargets } from './graph/cycle-auto-reject.js';
|
|
21
|
+
export interface BreakingComponent {
|
|
22
|
+
componentName: string;
|
|
23
|
+
changes: BreakingChange[];
|
|
24
|
+
impact?: DownstreamImpact;
|
|
25
|
+
current?: ComponentTypeSummary;
|
|
26
|
+
}
|
|
27
|
+
export interface BreakingRow {
|
|
28
|
+
label: string;
|
|
29
|
+
componentName: string;
|
|
30
|
+
focusTarget?: {
|
|
31
|
+
kind: 'prop' | 'slot';
|
|
32
|
+
name: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export declare function buildBreakingRows(breakingChanges: BreakingComponent[]): BreakingRow[];
|
|
36
|
+
export declare function deriveBreakingChanges(response: ServerPreviewResponse): BreakingComponent[];
|
|
37
|
+
export declare function GenerateReviewStep(props: GenerateReviewStepProps): React.ReactElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SlotCycle } from '../../07-scope-gate/graph/cycle-detection.js';
|
|
2
|
+
import { type SlotGraphInput } from '../../07-scope-gate/graph/slot-graph.js';
|
|
3
|
+
export interface CycleView {
|
|
4
|
+
pushBlocking: SlotCycle[];
|
|
5
|
+
structural: Set<string>;
|
|
6
|
+
}
|
|
7
|
+
export declare function computeCycleView(components: SlotGraphInput[]): CycleView;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Closure, NodeStatus } from '../../07-scope-gate/graph/composite-closure.js';
|
|
2
|
+
export interface RenderStatus {
|
|
3
|
+
status: NodeStatus;
|
|
4
|
+
isOwn: boolean;
|
|
5
|
+
sourceComponents: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare function computeRenderStatuses(closure: Closure, directIssues: Map<string, NodeStatus>): Map<string, RenderStatus>;
|
|
8
|
+
export declare function pickDrillTarget(ancestor: string, closure: Closure, directIssues: Map<string, NodeStatus>): string | null;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ComponentGraphNode } from '../../07-scope-gate/graph/composite-closure.js';
|
|
2
|
+
export declare function computeRejectCascade(target: string, components: ComponentGraphNode[]): Set<string>;
|
|
3
|
+
export declare function computeAcceptCascade(target: string, components: ComponentGraphNode[]): Set<string>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface AutoRejectDecisionInput {
|
|
2
|
+
loading: boolean;
|
|
3
|
+
autoRejectFired: boolean;
|
|
4
|
+
hasCycle: boolean;
|
|
5
|
+
}
|
|
6
|
+
export type AutoRejectDecision = 'fire' | 'skip';
|
|
7
|
+
export declare function computeAutoRejectDecision(input: AutoRejectDecisionInput): AutoRejectDecision;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const CYCLE_PANEL_PREAMBLE_LINES = 4;
|
|
2
|
+
export interface CyclePanelLineCountable {
|
|
3
|
+
suggestedBreak?: unknown;
|
|
4
|
+
}
|
|
5
|
+
export declare function cycleLineCount(cycle: CyclePanelLineCountable): number;
|
|
6
|
+
export declare function cycleLineOffsets(cycles: readonly CyclePanelLineCountable[], preamble?: number): number[];
|
|
7
|
+
export declare function totalCyclePanelLines(cycles: readonly CyclePanelLineCountable[], preamble?: number): number;
|
|
8
|
+
export declare function followCycleScroll(currentScroll: number, cursorIdx: number, cycles: readonly CyclePanelLineCountable[], panelHeight: number, preamble?: number): number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
|
|
2
|
+
import type { SlotCycle, SlotEdge } from '../../07-scope-gate/graph/cycle-detection.js';
|
|
3
|
+
export type BreakEdge = SlotEdge;
|
|
4
|
+
/** Row shape accepted by {@link enumerateCycleBreaks}. */
|
|
5
|
+
export interface BreakEnumComponent {
|
|
6
|
+
key: string;
|
|
7
|
+
entry: CDFComponentEntry;
|
|
8
|
+
}
|
|
9
|
+
export declare function enumerateCycleBreaks(cycle: Pick<SlotCycle, 'edges'>, components: BreakEnumComponent[]): BreakEdge[];
|
|
10
|
+
export declare function shouldBreakOverlayGoFullScreen({ rows, edgeCount, reservedChrome, }: {
|
|
11
|
+
rows: number;
|
|
12
|
+
edgeCount: number;
|
|
13
|
+
reservedChrome?: number;
|
|
14
|
+
}): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function computeSidebarWidth(terminalWidth: number): number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
|
|
2
|
+
import type { ReviewComponentStatus } from './types.js';
|
|
3
|
+
export interface HistorySnapshot {
|
|
4
|
+
components: CdfReviewEntrySnapshot[];
|
|
5
|
+
autoRejected: string[];
|
|
6
|
+
undoSnapshot: Map<string, ReviewComponentStatus> | null;
|
|
7
|
+
}
|
|
8
|
+
interface CdfReviewEntrySnapshot {
|
|
9
|
+
key: string;
|
|
10
|
+
entry: CDFComponentEntry;
|
|
11
|
+
status: ReviewComponentStatus;
|
|
12
|
+
}
|
|
13
|
+
export interface HistoryStack {
|
|
14
|
+
push(snapshot: HistorySnapshot, label: string): void;
|
|
15
|
+
undo(): HistorySnapshot | null;
|
|
16
|
+
redo(): HistorySnapshot | null;
|
|
17
|
+
canUndo(): boolean;
|
|
18
|
+
canRedo(): boolean;
|
|
19
|
+
reset(seed: HistorySnapshot): void;
|
|
20
|
+
size(): number;
|
|
21
|
+
}
|
|
22
|
+
export declare function createHistoryStack(seed: HistorySnapshot, maxDepth?: number): HistoryStack;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ServerPreviewResponse } from '@contentful/experience-design-system-types';
|
|
2
|
+
import type { PreviewAnnotation } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Pure mapper from a `ServerPreviewResponse` to a per-component-name
|
|
5
|
+
* `PreviewAnnotation` map. Consumed by the wizard's final-review sidebar
|
|
6
|
+
* (and any other surface that wants to render diff badges next to a
|
|
7
|
+
* component row).
|
|
8
|
+
*
|
|
9
|
+
* The `new` bucket of `ServerPreviewResponse.components` is `CDFComponentEntry[]`
|
|
10
|
+
* — those entries do NOT carry a `name` field on the wire (the name is the
|
|
11
|
+
* KEY in the parent CDF document). So instead of trying to read names off
|
|
12
|
+
* entries, we derive the "new" set as:
|
|
13
|
+
*
|
|
14
|
+
* new = localNames \ (unchangedNames ∪ changedNames ∪ removedNames)
|
|
15
|
+
*
|
|
16
|
+
* Callers must pass the local CDF document's component keys as `localNames`
|
|
17
|
+
* so we can perform the set difference. Removed components from the server
|
|
18
|
+
* that aren't in the local document are still annotated as `'removed'` (so
|
|
19
|
+
* the detail panel can list them).
|
|
20
|
+
*
|
|
21
|
+
* Precedence: `breaking` > `changed` > `removed` > `new`.
|
|
22
|
+
*
|
|
23
|
+
* Unchanged entries are omitted from the map — callers should treat
|
|
24
|
+
* `map.get(name) === undefined` as "no annotation".
|
|
25
|
+
*/
|
|
26
|
+
export declare function applyPreviewAnnotations(preview: ServerPreviewResponse, localNames: readonly string[]): Map<string, PreviewAnnotation>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type TokenPropSuggestion } from './components/TokenReviewPanel.js';
|
|
3
|
+
import type { ComponentRationale, ComponentReviewMetadata } from '@contentful/experience-design-system-backend-pipeline';
|
|
4
|
+
type ReviewPanel = 'none' | 'prop-rationale' | 'component-rationale' | 'source' | 'token-review';
|
|
5
|
+
export type ReviewDetailsPanelProps = {
|
|
6
|
+
selectedKey: string;
|
|
7
|
+
panelOpen: ReviewPanel;
|
|
8
|
+
componentRationale: ComponentRationale | null;
|
|
9
|
+
reviewMetadata: ComponentReviewMetadata | null;
|
|
10
|
+
panelScrollOffset: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
sourceBorderColor?: string;
|
|
14
|
+
tokenSuggestions: TokenPropSuggestion[];
|
|
15
|
+
tokenReviewRow: number;
|
|
16
|
+
tokenReviewEditing: boolean;
|
|
17
|
+
tokenReviewEditCursor: number;
|
|
18
|
+
tokenReviewEditSelection: Set<string>;
|
|
19
|
+
showJson: boolean;
|
|
20
|
+
jsonValue: string;
|
|
21
|
+
jsonScrollOffset: number;
|
|
22
|
+
sidebarFocused: boolean;
|
|
23
|
+
editor: React.ReactNode;
|
|
24
|
+
};
|
|
25
|
+
export declare function ReviewDetailsPanel({ selectedKey, panelOpen, componentRationale, reviewMetadata, panelScrollOffset, width, height, sourceBorderColor, tokenSuggestions, tokenReviewRow, tokenReviewEditing, tokenReviewEditCursor, tokenReviewEditSelection, showJson, jsonValue, jsonScrollOffset, sidebarFocused, editor, }: ReviewDetailsPanelProps): React.ReactElement;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ImmediateInputKey } from '../07-scope-gate/sidebar/hooks/useImmediateInput.js';
|
|
2
|
+
import type { UseReviewEditorResult } from './use-review-editor.js';
|
|
3
|
+
type ReviewOverlayInputState = {
|
|
4
|
+
loading: boolean;
|
|
5
|
+
loadError: string | null;
|
|
6
|
+
showFinalize: boolean;
|
|
7
|
+
dialogOpen: boolean;
|
|
8
|
+
showHelp?: boolean;
|
|
9
|
+
showReloadDialog: boolean;
|
|
10
|
+
finalizePreview: {
|
|
11
|
+
scrollBy: (delta: number) => void;
|
|
12
|
+
};
|
|
13
|
+
reloadFromSave: () => void;
|
|
14
|
+
setShowReloadDialog: (open: boolean) => void;
|
|
15
|
+
onQuit: () => void;
|
|
16
|
+
handleUndo: () => void;
|
|
17
|
+
handleRedo: () => void;
|
|
18
|
+
};
|
|
19
|
+
export declare function handleReviewOverlayInput(input: string, key: ImmediateInputKey, state: ReviewOverlayInputState): boolean;
|
|
20
|
+
type TokenReviewInputState = Pick<UseReviewEditorResult, 'panelOpen' | 'setPanelOpen' | 'tokenReviewRow' | 'setTokenReviewRow' | 'tokenReviewEditing' | 'setTokenReviewEditing' | 'tokenReviewEditCursor' | 'setTokenReviewEditCursor' | 'tokenReviewEditSelection' | 'setTokenReviewEditSelection' | 'currentTokenSuggestions' | 'handleTokenEditSave'>;
|
|
21
|
+
type RationalePanelInputState = Pick<UseReviewEditorResult, 'panelOpen' | 'setPanelOpen' | 'panelScrollOffset' | 'setPanelScrollOffset'> & {
|
|
22
|
+
propKey: string;
|
|
23
|
+
componentKey: string;
|
|
24
|
+
};
|
|
25
|
+
export type ReviewPanelShortcutState = TokenReviewInputState & RationalePanelInputState & {
|
|
26
|
+
textEntryActive: boolean;
|
|
27
|
+
showJson: boolean;
|
|
28
|
+
};
|
|
29
|
+
export declare function handleReviewPanelShortcuts(input: string, key: ImmediateInputKey, state: ReviewPanelShortcutState): boolean;
|
|
30
|
+
export type ReviewViewToggleInputState = Pick<UseReviewEditorResult, 'setShowJson' | 'setJsonScrollOffset' | 'pendingGRef'>;
|
|
31
|
+
export declare function handleReviewViewToggleInput(input: string, state: ReviewViewToggleInputState): boolean;
|
|
32
|
+
type JsonPanelInputState = Pick<UseReviewEditorResult, 'jsonScrollOffset' | 'setJsonScrollOffset' | 'pendingGRef'> & {
|
|
33
|
+
sidebarFocused: boolean;
|
|
34
|
+
showJson: boolean;
|
|
35
|
+
jsonValue: string;
|
|
36
|
+
height: number;
|
|
37
|
+
};
|
|
38
|
+
export declare function handleJsonPanelInput(input: string, key: ImmediateInputKey, state: JsonPanelInputState): boolean;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
|
|
2
|
+
type ReviewJsonComponent = {
|
|
3
|
+
key: string;
|
|
4
|
+
entry: CDFComponentEntry;
|
|
5
|
+
};
|
|
6
|
+
export declare function getReviewJsonPanelValue(selected: ReviewJsonComponent | null, showHiddenProps: boolean): string;
|
|
7
|
+
export {};
|