@nkzw/codiff-core 1.9.0 → 1.10.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.
@@ -32,10 +32,11 @@ export type ReviewSurfaceProps = {
32
32
  onDeleteShare?: () => Promise<void> | void;
33
33
  onModeChange?: (mode: ReviewMode) => void;
34
34
  providerLabel?: string;
35
+ repositoryUrl?: string;
35
36
  settingsBar?: ReactNode;
36
37
  signInLabel?: string;
37
38
  snapshot: SharedWalkthroughSnapshot;
38
39
  sourceDescriptionFooterAside?: ReactNode;
39
40
  title?: string;
40
41
  };
41
- export declare function ReviewSurface({ commenting, externalUrl, gitIdentity, initialMode, interactive, onDeleteShare, 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;
@@ -0,0 +1,6 @@
1
+ import type { OpenReviewSourceKind } from '../../types.ts';
2
+ export declare function OpenReviewSourceDialog({ kind, onClose, onOpen, }: {
3
+ kind: OpenReviewSourceKind;
4
+ onClose: () => void;
5
+ onOpen: (value: string) => Promise<void>;
6
+ }): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { OpenReviewSourceKind } from '../../types.ts';
2
+ export declare function OpenReviewSourceMenu({ onOpen, onOpenFolder, }: {
3
+ onOpen: (kind: OpenReviewSourceKind) => void;
4
+ onOpenFolder: () => void;
5
+ }): import("react").JSX.Element;
@@ -1,12 +1,17 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import type { CodiffKeymap } from '../../config/types.ts';
3
3
  import type { RepositoryLoadError, ReviewComment } from '../../lib/app-types.ts';
4
- import type { ChangedFile, PullRequestMergeOptions, PullRequestMergeState, PullRequestReviewEvent, PullRequestReviewStatus } from '../../types.ts';
4
+ import type { ChangedFile, CodiffUpdateStatus, PullRequestMergeOptions, PullRequestMergeState, PullRequestReviewEvent, PullRequestReviewStatus } from '../../types.ts';
5
5
  export declare function ReviewSourceLoading(): import("react").JSX.Element;
6
6
  export declare function RepositoryChangeBanner({ onRefresh, visible, }: {
7
7
  onRefresh: () => void;
8
8
  visible: boolean;
9
9
  }): import("react").JSX.Element;
10
+ export type { CodiffUpdateStatus as UpdateStatus } from '../../types.ts';
11
+ export declare function UpdatePill({ onApply, status, }: {
12
+ onApply: () => void;
13
+ status: CodiffUpdateStatus;
14
+ }): import("react").JSX.Element | null;
10
15
  export declare function WalkthroughOutdatedBanner({ onDismiss, reason, }: {
11
16
  onDismiss: () => void;
12
17
  reason: string | null;
@@ -0,0 +1,23 @@
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, sourceMenu, 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
+ sourceMenu?: ReactNode;
22
+ toggleTitle: string;
23
+ }): 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, onModeChange, onSearchQueryChange, onSelectSource, onShareWalkthrough, onToggleCommitView, pullRequestSource, reloadDeltaPaths, searchQuery, selectedPath, shareWalkthroughDisabled, showWhitespace, viewed, walkthroughError, walkthroughLoading, walkthroughProgress, walkthroughUnread, }: {
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;
@@ -38,7 +37,6 @@ export declare function Sidebar({ branchSource, commitFiles, commitViewOpen, cur
38
37
  responseLabelIndex: number;
39
38
  stageRevision: number;
40
39
  };
41
- walkthroughUnread: boolean;
42
40
  }): import("react").JSX.Element;
43
41
  export declare function DiffLineCountBadge({ ariaLabelPrefix, className, lineCount, }: {
44
42
  ariaLabelPrefix?: string;
@@ -2,12 +2,13 @@ import { type RefObject } from 'react';
2
2
  import type { ReviewComment, ReviewIdentity, SidebarMode } from '../../lib/app-types.ts';
3
3
  import { type Command } from '../../lib/command-registry.ts';
4
4
  import type { ReviewCommandTarget } from '../../lib/review-command-target.ts';
5
- import type { ChangedFile, CodiffPreferences, RepositoryState } from '../../types.ts';
5
+ import type { ChangedFile, CodiffPreferences, OpenReviewSourceKind, RepositoryState } from '../../types.ts';
6
6
  type UseAppCommandsOptions = {
7
7
  changeSidebarMode: (mode: SidebarMode) => void;
8
8
  focusFileFilter: () => void;
9
9
  getReviewCommandTarget: () => ReviewCommandTarget | null;
10
10
  onOpenDiffSearch: () => void;
11
+ onOpenReviewSource: (kind: OpenReviewSourceKind) => void;
11
12
  onOpenSelectedFile: () => void;
12
13
  onRefreshRepository: () => void;
13
14
  onToggleSidebar: () => void;
@@ -18,5 +19,5 @@ type UseAppCommandsOptions = {
18
19
  stateRef: RefObject<RepositoryState | null>;
19
20
  viewedRef: RefObject<Record<string, string>>;
20
21
  };
21
- export declare function useAppCommands({ changeSidebarMode, focusFileFilter, getReviewCommandTarget, onOpenDiffSearch, onOpenSelectedFile, onRefreshRepository, onToggleSidebar, onToggleViewed, onToggleWordWrap, preferencesRef, reviewCommentsRef, stateRef, viewedRef, }: UseAppCommandsOptions): readonly Command[];
22
+ export declare function useAppCommands({ changeSidebarMode, focusFileFilter, getReviewCommandTarget, onOpenDiffSearch, onOpenReviewSource, onOpenSelectedFile, onRefreshRepository, onToggleSidebar, onToggleViewed, onToggleWordWrap, preferencesRef, reviewCommentsRef, stateRef, viewedRef, }: UseAppCommandsOptions): readonly Command[];
22
23
  export {};
@@ -0,0 +1,13 @@
1
+ export type NativeKeyboardKeyMapping = {
2
+ value: string;
3
+ valueIsDeadKey?: boolean;
4
+ withShift: string;
5
+ withShiftIsDeadKey?: boolean;
6
+ };
7
+ export type NativeKeyboardLayout = Readonly<Record<string, NativeKeyboardKeyMapping>>;
8
+ export declare const codeForCharacter: (character: string, shiftKey: boolean) => string | null;
9
+ export declare const shiftedCharacterForCode: (code: string) => string | null;
10
+ export declare const hasKeyboardLayout: () => boolean;
11
+ export declare const trackKeyboardLayout: () => void;
12
+ export declare const applyKeyboardLayout: (layout: NativeKeyboardLayout) => void;
13
+ export declare const resetKeyboardLayout: () => void;
@@ -1,3 +1,5 @@
1
1
  import type { CodiffKeymap } from './types.ts';
2
- export declare const matchesShortcut: (event: Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'key' | 'metaKey' | 'shiftKey'>, keymap: CodiffKeymap, action: keyof CodiffKeymap) => boolean;
2
+ type ShortcutEvent = Pick<KeyboardEvent, 'altKey' | 'code' | 'ctrlKey' | 'key' | 'metaKey' | 'shiftKey'>;
3
+ export declare const matchesShortcut: (event: ShortcutEvent, keymap: CodiffKeymap, action: keyof CodiffKeymap) => boolean;
3
4
  export declare const getShortcutLabel: (keymap: CodiffKeymap, action: keyof CodiffKeymap) => string;
5
+ export {};
@@ -3,6 +3,7 @@ export type CodiffTheme = 'system' | 'light' | 'dark';
3
3
  export type CodiffAgentBackend = 'codex' | 'claude' | 'opencode' | 'pi';
4
4
  export type CodiffSettings = {
5
5
  agentBackend: CodiffAgentBackend;
6
+ checkForUpdates: boolean;
6
7
  claudeModel: string;
7
8
  codeFontFamily: string;
8
9
  codeFontSize: number;
@@ -9,6 +9,15 @@ export declare const fileTreeSort: (left: {
9
9
  path: string;
10
10
  segments?: ReadonlyArray<string>;
11
11
  }) => number;
12
- export declare const compactPath: (path: string) => string;
12
+ export declare const abbreviateHomePath: (path: string) => string;
13
+ /**
14
+ * Splits a repository path into a shrinkable head and the repository's own
15
+ * directory, so the top bar can keep the repository name visible and put the
16
+ * ellipsis in the middle when the full path overflows.
17
+ */
18
+ export declare const splitRepositoryPath: (path: string) => {
19
+ head: string;
20
+ tail: string;
21
+ };
13
22
  export declare const sortFiles: (files: ReadonlyArray<ChangedFile>) => ChangedFile[];
14
23
  export declare const fuzzyMatches: (path: string, query: string) => boolean;