@contentful/experience-design-system-cli 2.37.1-dev-build-8b126ca1.0 → 2.37.1-dev-build-aa3ffe6f.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/package.json +1 -1
- package/legacy/dist/src/index.js +8572 -18583
- package/legacy/package.json +1 -1
- package/package.json +4 -4
- package/legacy/dist/src/analyze/cycle-view.d.ts +0 -7
- package/legacy/dist/src/import/agent-model-resolve.d.ts +0 -27
- package/legacy/dist/src/import/command.d.ts +0 -2
- package/legacy/dist/src/import/composition-options.d.ts +0 -7
- package/legacy/dist/src/import/cycle-auto-reject.d.ts +0 -4
- package/legacy/dist/src/import/path-utils.d.ts +0 -15
- package/legacy/dist/src/import/tui/CustomPromptBanner.d.ts +0 -5
- package/legacy/dist/src/import/tui/WizardApp.d.ts +0 -24
- package/legacy/dist/src/import/tui/autocomplete.d.ts +0 -5
- package/legacy/dist/src/import/tui/components/CompactControlBar.d.ts +0 -4
- package/legacy/dist/src/import/tui/components/LegendEntry.d.ts +0 -2
- package/legacy/dist/src/import/tui/components/LivePreviewSummary.d.ts +0 -14
- package/legacy/dist/src/import/tui/components/ReviewComponentPanel.d.ts +0 -33
- package/legacy/dist/src/import/tui/components/ReviewDetailsEditor.d.ts +0 -15
- package/legacy/dist/src/import/tui/components/ReviewDialogs.d.ts +0 -28
- package/legacy/dist/src/import/tui/components/ReviewStatus.d.ts +0 -15
- package/legacy/dist/src/import/tui/components/SearchMatchSummary.d.ts +0 -11
- package/legacy/dist/src/import/tui/components/SpaceEnvironment.d.ts +0 -7
- package/legacy/dist/src/import/tui/components/StepHeader.d.ts +0 -8
- package/legacy/dist/src/import/tui/cycle-panel-scroll.d.ts +0 -8
- package/legacy/dist/src/import/tui/group-collapse.d.ts +0 -2
- package/legacy/dist/src/import/tui/handoff.d.ts +0 -36
- package/legacy/dist/src/import/tui/history.d.ts +0 -23
- package/legacy/dist/src/import/tui/hooks/review-input.d.ts +0 -39
- package/legacy/dist/src/import/tui/hooks/sidebar-search-state.d.ts +0 -17
- package/legacy/dist/src/import/tui/hooks/useOverlayPanel.d.ts +0 -13
- package/legacy/dist/src/import/tui/hooks/useReviewEditor.d.ts +0 -49
- package/legacy/dist/src/import/tui/hooks/useReviewPreview.d.ts +0 -25
- package/legacy/dist/src/import/tui/hooks/useReviewSession.d.ts +0 -95
- package/legacy/dist/src/import/tui/hooks/useReviewSurfaceState.d.ts +0 -12
- package/legacy/dist/src/import/tui/lineage-layout.d.ts +0 -68
- package/legacy/dist/src/import/tui/preview-confirmation-input.d.ts +0 -5
- package/legacy/dist/src/import/tui/push-progress.d.ts +0 -9
- package/legacy/dist/src/import/tui/run-print-files-helpers.d.ts +0 -26
- package/legacy/dist/src/import/tui/run-teaser.d.ts +0 -5
- package/legacy/dist/src/import/tui/runLivePreview.d.ts +0 -45
- package/legacy/dist/src/import/tui/sidebar-help.d.ts +0 -2
- package/legacy/dist/src/import/tui/sidebar-input.d.ts +0 -13
- package/legacy/dist/src/import/tui/sidebar-navigation.d.ts +0 -18
- package/legacy/dist/src/import/tui/sidebar-width.d.ts +0 -1
- package/legacy/dist/src/import/tui/step-filters.d.ts +0 -19
- package/legacy/dist/src/import/tui/steps/DoneStep.d.ts +0 -28
- package/legacy/dist/src/import/tui/steps/ErrorStep.d.ts +0 -10
- package/legacy/dist/src/import/tui/steps/GateStep.d.ts +0 -15
- package/legacy/dist/src/import/tui/steps/GenerateReviewStep.d.ts +0 -37
- package/legacy/dist/src/import/tui/steps/PreviewValidationErrorStep.d.ts +0 -11
- package/legacy/dist/src/import/tui/steps/PushingStep.d.ts +0 -9
- package/legacy/dist/src/import/tui/steps/RunningStep.d.ts +0 -32
- package/legacy/dist/src/import/tui/steps/WizardPreviewStep.d.ts +0 -21
- package/legacy/dist/src/import/tui/steps/auto-reject-decision.d.ts +0 -7
- package/legacy/dist/src/import/tui/steps/breaking-change-format.d.ts +0 -2
- package/legacy/dist/src/import/tui/steps/enumerate-cycle-breaks.d.ts +0 -14
- package/legacy/dist/src/import/tui/steps/preview-diff.d.ts +0 -10
- package/legacy/dist/src/import/tui/steps/review-details-panel.d.ts +0 -26
- package/legacy/dist/src/import/tui/steps/review-json-panel.d.ts +0 -7
- package/legacy/dist/src/import/tui/useFinalizePreview.d.ts +0 -39
- package/legacy/dist/src/import/tui/useLivePreview.d.ts +0 -39
- package/legacy/dist/src/import/tui/wizard-422-helpers.d.ts +0 -48
- package/legacy/dist/src/import/tui/wizard-state-transitions.d.ts +0 -30
- package/legacy/dist/src/runs/path-prompt.d.ts +0 -8
- package/legacy/dist/src/tui/use-blinking-cursor.d.ts +0 -1
- package/legacy/dist/src/tui/use-timed-spinner.d.ts +0 -4
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-aa3ffe6f.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-backend-pipeline": "2.37.1-dev-build-
|
|
49
|
-
"@contentful/experience-design-system-generation": "2.37.1-dev-build-
|
|
50
|
-
"@contentful/experience-design-system-types": "2.37.1-dev-build-
|
|
48
|
+
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-aa3ffe6f.0",
|
|
49
|
+
"@contentful/experience-design-system-generation": "2.37.1-dev-build-aa3ffe6f.0",
|
|
50
|
+
"@contentful/experience-design-system-types": "2.37.1-dev-build-aa3ffe6f.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@tsconfig/node24": "^24.0.4",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SlotCycle } from './cycle-detection.js';
|
|
2
|
-
import { type SlotGraphInput } from './slot-graph.js';
|
|
3
|
-
export interface CycleView {
|
|
4
|
-
pushBlocking: SlotCycle[];
|
|
5
|
-
structural: Set<string>;
|
|
6
|
-
}
|
|
7
|
-
export declare function computeCycleView(components: SlotGraphInput[]): CycleView;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolution chain for the combined `--agent` override on `experiences import`.
|
|
3
|
-
*
|
|
4
|
-
* The wizard path previously hard-defaulted `--agent` to `'claude'` at the
|
|
5
|
-
* commander layer, which (a) shadowed the stored `credentials.json` value when
|
|
6
|
-
* the user passed no flag, and (b) made it impossible to distinguish "user
|
|
7
|
-
* explicitly passed --agent claude" from "user passed nothing". The combined
|
|
8
|
-
* flag accepts either `agent:model` or `agent model`.
|
|
9
|
-
*
|
|
10
|
-
* These helpers produce the resolved values to feed into `WizardApp` /
|
|
11
|
-
* the import wizard:
|
|
12
|
-
*
|
|
13
|
-
* 1. CLI flag wins when provided.
|
|
14
|
-
* 2. Otherwise, the value persisted in `credentials.json` (written by
|
|
15
|
-
* `experiences setup`) is used.
|
|
16
|
-
* 3. Otherwise, the built-in default (currently `'claude'`) is used for
|
|
17
|
-
* the agent. Model has no default — agents pick a small/fast model
|
|
18
|
-
* themselves when no model is included in `--agent`.
|
|
19
|
-
*/
|
|
20
|
-
/** Built-in fallback agent when neither a flag nor a stored preference is set. */
|
|
21
|
-
export declare const DEFAULT_AGENT = "claude";
|
|
22
|
-
export declare function parseAgentModel(value: string | undefined): {
|
|
23
|
-
agent?: string;
|
|
24
|
-
model?: string;
|
|
25
|
-
};
|
|
26
|
-
export declare function resolveAgent(flagValue: string | undefined, storedValue: string | undefined): string;
|
|
27
|
-
export declare function resolveModel(flagValue: string | undefined, storedValue: string | undefined): string | undefined;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type CompositionOptionInput = {
|
|
2
|
-
prompt?: string[];
|
|
3
|
-
};
|
|
4
|
-
export type CompositionForwardingOptions = {
|
|
5
|
-
promptOverrides?: string[];
|
|
6
|
-
};
|
|
7
|
-
export declare function buildCompositionForwardingOptions(options: CompositionOptionInput): CompositionForwardingOptions;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Expands a leading `~` to the user's home directory.
|
|
3
|
-
* Exported separately so it can be unit-tested and reused.
|
|
4
|
-
*/
|
|
5
|
-
export declare function expandTilde(input: string): string;
|
|
6
|
-
/**
|
|
7
|
-
* Normalizes a user-entered path to an absolute path, handling all common
|
|
8
|
-
* terminal path styles:
|
|
9
|
-
* - surrounding quotes ("~/path" or '~/path') → stripped
|
|
10
|
-
* - tilde prefix (~/projects/mylib) → expanded to $HOME
|
|
11
|
-
* - relative paths (../mylib, ./src, mylib) → resolved against CWD
|
|
12
|
-
* - absolute paths (/Users/ryun/projects/mylib) → passed through
|
|
13
|
-
* - trailing slashes, repeated slashes → normalized by path.resolve
|
|
14
|
-
*/
|
|
15
|
-
export declare function normalizePath(input: string): string;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { CDFDocument, CDFComponentEntry, DTCGTokenEntry } from '@contentful/experience-design-system-types';
|
|
3
|
-
export declare function buildSavedCDF(components: Array<{
|
|
4
|
-
key: string;
|
|
5
|
-
entry: CDFComponentEntry;
|
|
6
|
-
}>, tokens: DTCGTokenEntry[], opts?: {
|
|
7
|
-
deleteAll?: boolean;
|
|
8
|
-
}): CDFDocument;
|
|
9
|
-
export declare function parsePrintTokensCount(stdout: string): number;
|
|
10
|
-
export type WizardAppProps = {
|
|
11
|
-
initialSpaceId?: string;
|
|
12
|
-
initialEnvironmentId?: string;
|
|
13
|
-
initialCmaToken?: string;
|
|
14
|
-
initialHost?: string;
|
|
15
|
-
initialAgent?: string;
|
|
16
|
-
initialModel?: string;
|
|
17
|
-
bedrock?: boolean;
|
|
18
|
-
initialProjectPath?: string;
|
|
19
|
-
host?: string;
|
|
20
|
-
livePreview?: boolean;
|
|
21
|
-
generatePromptPath?: string;
|
|
22
|
-
initialRawTokensPath?: string;
|
|
23
|
-
};
|
|
24
|
-
export declare function WizardApp({ initialSpaceId, initialEnvironmentId, initialCmaToken, initialHost, initialAgent, initialModel, bedrock, initialProjectPath, host, livePreview, generatePromptPath, initialRawTokensPath, }?: WizardAppProps): React.ReactElement;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PreviewAnnotation } from '../../../analyze/select/types.js';
|
|
3
|
-
import type { UseLivePreviewReturn } from '../useLivePreview.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 {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
|
|
3
|
-
import type { CdfReviewEntry } from '../hooks/useReviewSession.js';
|
|
4
|
-
import type { UseReviewEditorResult } from '../hooks/useReviewEditor.js';
|
|
5
|
-
import type { UseLivePreviewReturn } from '../useLivePreview.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 {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type FieldEditorProps } from '../../../analyze/select/tui/components/FieldEditor.js';
|
|
3
|
-
import { type ReviewDetailsPanelProps } from '../steps/review-details-panel.js';
|
|
4
|
-
import type { UseReviewEditorResult } from '../hooks/useReviewEditor.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 {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ComponentTypeSummary } from '@contentful/experience-design-system-types';
|
|
3
|
-
import type { UseFinalizePreviewReturn } from '../useFinalizePreview.js';
|
|
4
|
-
import type { UseReviewSurfaceStateResult } from '../hooks/useReviewSurfaceState.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;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ReviewComponentStatus } from '../../../analyze/select/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;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type SearchMatchSummaryProps = {
|
|
3
|
-
open: boolean;
|
|
4
|
-
query: string;
|
|
5
|
-
matches: number;
|
|
6
|
-
total: number;
|
|
7
|
-
autocompleteCandidates: string[];
|
|
8
|
-
hidden?: boolean;
|
|
9
|
-
marginTop?: number;
|
|
10
|
-
};
|
|
11
|
-
export declare function SearchMatchSummary({ open, query, matches, total, autocompleteCandidates, hidden, marginTop, }: SearchMatchSummaryProps): React.ReactElement | null;
|
|
@@ -1,8 +0,0 @@
|
|
|
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;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { type ImportHandoff } from '@contentful/experience-design-system-types/handoff';
|
|
2
|
-
/** The wizard state the early stages produce. Every field is one the stage used to write. */
|
|
3
|
-
export interface HandoffState {
|
|
4
|
-
credentialsSkipped: boolean;
|
|
5
|
-
tokensPath?: string;
|
|
6
|
-
tokenSessionId?: string | null;
|
|
7
|
-
tokenCount?: number;
|
|
8
|
-
tokenGenerationStatus?: 'complete';
|
|
9
|
-
outDir?: string;
|
|
10
|
-
extractSessionId?: string;
|
|
11
|
-
compositionPhase?: 'done' | 'cache-hit';
|
|
12
|
-
selectionAgentStatus?: 'complete';
|
|
13
|
-
existingEntitiesStatus?: 'idle' | 'complete' | 'failed';
|
|
14
|
-
existingEntitiesPath?: string | null;
|
|
15
|
-
acceptedCount?: number;
|
|
16
|
-
autoRejectedCount?: number;
|
|
17
|
-
generateSessionId?: string;
|
|
18
|
-
generatedCount?: number;
|
|
19
|
-
mapTokensEligible?: boolean;
|
|
20
|
-
mapTokensStatus?: 'complete';
|
|
21
|
-
}
|
|
22
|
-
/** Where the wizard goes first: the review screen with the generated definitions, or straight to saving and pushing. */
|
|
23
|
-
export type StartRoute = 'review' | 'push';
|
|
24
|
-
export declare function routeFromHandoff(handoff: ImportHandoff): StartRoute | null;
|
|
25
|
-
export declare function stateFromHandoff(handoff: ImportHandoff): HandoffState;
|
|
26
|
-
export type StartFromHandoff = {
|
|
27
|
-
ok: true;
|
|
28
|
-
handoff: ImportHandoff;
|
|
29
|
-
state: HandoffState;
|
|
30
|
-
route: StartRoute | null;
|
|
31
|
-
} | {
|
|
32
|
-
ok: false;
|
|
33
|
-
error: string;
|
|
34
|
-
};
|
|
35
|
-
/** Reads the handoff the CLI passed. A missing or broken one is an error to show, never a guess at a start. */
|
|
36
|
-
export declare function readHandoff(env?: NodeJS.ProcessEnv): StartFromHandoff;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
|
|
2
|
-
import type { ReviewComponentStatus } from '../../analyze/select/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 {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { ImmediateInputKey } from '../../../analyze/select/tui/hooks/useImmediateInput.js';
|
|
2
|
-
import type { UseReviewEditorResult } from './useReviewEditor.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 {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { FilterCategory } from '../step-filters.js';
|
|
2
|
-
export declare function useSidebarSearchState(): {
|
|
3
|
-
searchOpen: boolean;
|
|
4
|
-
setSearchOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
5
|
-
searchQuery: string;
|
|
6
|
-
setSearchQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
7
|
-
autocompleteCandidates: string[];
|
|
8
|
-
setAutocompleteCandidates: import("react").Dispatch<import("react").SetStateAction<string[]>>;
|
|
9
|
-
jumpFilterTarget: string | null;
|
|
10
|
-
setJumpFilterTarget: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
11
|
-
columnOneView: "flat" | "grouped";
|
|
12
|
-
setColumnOneView: import("react").Dispatch<import("react").SetStateAction<"flat" | "grouped">>;
|
|
13
|
-
activeFilters: Set<FilterCategory>;
|
|
14
|
-
setActiveFilters: import("react").Dispatch<import("react").SetStateAction<Set<FilterCategory>>>;
|
|
15
|
-
showHelp: boolean;
|
|
16
|
-
setShowHelp: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
17
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface UseOverlayPanelOptions {
|
|
2
|
-
toggleKey: string;
|
|
3
|
-
onClose?: () => void;
|
|
4
|
-
}
|
|
5
|
-
export interface UseOverlayPanelResult {
|
|
6
|
-
isOpen: boolean;
|
|
7
|
-
open: () => void;
|
|
8
|
-
close: () => void;
|
|
9
|
-
handleInput: (input: string, key: {
|
|
10
|
-
escape?: boolean;
|
|
11
|
-
}) => boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare function useOverlayPanel(opts: UseOverlayPanelOptions): UseOverlayPanelResult;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { type Dispatch, type SetStateAction } from 'react';
|
|
2
|
-
import { type TokenPropSuggestion, type TokenReviewToken } from '../../../analyze/select/tui/components/TokenReviewPanel.js';
|
|
3
|
-
import type { CdfReviewEntry } from './useReviewSession.js';
|
|
4
|
-
export type ReviewPanel = 'none' | 'prop-rationale' | 'component-rationale' | 'source' | 'token-review';
|
|
5
|
-
type UseReviewEditorOptions = {
|
|
6
|
-
components: CdfReviewEntry[];
|
|
7
|
-
selectedIdx: number;
|
|
8
|
-
extractSessionId: string;
|
|
9
|
-
availableTokens: TokenReviewToken[];
|
|
10
|
-
setComponents: Dispatch<SetStateAction<CdfReviewEntry[]>>;
|
|
11
|
-
pushHistorySnapshot: (entries: CdfReviewEntry[], label: string) => void;
|
|
12
|
-
onEditSaved: (entries: CdfReviewEntry[]) => void;
|
|
13
|
-
onTokenSaved: (entries: CdfReviewEntry[]) => void;
|
|
14
|
-
};
|
|
15
|
-
export type UseReviewEditorResult = {
|
|
16
|
-
panelOpen: ReviewPanel;
|
|
17
|
-
setPanelOpen: Dispatch<SetStateAction<ReviewPanel>>;
|
|
18
|
-
panelScrollOffset: number;
|
|
19
|
-
setPanelScrollOffset: Dispatch<SetStateAction<number>>;
|
|
20
|
-
jsonScrollOffset: number;
|
|
21
|
-
setJsonScrollOffset: Dispatch<SetStateAction<number>>;
|
|
22
|
-
textEntryActive: boolean;
|
|
23
|
-
setTextEntryActive: Dispatch<SetStateAction<boolean>>;
|
|
24
|
-
showJson: boolean;
|
|
25
|
-
setShowJson: Dispatch<SetStateAction<boolean>>;
|
|
26
|
-
showHiddenProps: boolean;
|
|
27
|
-
setShowHiddenProps: Dispatch<SetStateAction<boolean>>;
|
|
28
|
-
draftValue: string;
|
|
29
|
-
setDraftValue: Dispatch<SetStateAction<string>>;
|
|
30
|
-
saveError: string | null;
|
|
31
|
-
setSaveError: Dispatch<SetStateAction<string | null>>;
|
|
32
|
-
tokenReviewRow: number;
|
|
33
|
-
setTokenReviewRow: Dispatch<SetStateAction<number>>;
|
|
34
|
-
tokenReviewEditing: boolean;
|
|
35
|
-
setTokenReviewEditing: Dispatch<SetStateAction<boolean>>;
|
|
36
|
-
tokenReviewEditCursor: number;
|
|
37
|
-
setTokenReviewEditCursor: Dispatch<SetStateAction<number>>;
|
|
38
|
-
tokenReviewEditSelection: Set<string>;
|
|
39
|
-
setTokenReviewEditSelection: Dispatch<SetStateAction<Set<string>>>;
|
|
40
|
-
pendingGRef: {
|
|
41
|
-
current: boolean;
|
|
42
|
-
};
|
|
43
|
-
currentTokenSuggestions: () => TokenPropSuggestion[];
|
|
44
|
-
handleEditSave: () => void;
|
|
45
|
-
handleEditDiscard: () => void;
|
|
46
|
-
handleTokenEditSave: (suggestion: TokenPropSuggestion) => void;
|
|
47
|
-
};
|
|
48
|
-
export declare function useReviewEditor({ components, selectedIdx, extractSessionId, availableTokens, setComponents, pushHistorySnapshot, onEditSaved, onTokenSaved, }: UseReviewEditorOptions): UseReviewEditorResult;
|
|
49
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ComponentTypeSummary, ServerPreviewResponse } from '@contentful/experience-design-system-types';
|
|
2
|
-
import type { PreviewAnnotation } from '../../../analyze/select/types.js';
|
|
3
|
-
import { type UseLivePreviewReturn } from '../useLivePreview.js';
|
|
4
|
-
export type UseReviewPreviewOptions = {
|
|
5
|
-
components: ReadonlyArray<{
|
|
6
|
-
key: string;
|
|
7
|
-
}>;
|
|
8
|
-
loading: boolean;
|
|
9
|
-
livePreview: boolean;
|
|
10
|
-
sessionId: string;
|
|
11
|
-
tokensPath: string;
|
|
12
|
-
spaceId: string;
|
|
13
|
-
environmentId: string;
|
|
14
|
-
cmaToken: string;
|
|
15
|
-
host: string;
|
|
16
|
-
deleteAllComponents?: boolean;
|
|
17
|
-
onResult?: (response: ServerPreviewResponse) => void;
|
|
18
|
-
};
|
|
19
|
-
export type UseReviewPreviewResult = {
|
|
20
|
-
previewAnnotations: Map<string, PreviewAnnotation>;
|
|
21
|
-
removedComponents: ComponentTypeSummary[];
|
|
22
|
-
livePreviewHook: UseLivePreviewReturn;
|
|
23
|
-
livePreviewSpinner: string;
|
|
24
|
-
};
|
|
25
|
-
export declare function useReviewPreview({ components, loading, livePreview, sessionId, tokensPath, spaceId, environmentId, cmaToken, host, deleteAllComponents, onResult, }: UseReviewPreviewOptions): UseReviewPreviewResult;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { DatabaseSync } from 'node:sqlite';
|
|
2
|
-
import { type Dispatch, type SetStateAction } from 'react';
|
|
3
|
-
import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
|
|
4
|
-
import { type ComponentRationale, type ComponentReviewMetadata } from '../../../session/db.js';
|
|
5
|
-
import { type TokenReviewToken } from '../../../analyze/select/tui/components/TokenReviewPanel.js';
|
|
6
|
-
import type { ReviewComponentStatus } from '../../../analyze/select/types.js';
|
|
7
|
-
import { type HistorySnapshot } from '../history.js';
|
|
8
|
-
export type CdfReviewEntry = {
|
|
9
|
-
key: string;
|
|
10
|
-
entry: CDFComponentEntry;
|
|
11
|
-
status: ReviewComponentStatus;
|
|
12
|
-
};
|
|
13
|
-
export type ReviewSessionLoadResult<TExtra = undefined> = {
|
|
14
|
-
entries: CdfReviewEntry[];
|
|
15
|
-
tokens: TokenReviewToken[];
|
|
16
|
-
error: string | null;
|
|
17
|
-
extra?: TExtra;
|
|
18
|
-
};
|
|
19
|
-
export type ReviewSessionLoaderOptions<TExtra = undefined> = {
|
|
20
|
-
extractSessionId: string;
|
|
21
|
-
tokenSessionId?: string | null;
|
|
22
|
-
loadExtra?: (db: DatabaseSync, sessionId: string) => TExtra;
|
|
23
|
-
sortEntries: (entries: CdfReviewEntry[], extra: TExtra | undefined) => CdfReviewEntry[];
|
|
24
|
-
};
|
|
25
|
-
export declare function loadReviewSessionState<TExtra = undefined>({ extractSessionId, tokenSessionId, loadExtra, sortEntries, }: ReviewSessionLoaderOptions<TExtra>): ReviewSessionLoadResult<TExtra>;
|
|
26
|
-
type UseReviewSessionOptions<TExtra> = {
|
|
27
|
-
loadSession: () => ReviewSessionLoadResult<TExtra>;
|
|
28
|
-
tokensPath?: string;
|
|
29
|
-
onExtraLoaded?: (extra: TExtra | undefined) => void;
|
|
30
|
-
};
|
|
31
|
-
type UseReviewSessionResult<TExtra> = {
|
|
32
|
-
components: CdfReviewEntry[];
|
|
33
|
-
setComponents: Dispatch<SetStateAction<CdfReviewEntry[]>>;
|
|
34
|
-
loading: boolean;
|
|
35
|
-
loadError: string | null;
|
|
36
|
-
availableTokens: TokenReviewToken[];
|
|
37
|
-
reloadFromSave: () => ReviewSessionLoadResult<TExtra> | null;
|
|
38
|
-
};
|
|
39
|
-
export declare function useReviewSession<TExtra = undefined>({ loadSession, tokensPath, onExtraLoaded, }: UseReviewSessionOptions<TExtra>): UseReviewSessionResult<TExtra>;
|
|
40
|
-
type UseReviewMetadataOptions = {
|
|
41
|
-
components: CdfReviewEntry[];
|
|
42
|
-
selectedIdx: number;
|
|
43
|
-
extractSessionId: string;
|
|
44
|
-
};
|
|
45
|
-
export declare function useReviewMetadata({ components, selectedIdx, extractSessionId }: UseReviewMetadataOptions): {
|
|
46
|
-
reviewMetadata: ComponentReviewMetadata | null;
|
|
47
|
-
componentRationale: ComponentRationale | null;
|
|
48
|
-
};
|
|
49
|
-
export declare function createReviewHistorySnapshot(components: CdfReviewEntry[], options?: {
|
|
50
|
-
autoRejected?: readonly string[];
|
|
51
|
-
undoSnapshot?: ReadonlyMap<string, ReviewComponentStatus> | null;
|
|
52
|
-
}): HistorySnapshot;
|
|
53
|
-
type UseReviewHistoryOptions = {
|
|
54
|
-
loading: boolean;
|
|
55
|
-
components: CdfReviewEntry[];
|
|
56
|
-
createSnapshot: (components: CdfReviewEntry[]) => HistorySnapshot;
|
|
57
|
-
applySnapshot: (snapshot: HistorySnapshot) => void;
|
|
58
|
-
};
|
|
59
|
-
export declare function useReviewHistory({ loading, components, createSnapshot, applySnapshot }: UseReviewHistoryOptions): {
|
|
60
|
-
historySeededRef: {
|
|
61
|
-
current: boolean;
|
|
62
|
-
};
|
|
63
|
-
pushHistorySnapshot: (entries: CdfReviewEntry[], label: string) => void;
|
|
64
|
-
handleUndo: () => void;
|
|
65
|
-
handleRedo: () => void;
|
|
66
|
-
resetHistory: (snapshot: HistorySnapshot) => void;
|
|
67
|
-
};
|
|
68
|
-
export type ReviewFinalizeCounts = {
|
|
69
|
-
accepted: number;
|
|
70
|
-
rejected: number;
|
|
71
|
-
unresolved: number;
|
|
72
|
-
};
|
|
73
|
-
export declare function finalizeReviewSession(extractSessionId: string, components: CdfReviewEntry[]): ReviewFinalizeCounts;
|
|
74
|
-
export type UseReviewFinalizeOptions = {
|
|
75
|
-
showFinalize: boolean;
|
|
76
|
-
extractSessionId: string;
|
|
77
|
-
tokensPath: string;
|
|
78
|
-
spaceId: string;
|
|
79
|
-
environmentId: string;
|
|
80
|
-
cmaToken: string;
|
|
81
|
-
host: string;
|
|
82
|
-
components: CdfReviewEntry[];
|
|
83
|
-
onFinalize: (accepted: number, rejected: number, unresolved: number) => void;
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* Shared by both the composite and atomic generate-review steps: the Finalize
|
|
87
|
-
* dialog's scoped preview (`useReviewFinalizePreview`) plus the confirm
|
|
88
|
-
* handler that reclassifies rejected/unresolved components and reports the
|
|
89
|
-
* final counts back to the wizard.
|
|
90
|
-
*/
|
|
91
|
-
export declare function useReviewFinalize({ showFinalize, extractSessionId, tokensPath, spaceId, environmentId, cmaToken, host, components, onFinalize, }: UseReviewFinalizeOptions): {
|
|
92
|
-
finalizePreview: import("../useFinalizePreview.js").UseFinalizePreviewReturn;
|
|
93
|
-
handleFinalizeConfirm: () => void;
|
|
94
|
-
};
|
|
95
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type Dispatch, type SetStateAction } from 'react';
|
|
2
|
-
export type UseReviewSurfaceStateResult = {
|
|
3
|
-
sidebarFocused: boolean;
|
|
4
|
-
setSidebarFocused: Dispatch<SetStateAction<boolean>>;
|
|
5
|
-
showFinalize: boolean;
|
|
6
|
-
setShowFinalize: Dispatch<SetStateAction<boolean>>;
|
|
7
|
-
showQuit: boolean;
|
|
8
|
-
setShowQuit: Dispatch<SetStateAction<boolean>>;
|
|
9
|
-
finalizeError: string | null;
|
|
10
|
-
setFinalizeError: Dispatch<SetStateAction<string | null>>;
|
|
11
|
-
};
|
|
12
|
-
export declare function useReviewSurfaceState(initialFinalizeError?: string | null): UseReviewSurfaceStateResult;
|