@nkzw/codiff-core 1.8.1 → 1.9.1
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/SharedPlanApp.d.ts +2 -1
- package/dist/SharedWalkthroughApp.d.ts +3 -1
- package/dist/app/components/ReviewCodeView.d.ts +2 -2
- package/dist/app/components/ReviewTopBar.d.ts +22 -0
- package/dist/app/components/Sidebar.d.ts +1 -4
- package/dist/app/components/Thinking.d.ts +1 -0
- package/dist/app/components/walkthrough/NarrativeSidebar.d.ts +1 -2
- package/dist/app/components/walkthrough/NarrativeWalkthroughView.d.ts +1 -4
- package/dist/app/hooks/useAppWalkthrough.d.ts +1 -4
- package/dist/lib/app-types.d.ts +5 -1
- package/dist/lib/reload-selection.d.ts +2 -0
- package/dist/lib/review-comments.d.ts +6 -2
- package/dist/react.d.ts +1 -0
- package/dist/react.mjs +326 -229
- package/dist/style.css +398 -1056
- package/dist/types.d.ts +1 -0
- package/package.json +6 -6
package/dist/SharedPlanApp.d.ts
CHANGED
|
@@ -25,8 +25,9 @@ export type PlanReviewCommenting = {
|
|
|
25
25
|
onUpdateMessage: (messageId: string, body: string) => Promise<void>;
|
|
26
26
|
};
|
|
27
27
|
export declare const getSharedPlanDownloadContent: (snapshot: SharedPlanSnapshot) => string;
|
|
28
|
-
export declare function PlanReviewSurface({ commenting, signInLabel, snapshot, }: {
|
|
28
|
+
export declare function PlanReviewSurface({ commenting, onDeleteShare, signInLabel, snapshot, }: {
|
|
29
29
|
commenting?: PlanReviewCommenting;
|
|
30
|
+
onDeleteShare?: () => Promise<void> | void;
|
|
30
31
|
signInLabel?: string;
|
|
31
32
|
snapshot: SharedPlanSnapshot;
|
|
32
33
|
}): import("react").JSX.Element;
|
|
@@ -29,12 +29,14 @@ export type ReviewSurfaceProps = {
|
|
|
29
29
|
walkthroughError?: string | null;
|
|
30
30
|
walkthroughStatus: ReviewWalkthroughStatus;
|
|
31
31
|
};
|
|
32
|
+
onDeleteShare?: () => Promise<void> | void;
|
|
32
33
|
onModeChange?: (mode: ReviewMode) => void;
|
|
33
34
|
providerLabel?: string;
|
|
35
|
+
repositoryUrl?: string;
|
|
34
36
|
settingsBar?: ReactNode;
|
|
35
37
|
signInLabel?: string;
|
|
36
38
|
snapshot: SharedWalkthroughSnapshot;
|
|
37
39
|
sourceDescriptionFooterAside?: ReactNode;
|
|
38
40
|
title?: string;
|
|
39
41
|
};
|
|
40
|
-
export declare function ReviewSurface({ commenting, externalUrl, gitIdentity, initialMode, interactive, onModeChange, providerLabel, settingsBar, signInLabel, snapshot, sourceDescriptionFooterAside, title, }: ReviewSurfaceProps): import("react").JSX.Element;
|
|
42
|
+
export declare function ReviewSurface({ commenting, externalUrl, gitIdentity, initialMode, interactive, onDeleteShare, onModeChange, providerLabel, repositoryUrl, settingsBar, signInLabel, snapshot, sourceDescriptionFooterAside, title, }: ReviewSurfaceProps): import("react").JSX.Element;
|
|
@@ -39,7 +39,7 @@ type HeaderReviewDiffBlock = {
|
|
|
39
39
|
selected?: boolean;
|
|
40
40
|
};
|
|
41
41
|
export type ReviewDiffBlock = FileReviewDiffBlock | HeaderReviewDiffBlock;
|
|
42
|
-
export declare function ReviewCodeView({ activeSearchMatch, agentId, agentLabel, allowViewedToggle, blocks, bottomInset, codeQualityFindings, collapsed, comments, commitMetadata, diffLineHeight, diffStyle, disableWorkerPool, expandedGenerated, files, focusCommentId, focusCommentRequest, forceExpandedPaths, gitIdentity, hunkNavigation, initialMarkdownPreviewSectionIds,
|
|
42
|
+
export declare function ReviewCodeView({ activeSearchMatch, agentId, agentLabel, allowViewedToggle, blocks, bottomInset, codeQualityFindings, collapsed, comments, commitMetadata, diffLineHeight, diffStyle, disableWorkerPool, expandedGenerated, files, focusCommentId, focusCommentRequest, forceExpandedPaths, gitIdentity, hunkNavigation, initialMarkdownPreviewSectionIds, isReadOnly, itemVersionByKey, keymap, loadingSectionIds, onActiveBlockChange, onAskCodex, onCommentDraftChange, onCreateComment, onDeleteComment, onLoadImageContent, onLoadSection, onLoadSectionContents, onOpenFile, onRefreshMarkdown, onResolveThread, onSaveCommentEdit, onSelectPathFromScroll, onSubmitComment, onToggleCollapsed, onToggleViewed, onUpdateComment, onUpdateSourceDescription, onUpdateSourceTitle, onUploadSourceDescriptionAsset, reviewIdentityByPath, scrollTarget, searchQuery, selectedPath, showSourceDescription, showWhitespace, source, sourceDescriptionActions, sourceDescriptionFooter, supportsReviewCommentActions, theme, viewed, walkthroughNotes, wordWrap, }: {
|
|
43
43
|
activeSearchMatch: DiffSearchMatch | null;
|
|
44
44
|
agentId: 'codex' | 'claude' | 'opencode' | 'pi';
|
|
45
45
|
agentLabel: string;
|
|
@@ -61,7 +61,6 @@ export declare function ReviewCodeView({ activeSearchMatch, agentId, agentLabel,
|
|
|
61
61
|
gitIdentity: GitIdentity | null;
|
|
62
62
|
hunkNavigation: HunkNavigationRequest | null;
|
|
63
63
|
initialMarkdownPreviewSectionIds?: ReadonlySet<string>;
|
|
64
|
-
isPullRequest: boolean;
|
|
65
64
|
isReadOnly?: boolean;
|
|
66
65
|
itemVersionByKey: Readonly<Record<string, number>>;
|
|
67
66
|
keymap: CodiffKeymap;
|
|
@@ -95,6 +94,7 @@ export declare function ReviewCodeView({ activeSearchMatch, agentId, agentLabel,
|
|
|
95
94
|
source: ReviewSource;
|
|
96
95
|
sourceDescriptionActions?: ReactNode;
|
|
97
96
|
sourceDescriptionFooter?: ReactNode;
|
|
97
|
+
supportsReviewCommentActions: boolean;
|
|
98
98
|
theme?: CodiffPreferences['theme'];
|
|
99
99
|
viewed: Record<string, string>;
|
|
100
100
|
walkthroughNotes: ReadonlyMap<string, WalkthroughNote>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type ReviewModeItem<Mode extends string> = {
|
|
3
|
+
ariaLabel?: string;
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
indicator?: ReactNode;
|
|
6
|
+
label: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
value: Mode;
|
|
9
|
+
};
|
|
10
|
+
export declare function ReviewTopBar<Mode extends string>({ actions, context, leading, mode, modes, onModeChange, onToggleSidebar, repository, repositoryTooltip, sidebarCollapsed, toggleTitle, }: {
|
|
11
|
+
actions?: ReactNode;
|
|
12
|
+
context?: ReactNode;
|
|
13
|
+
leading?: ReactNode;
|
|
14
|
+
mode: Mode;
|
|
15
|
+
modes: ReadonlyArray<ReviewModeItem<Mode>>;
|
|
16
|
+
onModeChange: (mode: Mode) => void;
|
|
17
|
+
onToggleSidebar: () => void;
|
|
18
|
+
repository: ReactNode;
|
|
19
|
+
repositoryTooltip?: string;
|
|
20
|
+
sidebarCollapsed: boolean;
|
|
21
|
+
toggleTitle: string;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import type { CodiffKeymap } from '../../config/types.ts';
|
|
|
2
2
|
import type { DiffLineCount, PullRequestSource, SidebarMode, WalkthroughError } from '../../lib/app-types.ts';
|
|
3
3
|
import type { ChangedFile, HistoryEntry, NarrativeWalkthrough, ReviewSource } from '../../types.ts';
|
|
4
4
|
import type { NarrativeNavigation } from './walkthrough/useNarrativeNavigation.ts';
|
|
5
|
-
export declare function Sidebar({ branchSource, commitFiles, commitViewOpen, currentSource, files, historyEntries, historyHasMore, historyLoading, keymap, mode, narrativeNavigation, narrativeWalkthrough, onActivatePath, onLoadMoreHistory,
|
|
5
|
+
export declare function Sidebar({ branchSource, commitFiles, commitViewOpen, currentSource, files, historyEntries, historyHasMore, historyLoading, keymap, mode, narrativeNavigation, narrativeWalkthrough, onActivatePath, onLoadMoreHistory, onSearchQueryChange, onSelectSource, onShareWalkthrough, onToggleCommitView, pullRequestSource, reloadDeltaPaths, searchQuery, selectedPath, shareWalkthroughDisabled, showWhitespace, viewed, walkthroughError, walkthroughLoading, walkthroughProgress, }: {
|
|
6
6
|
branchSource: Extract<ReviewSource, {
|
|
7
7
|
type: 'branch-diff';
|
|
8
8
|
}> | null;
|
|
@@ -19,7 +19,6 @@ export declare function Sidebar({ branchSource, commitFiles, commitViewOpen, cur
|
|
|
19
19
|
narrativeWalkthrough: NarrativeWalkthrough | null;
|
|
20
20
|
onActivatePath: (path: string) => void;
|
|
21
21
|
onLoadMoreHistory: () => void;
|
|
22
|
-
onModeChange: (mode: SidebarMode) => void;
|
|
23
22
|
onSearchQueryChange: (query: string) => void;
|
|
24
23
|
onSelectSource: (source: ReviewSource) => void;
|
|
25
24
|
onShareWalkthrough?: () => void;
|
|
@@ -33,13 +32,11 @@ export declare function Sidebar({ branchSource, commitFiles, commitViewOpen, cur
|
|
|
33
32
|
viewed: Record<string, string>;
|
|
34
33
|
walkthroughError: WalkthroughError | null;
|
|
35
34
|
walkthroughLoading: boolean;
|
|
36
|
-
walkthroughOutdatedPaths: ReadonlySet<string>;
|
|
37
35
|
walkthroughProgress: {
|
|
38
36
|
phase: import('../../types.ts').WalkthroughProgressPhase | null;
|
|
39
37
|
responseLabelIndex: number;
|
|
40
38
|
stageRevision: number;
|
|
41
39
|
};
|
|
42
|
-
walkthroughUnread: boolean;
|
|
43
40
|
}): import("react").JSX.Element;
|
|
44
41
|
export declare function DiffLineCountBadge({ ariaLabelPrefix, className, lineCount, }: {
|
|
45
42
|
ariaLabelPrefix?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Thinking(): import("react").JSX.Element;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { ChangedFile, NarrativeWalkthrough } from '../../../types.ts';
|
|
2
2
|
import type { NarrativeNavigation } from './useNarrativeNavigation.ts';
|
|
3
|
-
export declare function NarrativeSidebar({ allowCommit,
|
|
3
|
+
export declare function NarrativeSidebar({ allowCommit, files, navigation, onShareWalkthrough, shareWalkthroughDisabled, showWhitespace, walkthrough, }: {
|
|
4
4
|
allowCommit?: boolean;
|
|
5
|
-
changedPaths?: ReadonlySet<string>;
|
|
6
5
|
files: ReadonlyArray<ChangedFile>;
|
|
7
6
|
navigation: NarrativeNavigation;
|
|
8
7
|
onShareWalkthrough?: () => void;
|
|
@@ -24,18 +24,15 @@ export declare const getWalkthroughBlockScrollTarget: ({ activeBlockId, firstSup
|
|
|
24
24
|
export type RenderWalkthroughDiffBlocks = (blocks: ReadonlyArray<ReviewDiffBlock>, scrollTarget: WalkthroughBlockScrollTarget | null, onActiveBlockChange: (blockId: string) => void) => ReactNode;
|
|
25
25
|
type WalkthroughNavigationKeyEvent = Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'key' | 'metaKey' | 'shiftKey'>;
|
|
26
26
|
export declare const getWalkthroughNavigationKeyDirection: (event: WalkthroughNavigationKeyEvent) => -1 | 0 | 1;
|
|
27
|
-
export declare function NarrativeWalkthroughView({ allowCommit,
|
|
27
|
+
export declare function NarrativeWalkthroughView({ allowCommit, files, navigation, onActiveReviewTargetChange, onCommit, onCommitOutput, onShareWalkthrough, onUpdateCommitMessage, renderDiffBlocks, shareWalkthroughDisabled, showWhitespace, walkthrough, }: {
|
|
28
28
|
allowCommit?: boolean;
|
|
29
|
-
changedPaths?: ReadonlySet<string>;
|
|
30
29
|
files: ReadonlyArray<ChangedFile>;
|
|
31
30
|
navigation: NarrativeNavigation;
|
|
32
31
|
onActiveReviewTargetChange: (target: WalkthroughReviewTarget | null) => void;
|
|
33
32
|
onCommit: CommitHandler;
|
|
34
33
|
onCommitOutput?: CommitOutputSubscriber;
|
|
35
|
-
onRegenerateWalkthrough?: () => void;
|
|
36
34
|
onShareWalkthrough?: () => void;
|
|
37
35
|
onUpdateCommitMessage: CommitMessageHandler;
|
|
38
|
-
regenerateDisabled?: boolean;
|
|
39
36
|
renderDiffBlocks: RenderWalkthroughDiffBlocks;
|
|
40
37
|
shareWalkthroughDisabled?: boolean;
|
|
41
38
|
showWhitespace: boolean;
|
|
@@ -49,7 +49,7 @@ export declare function useAppWalkthrough({ preferencesRef, state, stateGenerati
|
|
|
49
49
|
narrativeWalkthroughRef: RefObject<NarrativeWalkthrough | null>;
|
|
50
50
|
openCommitView: () => void;
|
|
51
51
|
plainCommitModel: import("../../lib/narrative-walkthrough.ts").CommitModel;
|
|
52
|
-
|
|
52
|
+
refreshWalkthroughForState: (nextState: RepositoryState, previousWalkthrough?: NarrativeWalkthrough | null) => void;
|
|
53
53
|
setMainMode: import("react").Dispatch<import("react").SetStateAction<MainMode>>;
|
|
54
54
|
setNarrativeWalkthrough: import("react").Dispatch<import("react").SetStateAction<NarrativeWalkthrough | null>>;
|
|
55
55
|
setShareWalkthroughEnabled: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
@@ -61,7 +61,6 @@ export declare function useAppWalkthrough({ preferencesRef, state, stateGenerati
|
|
|
61
61
|
} | null>>;
|
|
62
62
|
setWalkthroughFileError: import("react").Dispatch<import("react").SetStateAction<WalkthroughFileError | null>>;
|
|
63
63
|
setWalkthroughLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
64
|
-
setWalkthroughOutdatedPaths: import("react").Dispatch<import("react").SetStateAction<ReadonlySet<string>>>;
|
|
65
64
|
setWalkthroughUnread: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
66
65
|
showNarrativeWalkthrough: boolean;
|
|
67
66
|
showPlainCommitView: boolean;
|
|
@@ -83,8 +82,6 @@ export declare function useAppWalkthrough({ preferencesRef, state, stateGenerati
|
|
|
83
82
|
} | null>;
|
|
84
83
|
walkthroughFileError: WalkthroughFileError | null;
|
|
85
84
|
walkthroughLoading: boolean;
|
|
86
|
-
walkthroughOutdatedPaths: ReadonlySet<string>;
|
|
87
|
-
walkthroughOutdatedPathsRef: RefObject<ReadonlySet<string>>;
|
|
88
85
|
walkthroughProgress: {
|
|
89
86
|
phase: WalkthroughProgressEvent['phase'] | null;
|
|
90
87
|
responseLabelIndex: number;
|
package/dist/lib/app-types.d.ts
CHANGED
|
@@ -112,7 +112,11 @@ export type SourceSession = {
|
|
|
112
112
|
selectedPath: string | null;
|
|
113
113
|
viewed: Record<string, string>;
|
|
114
114
|
walkthroughError: WalkthroughError | null;
|
|
115
|
-
|
|
115
|
+
walkthroughFiles: ReadonlyArray<{
|
|
116
|
+
fingerprint: string;
|
|
117
|
+
path: string;
|
|
118
|
+
status: ChangedFile['status'];
|
|
119
|
+
}>;
|
|
116
120
|
};
|
|
117
121
|
export type RepositoryLoadError = {
|
|
118
122
|
kind: 'generic' | 'not-a-repository';
|
|
@@ -16,7 +16,9 @@ type ReloadSelection = {
|
|
|
16
16
|
export declare const consumeReloadSelection: () => ReloadSelection | null;
|
|
17
17
|
export declare const getReloadSelectionPath: (selection: ReloadSelection | null, state: RepositoryState) => string | null;
|
|
18
18
|
export declare const getChangedPaths: (previousFiles: ReadonlyArray<ReloadSelectionFile>, nextFiles: ReadonlyArray<ReloadSelectionFile>) => ReadonlySet<string>;
|
|
19
|
+
export declare const haveChangedFiles: (previousFiles: ReadonlyArray<ReloadSelectionFile>, nextFiles: ReadonlyArray<ReloadSelectionFile>) => boolean;
|
|
19
20
|
export declare const getReloadDeltaPaths: (selection: ReloadSelection | null, state: RepositoryState) => ReadonlySet<string>;
|
|
21
|
+
export declare const haveReloadedFilesChanged: (selection: ReloadSelection | null, state: RepositoryState) => boolean;
|
|
20
22
|
export declare const getReloadHistorySource: (selection: ReloadSelection | null, state: RepositoryState) => ReviewSource | null;
|
|
21
23
|
export declare const getReloadMainMode: (selection: ReloadSelection | null, state: RepositoryState) => ReloadMainMode | null;
|
|
22
24
|
export declare const writeReloadSelection: (state: RepositoryState | null, selectedPath: string | null, historySource?: ReviewSource | null, mainMode?: ReloadMainMode) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChangedFile, PullRequestReviewComment, RepositoryState } from '../types.ts';
|
|
1
|
+
import type { ChangedFile, PullRequestExistingReviewComment, PullRequestReviewComment, RepositoryState } from '../types.ts';
|
|
2
2
|
import type { CodeViewInstance, ReviewComment } from './app-types.ts';
|
|
3
3
|
export declare const isInteractiveReviewEvent: (event: PointerEvent) => boolean;
|
|
4
4
|
export declare const hasActiveTextSelection: () => boolean;
|
|
@@ -18,7 +18,11 @@ export declare const getReviewCommentRangeProps: (comment: Pick<ReviewComment, '
|
|
|
18
18
|
startLineNumber: number;
|
|
19
19
|
startSide?: "additions" | "deletions" | undefined;
|
|
20
20
|
};
|
|
21
|
-
export declare const toPullRequestReviewComment: (comment: ReviewComment
|
|
21
|
+
export declare const toPullRequestReviewComment: (comment: ReviewComment, { includeSectionId }?: {
|
|
22
|
+
includeSectionId?: boolean;
|
|
23
|
+
}) => PullRequestReviewComment;
|
|
24
|
+
export declare const toSubmittedReviewComment: (comment: PullRequestExistingReviewComment, draft: ReviewComment) => ReviewComment;
|
|
25
|
+
export declare const mergeReviewComments: (snapshotComments: ReadonlyArray<ReviewComment>, localComments: ReadonlyArray<ReviewComment>) => ReadonlyArray<ReviewComment>;
|
|
22
26
|
export declare const getPendingPullRequestReviewComments: (comments: ReadonlyArray<ReviewComment>, activeDraft?: Pick<ReviewComment, 'body' | 'id'> | null) => ReviewComment[];
|
|
23
27
|
export declare const findReusableReviewCommentDraft: (comments: ReadonlyArray<ReviewComment>, activeDraft?: Pick<ReviewComment, 'body' | 'id'> | null) => ReviewComment | undefined;
|
|
24
28
|
export declare const getCommentKey: (comment: Pick<ReviewComment, 'anchor' | 'lineNumber' | 'sectionId' | 'side' | 'startLineNumber' | 'startSide'>) => string;
|
package/dist/react.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { Button, buttonVariants, type ButtonProps } from './app/components/Button.tsx';
|
|
2
|
+
export { Thinking } from './app/components/Thinking.tsx';
|
|
2
3
|
export { getPlanCommentAffordancePosition, getPlanCommentColorIndex, getPlanCommentIdentityColorIndex, getSharedPlanDownloadContent, PlanReviewSurface, type PlanReviewCommenting, } from './SharedPlanApp.tsx';
|
|
3
4
|
export { ReadOnlyGeneralCommentCard, ReviewSurface, type ReviewCommenting, type ReviewMode, type ReviewSurfaceProps, type ReviewWalkthroughStatus, } from './SharedWalkthroughApp.tsx';
|