diffity 0.1.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/.claude/settings.local.json +11 -0
- package/LICENSE +21 -0
- package/README.md +71 -0
- package/development.md +156 -0
- package/package.json +32 -0
- package/packages/cli/build.js +38 -0
- package/packages/cli/package.json +51 -0
- package/packages/cli/src/agent.ts +187 -0
- package/packages/cli/src/db.ts +58 -0
- package/packages/cli/src/index.ts +196 -0
- package/packages/cli/src/review-routes.ts +150 -0
- package/packages/cli/src/server.ts +370 -0
- package/packages/cli/src/session.ts +48 -0
- package/packages/cli/src/threads.ts +238 -0
- package/packages/cli/tsconfig.json +13 -0
- package/packages/git/package.json +24 -0
- package/packages/git/src/commits.ts +28 -0
- package/packages/git/src/diff.ts +97 -0
- package/packages/git/src/exec.ts +35 -0
- package/packages/git/src/index.ts +5 -0
- package/packages/git/src/repo.ts +63 -0
- package/packages/git/src/status.ts +9 -0
- package/packages/git/src/types.ts +12 -0
- package/packages/git/tsconfig.json +9 -0
- package/packages/parser/package.json +26 -0
- package/packages/parser/src/index.ts +12 -0
- package/packages/parser/src/parse.ts +299 -0
- package/packages/parser/src/types.ts +52 -0
- package/packages/parser/src/word-diff.ts +155 -0
- package/packages/parser/tests/fixtures/binary-deleted.diff +4 -0
- package/packages/parser/tests/fixtures/binary-file.diff +4 -0
- package/packages/parser/tests/fixtures/binary-modified.diff +3 -0
- package/packages/parser/tests/fixtures/copied-file.diff +12 -0
- package/packages/parser/tests/fixtures/deleted-file.diff +9 -0
- package/packages/parser/tests/fixtures/empty.diff +0 -0
- package/packages/parser/tests/fixtures/hunk-with-context.diff +12 -0
- package/packages/parser/tests/fixtures/mode-change-with-content.diff +10 -0
- package/packages/parser/tests/fixtures/mode-change.diff +3 -0
- package/packages/parser/tests/fixtures/multi-file.diff +22 -0
- package/packages/parser/tests/fixtures/new-file.diff +9 -0
- package/packages/parser/tests/fixtures/no-newline.diff +10 -0
- package/packages/parser/tests/fixtures/renamed-file.diff +12 -0
- package/packages/parser/tests/fixtures/single-file-additions.diff +11 -0
- package/packages/parser/tests/fixtures/single-file-deletions.diff +11 -0
- package/packages/parser/tests/fixtures/single-file-mixed.diff +15 -0
- package/packages/parser/tests/fixtures/single-file-multi-hunk.diff +22 -0
- package/packages/parser/tests/fixtures/spaces-in-path.diff +9 -0
- package/packages/parser/tests/fixtures/submodule.diff +7 -0
- package/packages/parser/tests/fixtures/unicode-content.diff +11 -0
- package/packages/parser/tests/parse.test.ts +312 -0
- package/packages/parser/tests/word-diff-integration.test.ts +52 -0
- package/packages/parser/tests/word-diff.test.ts +121 -0
- package/packages/parser/tsconfig.json +10 -0
- package/packages/skills/diffity-resolve/SKILL.md +55 -0
- package/packages/skills/diffity-review/SKILL.md +74 -0
- package/packages/skills/diffity-start/SKILL.md +25 -0
- package/packages/ui/index.html +13 -0
- package/packages/ui/package.json +35 -0
- package/packages/ui/public/brand.svg +12 -0
- package/packages/ui/public/favicon.svg +15 -0
- package/packages/ui/src/app.tsx +14 -0
- package/packages/ui/src/components/comment-bubble.tsx +78 -0
- package/packages/ui/src/components/comment-form-row.tsx +58 -0
- package/packages/ui/src/components/comment-form.tsx +78 -0
- package/packages/ui/src/components/comment-line-number.tsx +60 -0
- package/packages/ui/src/components/comment-thread.tsx +209 -0
- package/packages/ui/src/components/commit-list.tsx +100 -0
- package/packages/ui/src/components/dashboard.tsx +84 -0
- package/packages/ui/src/components/diff-line.tsx +90 -0
- package/packages/ui/src/components/diff-page.tsx +332 -0
- package/packages/ui/src/components/diff-stats.tsx +20 -0
- package/packages/ui/src/components/diff-view.tsx +278 -0
- package/packages/ui/src/components/expand-row.tsx +45 -0
- package/packages/ui/src/components/file-block.tsx +536 -0
- package/packages/ui/src/components/file-tree-item.tsx +84 -0
- package/packages/ui/src/components/file-tree.tsx +72 -0
- package/packages/ui/src/components/general-comments.tsx +174 -0
- package/packages/ui/src/components/hunk-block-split.tsx +357 -0
- package/packages/ui/src/components/hunk-block.tsx +161 -0
- package/packages/ui/src/components/hunk-header.tsx +144 -0
- package/packages/ui/src/components/hunk-with-gap.tsx +113 -0
- package/packages/ui/src/components/icons/arrow-down-icon.tsx +7 -0
- package/packages/ui/src/components/icons/arrow-up-icon.tsx +7 -0
- package/packages/ui/src/components/icons/check-circle-icon.tsx +8 -0
- package/packages/ui/src/components/icons/check-icon.tsx +9 -0
- package/packages/ui/src/components/icons/chevron-down-icon.tsx +11 -0
- package/packages/ui/src/components/icons/chevron-icon.tsx +20 -0
- package/packages/ui/src/components/icons/chevron-up-down-icon.tsx +7 -0
- package/packages/ui/src/components/icons/chevron-up-icon.tsx +11 -0
- package/packages/ui/src/components/icons/comment-icon.tsx +9 -0
- package/packages/ui/src/components/icons/copy-icon.tsx +10 -0
- package/packages/ui/src/components/icons/eye-icon.tsx +10 -0
- package/packages/ui/src/components/icons/eye-off-icon.tsx +12 -0
- package/packages/ui/src/components/icons/file-icon.tsx +7 -0
- package/packages/ui/src/components/icons/folder-icon.tsx +19 -0
- package/packages/ui/src/components/icons/git-branch-icon.tsx +13 -0
- package/packages/ui/src/components/icons/keyboard-icon.tsx +13 -0
- package/packages/ui/src/components/icons/moon-icon.tsx +9 -0
- package/packages/ui/src/components/icons/plus-icon.tsx +9 -0
- package/packages/ui/src/components/icons/search-icon.tsx +10 -0
- package/packages/ui/src/components/icons/sidebar-icon.tsx +10 -0
- package/packages/ui/src/components/icons/spinner.tsx +7 -0
- package/packages/ui/src/components/icons/split-view-icon.tsx +10 -0
- package/packages/ui/src/components/icons/sun-icon.tsx +17 -0
- package/packages/ui/src/components/icons/trash-icon.tsx +11 -0
- package/packages/ui/src/components/icons/undo-icon.tsx +9 -0
- package/packages/ui/src/components/icons/unified-view-icon.tsx +12 -0
- package/packages/ui/src/components/icons/x-icon.tsx +10 -0
- package/packages/ui/src/components/line-number-cell.tsx +18 -0
- package/packages/ui/src/components/markdown-content.tsx +139 -0
- package/packages/ui/src/components/orphaned-threads.tsx +80 -0
- package/packages/ui/src/components/overview-file-list.tsx +57 -0
- package/packages/ui/src/components/render-expansion-rows.tsx +47 -0
- package/packages/ui/src/components/shortcut-modal.tsx +93 -0
- package/packages/ui/src/components/sidebar.tsx +80 -0
- package/packages/ui/src/components/skeleton.tsx +9 -0
- package/packages/ui/src/components/stale-diff-banner.tsx +21 -0
- package/packages/ui/src/components/summary-bar.tsx +39 -0
- package/packages/ui/src/components/toolbar.tsx +246 -0
- package/packages/ui/src/components/ui/badge.tsx +17 -0
- package/packages/ui/src/components/ui/confirm-dialog.tsx +52 -0
- package/packages/ui/src/components/ui/icon-button.tsx +23 -0
- package/packages/ui/src/components/ui/status-badge.tsx +57 -0
- package/packages/ui/src/components/ui/thread-badge.tsx +35 -0
- package/packages/ui/src/components/word-diff.tsx +126 -0
- package/packages/ui/src/hooks/use-comment-actions.ts +97 -0
- package/packages/ui/src/hooks/use-commits.ts +12 -0
- package/packages/ui/src/hooks/use-copy.ts +18 -0
- package/packages/ui/src/hooks/use-diff-staleness.ts +58 -0
- package/packages/ui/src/hooks/use-diff.ts +12 -0
- package/packages/ui/src/hooks/use-highlighter.ts +190 -0
- package/packages/ui/src/hooks/use-info.ts +12 -0
- package/packages/ui/src/hooks/use-keyboard.ts +55 -0
- package/packages/ui/src/hooks/use-line-selection.ts +157 -0
- package/packages/ui/src/hooks/use-overview.ts +12 -0
- package/packages/ui/src/hooks/use-review-threads.ts +12 -0
- package/packages/ui/src/hooks/use-search-params.ts +26 -0
- package/packages/ui/src/hooks/use-theme.ts +34 -0
- package/packages/ui/src/hooks/use-thread-navigation.ts +43 -0
- package/packages/ui/src/lib/api.ts +232 -0
- package/packages/ui/src/lib/cn.ts +6 -0
- package/packages/ui/src/lib/context-expansion.ts +122 -0
- package/packages/ui/src/lib/diff-utils.ts +268 -0
- package/packages/ui/src/lib/dom-utils.ts +13 -0
- package/packages/ui/src/lib/file-tree.ts +122 -0
- package/packages/ui/src/lib/query-client.ts +10 -0
- package/packages/ui/src/lib/render-content.tsx +23 -0
- package/packages/ui/src/lib/syntax-token.ts +4 -0
- package/packages/ui/src/main.tsx +14 -0
- package/packages/ui/src/queries/commits.ts +9 -0
- package/packages/ui/src/queries/diff.ts +9 -0
- package/packages/ui/src/queries/file.ts +10 -0
- package/packages/ui/src/queries/info.ts +9 -0
- package/packages/ui/src/queries/overview.ts +9 -0
- package/packages/ui/src/styles/app.css +178 -0
- package/packages/ui/src/types/comment.ts +61 -0
- package/packages/ui/src/vite-env.d.ts +1 -0
- package/packages/ui/tests/context-expansion.test.ts +279 -0
- package/packages/ui/tests/diff-utils.test.ts +409 -0
- package/packages/ui/tsconfig.json +14 -0
- package/packages/ui/vite.config.ts +23 -0
- package/scripts/build-skills.ts +26 -0
- package/scripts/build.ts +15 -0
- package/scripts/dev.ts +32 -0
- package/scripts/lib/transformers/claude-code.ts +11 -0
- package/scripts/lib/transformers/codex.ts +17 -0
- package/scripts/lib/transformers/cursor.ts +17 -0
- package/scripts/lib/transformers/index.ts +3 -0
- package/scripts/lib/utils.ts +70 -0
- package/scripts/link-dev.ts +54 -0
- package/skills/diffity-resolve/SKILL.md +55 -0
- package/skills/diffity-review/SKILL.md +74 -0
- package/skills/diffity-start/SKILL.md +27 -0
- package/tsconfig.json +22 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { DiffHunk } from '@diffity/parser';
|
|
2
|
+
import { ArrowUpIcon } from './icons/arrow-up-icon';
|
|
3
|
+
import { ArrowDownIcon } from './icons/arrow-down-icon';
|
|
4
|
+
import { ChevronUpDownIcon } from './icons/chevron-up-down-icon';
|
|
5
|
+
import { Spinner } from './icons/spinner';
|
|
6
|
+
|
|
7
|
+
export interface ExpandControls {
|
|
8
|
+
position: 'top' | 'between' | 'bottom';
|
|
9
|
+
remainingLines: number;
|
|
10
|
+
remainingUp: number;
|
|
11
|
+
remainingDown: number;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
wasExpanded: boolean;
|
|
14
|
+
onExpand: (direction: 'up' | 'down' | 'all') => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface HunkHeaderProps {
|
|
18
|
+
hunk: DiffHunk;
|
|
19
|
+
expandControls?: ExpandControls;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function formatHunkHeader(hunk: DiffHunk): string {
|
|
23
|
+
const range = `@@ -${hunk.oldStart},${hunk.oldCount} +${hunk.newStart},${hunk.newCount} @@`;
|
|
24
|
+
if (hunk.context) {
|
|
25
|
+
return `${range} ${hunk.context}`;
|
|
26
|
+
}
|
|
27
|
+
return range;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const SMALL_GAP_THRESHOLD = 40;
|
|
31
|
+
|
|
32
|
+
const gutterCell = 'w-[25px] min-w-[25px] bg-diff-hunk-bg border-r border-border-muted p-0';
|
|
33
|
+
const expandBtn = 'flex items-center justify-center w-full h-[18px] cursor-pointer text-diff-hunk-text/70 hover:text-diff-hunk-text transition-colors';
|
|
34
|
+
const expandRow = 'bg-diff-hunk-bg';
|
|
35
|
+
|
|
36
|
+
function SpinnerCell() {
|
|
37
|
+
return (
|
|
38
|
+
<td className={gutterCell}>
|
|
39
|
+
<div className="flex items-center justify-center h-[18px]">
|
|
40
|
+
<Spinner />
|
|
41
|
+
</div>
|
|
42
|
+
</td>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function HunkHeader(props: HunkHeaderProps) {
|
|
47
|
+
const { hunk, expandControls } = props;
|
|
48
|
+
|
|
49
|
+
if (!expandControls) {
|
|
50
|
+
return (
|
|
51
|
+
<tr className="bg-diff-hunk-bg group/hunk">
|
|
52
|
+
<td colSpan={4} className="px-3 py-1 font-mono text-xs text-diff-hunk-text select-none">
|
|
53
|
+
{formatHunkHeader(hunk)}
|
|
54
|
+
</td>
|
|
55
|
+
</tr>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const { position, remainingLines, remainingUp, remainingDown, loading, wasExpanded, onExpand } = expandControls;
|
|
60
|
+
|
|
61
|
+
if (remainingLines <= 0) {
|
|
62
|
+
if (wasExpanded) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return (
|
|
66
|
+
<tr className="bg-diff-hunk-bg group/hunk">
|
|
67
|
+
<td colSpan={4} className="px-3 py-1 font-mono text-xs text-diff-hunk-text select-none">
|
|
68
|
+
{formatHunkHeader(hunk)}
|
|
69
|
+
</td>
|
|
70
|
+
</tr>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const isSmallGap = remainingLines <= SMALL_GAP_THRESHOLD;
|
|
75
|
+
const showUp = remainingUp > 0;
|
|
76
|
+
const showDown = remainingDown > 0;
|
|
77
|
+
|
|
78
|
+
if (position === 'top') {
|
|
79
|
+
return (
|
|
80
|
+
<tr className="bg-diff-hunk-bg group/hunk">
|
|
81
|
+
{loading ? <SpinnerCell /> : (
|
|
82
|
+
<td className={gutterCell}>
|
|
83
|
+
<button className={expandBtn} onClick={() => onExpand('up')} title={`Expand ${Math.min(remainingLines, 20)} lines`}>
|
|
84
|
+
<ArrowUpIcon />
|
|
85
|
+
</button>
|
|
86
|
+
</td>
|
|
87
|
+
)}
|
|
88
|
+
<td colSpan={3} className="px-3 py-1 font-mono text-xs text-diff-hunk-text select-none">
|
|
89
|
+
{formatHunkHeader(hunk)}
|
|
90
|
+
</td>
|
|
91
|
+
</tr>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (isSmallGap || (!showUp && showDown) || (showUp && !showDown)) {
|
|
96
|
+
return (
|
|
97
|
+
<tr className="bg-diff-hunk-bg group/hunk">
|
|
98
|
+
{loading ? <SpinnerCell /> : (
|
|
99
|
+
<td className={gutterCell}>
|
|
100
|
+
<button
|
|
101
|
+
className={expandBtn}
|
|
102
|
+
onClick={() => onExpand(isSmallGap ? 'all' : showUp ? 'up' : 'down')}
|
|
103
|
+
title={isSmallGap ? `Expand all ${remainingLines} lines` : `Expand ${Math.min(remainingLines, 20)} lines`}
|
|
104
|
+
>
|
|
105
|
+
{isSmallGap ? <ChevronUpDownIcon /> : showUp ? <ArrowUpIcon /> : <ArrowDownIcon />}
|
|
106
|
+
</button>
|
|
107
|
+
</td>
|
|
108
|
+
)}
|
|
109
|
+
<td colSpan={3} className="px-3 py-1 font-mono text-xs text-diff-hunk-text select-none">
|
|
110
|
+
{formatHunkHeader(hunk)}
|
|
111
|
+
</td>
|
|
112
|
+
</tr>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<>
|
|
118
|
+
<tr className={expandRow}>
|
|
119
|
+
{loading ? <SpinnerCell /> : (
|
|
120
|
+
<td className={gutterCell}>
|
|
121
|
+
<button className={expandBtn} onClick={() => onExpand('down')} title="Expand down">
|
|
122
|
+
<ArrowDownIcon />
|
|
123
|
+
</button>
|
|
124
|
+
</td>
|
|
125
|
+
)}
|
|
126
|
+
<td colSpan={3} />
|
|
127
|
+
</tr>
|
|
128
|
+
<tr className="bg-diff-hunk-bg group/hunk">
|
|
129
|
+
<td className={gutterCell} />
|
|
130
|
+
<td colSpan={3} className="px-3 py-1 font-mono text-xs text-diff-hunk-text select-none">
|
|
131
|
+
{formatHunkHeader(hunk)}
|
|
132
|
+
</td>
|
|
133
|
+
</tr>
|
|
134
|
+
<tr className={expandRow}>
|
|
135
|
+
<td className={gutterCell}>
|
|
136
|
+
<button className={expandBtn} onClick={() => onExpand('up')} title="Expand up">
|
|
137
|
+
<ArrowUpIcon />
|
|
138
|
+
</button>
|
|
139
|
+
</td>
|
|
140
|
+
<td colSpan={3} />
|
|
141
|
+
</tr>
|
|
142
|
+
</>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { DiffHunk, DiffLine as DiffLineType } from '@diffity/parser';
|
|
2
|
+
import type { HighlightedTokens } from '../hooks/use-highlighter';
|
|
3
|
+
import type { ViewMode } from '../lib/diff-utils';
|
|
4
|
+
import type { SyntaxToken } from '../lib/syntax-token';
|
|
5
|
+
import type { ExpandControls } from './hunk-header';
|
|
6
|
+
import type { CommentThread as CommentThreadType, CommentAuthor, CommentSide, LineSelection } from '../types/comment';
|
|
7
|
+
import { HunkBlock } from './hunk-block';
|
|
8
|
+
import { HunkBlockSplit } from './hunk-block-split';
|
|
9
|
+
import { buildExpansionSyntaxMap, renderExpansionRows } from './render-expansion-rows';
|
|
10
|
+
|
|
11
|
+
interface GapExpansion {
|
|
12
|
+
fromTop: number;
|
|
13
|
+
fromBottom: number;
|
|
14
|
+
linesFromTop: DiffLineType[];
|
|
15
|
+
linesFromBottom: DiffLineType[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface HunkWithGapProps {
|
|
19
|
+
hunk: DiffHunk;
|
|
20
|
+
viewMode: ViewMode;
|
|
21
|
+
syntaxMap?: Map<string, SyntaxToken[]>;
|
|
22
|
+
expandControls?: ExpandControls;
|
|
23
|
+
topExpansionLines?: DiffLineType[];
|
|
24
|
+
gapExpansion?: GapExpansion;
|
|
25
|
+
gapId?: string;
|
|
26
|
+
highlightLine?: (code: string) => HighlightedTokens[] | null;
|
|
27
|
+
threads?: CommentThreadType[];
|
|
28
|
+
pendingSelection?: LineSelection | null;
|
|
29
|
+
currentAuthor?: CommentAuthor;
|
|
30
|
+
isLineSelected?: (line: number, side: CommentSide) => boolean;
|
|
31
|
+
onLineMouseDown?: (line: number, side: CommentSide) => void;
|
|
32
|
+
onLineMouseEnter?: (line: number, side: CommentSide) => void;
|
|
33
|
+
onCommentClick?: (line: number, side: CommentSide) => void;
|
|
34
|
+
onAddThread?: (filePath: string, side: CommentSide, startLine: number, endLine: number, body: string, author: CommentAuthor) => void;
|
|
35
|
+
onReply?: (threadId: string, body: string, author: CommentAuthor) => void;
|
|
36
|
+
onResolve?: (threadId: string) => void;
|
|
37
|
+
onUnresolve?: (threadId: string) => void;
|
|
38
|
+
onDeleteComment?: (threadId: string, commentId: string) => void;
|
|
39
|
+
onDeleteThread?: (threadId: string) => void;
|
|
40
|
+
onCancelPending?: () => void;
|
|
41
|
+
filePath?: string;
|
|
42
|
+
onRevertChange?: (hunk: DiffHunk, startIndex: number, endIndex: number) => void;
|
|
43
|
+
getOriginalCode?: (side: CommentSide, startLine: number, endLine: number) => string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function HunkWithGap(props: HunkWithGapProps) {
|
|
47
|
+
const {
|
|
48
|
+
hunk, viewMode, syntaxMap, expandControls, topExpansionLines, gapExpansion, gapId, highlightLine,
|
|
49
|
+
threads, pendingSelection, currentAuthor, isLineSelected,
|
|
50
|
+
onLineMouseDown, onLineMouseEnter, onCommentClick,
|
|
51
|
+
onAddThread, onReply, onResolve, onUnresolve, onDeleteComment, onDeleteThread,
|
|
52
|
+
onCancelPending, filePath, onRevertChange, getOriginalCode,
|
|
53
|
+
} = props;
|
|
54
|
+
|
|
55
|
+
const HunkComponent = viewMode === 'split' ? HunkBlockSplit : HunkBlock;
|
|
56
|
+
|
|
57
|
+
const allExpansionLines = [
|
|
58
|
+
...(topExpansionLines || []),
|
|
59
|
+
...(gapExpansion?.linesFromTop || []),
|
|
60
|
+
...(gapExpansion?.linesFromBottom || []),
|
|
61
|
+
];
|
|
62
|
+
const expansionSyntaxMap = allExpansionLines.length > 0
|
|
63
|
+
? buildExpansionSyntaxMap(allExpansionLines, highlightLine)
|
|
64
|
+
: undefined;
|
|
65
|
+
|
|
66
|
+
const commentProps = {
|
|
67
|
+
isLineSelected, onLineMouseDown, onLineMouseEnter, onCommentClick,
|
|
68
|
+
threads, pendingSelection, currentAuthor,
|
|
69
|
+
onAddThread, onReply, onResolve, onUnresolve, onDeleteComment, onDeleteThread,
|
|
70
|
+
onCancelPending, filePath,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<>
|
|
75
|
+
{gapExpansion && gapExpansion.linesFromTop.length > 0 && (
|
|
76
|
+
<tbody>
|
|
77
|
+
{renderExpansionRows(
|
|
78
|
+
gapExpansion.linesFromTop,
|
|
79
|
+
viewMode,
|
|
80
|
+
`${gapId}-top`,
|
|
81
|
+
expansionSyntaxMap,
|
|
82
|
+
commentProps,
|
|
83
|
+
)}
|
|
84
|
+
</tbody>
|
|
85
|
+
)}
|
|
86
|
+
<HunkComponent
|
|
87
|
+
hunk={hunk}
|
|
88
|
+
syntaxMap={syntaxMap}
|
|
89
|
+
expandControls={expandControls}
|
|
90
|
+
topExpansionLines={topExpansionLines && topExpansionLines.length > 0 ? topExpansionLines : undefined}
|
|
91
|
+
bottomExpansionLines={gapExpansion && gapExpansion.linesFromBottom.length > 0 ? gapExpansion.linesFromBottom : undefined}
|
|
92
|
+
expansionSyntaxMap={expansionSyntaxMap}
|
|
93
|
+
threads={threads}
|
|
94
|
+
pendingSelection={pendingSelection}
|
|
95
|
+
currentAuthor={currentAuthor}
|
|
96
|
+
isLineSelected={isLineSelected}
|
|
97
|
+
onLineMouseDown={onLineMouseDown}
|
|
98
|
+
onLineMouseEnter={onLineMouseEnter}
|
|
99
|
+
onCommentClick={onCommentClick}
|
|
100
|
+
onAddThread={onAddThread}
|
|
101
|
+
onReply={onReply}
|
|
102
|
+
onResolve={onResolve}
|
|
103
|
+
onUnresolve={onUnresolve}
|
|
104
|
+
onDeleteComment={onDeleteComment}
|
|
105
|
+
onDeleteThread={onDeleteThread}
|
|
106
|
+
onCancelPending={onCancelPending}
|
|
107
|
+
filePath={filePath}
|
|
108
|
+
onRevertChange={onRevertChange}
|
|
109
|
+
getOriginalCode={getOriginalCode}
|
|
110
|
+
/>
|
|
111
|
+
</>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function ArrowDownIcon() {
|
|
2
|
+
return (
|
|
3
|
+
<svg className="w-[14px] h-[14px]" viewBox="0 0 16 16" fill="currentColor">
|
|
4
|
+
<path d="M2 13.25a.75.75 0 00.75.75h1a.75.75 0 000-1.5h-1a.75.75 0 00-.75.75zm4 0a.75.75 0 00.75.75h1a.75.75 0 000-1.5h-1a.75.75 0 00-.75.75zm4 0a.75.75 0 00.75.75h1a.75.75 0 000-1.5h-1a.75.75 0 00-.75.75zM7.47 10.03a.75.75 0 001.06 0l3.25-3.25a.75.75 0 00-1.06-1.06L8.5 7.94V1.75a.75.75 0 00-1.5 0v6.19L4.78 5.72a.75.75 0 00-1.06 1.06l3.25 3.25z" />
|
|
5
|
+
</svg>
|
|
6
|
+
);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function ArrowUpIcon() {
|
|
2
|
+
return (
|
|
3
|
+
<svg className="w-[14px] h-[14px]" viewBox="0 0 16 16" fill="currentColor">
|
|
4
|
+
<path d="M2 2.75a.75.75 0 01.75-.75h1a.75.75 0 010 1.5h-1A.75.75 0 012 2.75zm4 0a.75.75 0 01.75-.75h1a.75.75 0 010 1.5h-1A.75.75 0 016 2.75zm4 0a.75.75 0 01.75-.75h1a.75.75 0 010 1.5h-1a.75.75 0 01-.75-.75zM7.47 5.97a.75.75 0 011.06 0l3.25 3.25a.75.75 0 11-1.06 1.06L8.5 8.06V14.25a.75.75 0 01-1.5 0V8.06L4.78 10.28a.75.75 0 01-1.06-1.06l3.25-3.25z" />
|
|
5
|
+
</svg>
|
|
6
|
+
);
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function CheckCircleIcon() {
|
|
2
|
+
return (
|
|
3
|
+
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
|
|
4
|
+
<path d="M9 12l2 2 4-4" />
|
|
5
|
+
<circle cx="12" cy="12" r="10" />
|
|
6
|
+
</svg>
|
|
7
|
+
);
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function CheckIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" {...props}>
|
|
6
|
+
<polyline points="20 6 9 17 4 12" />
|
|
7
|
+
</svg>
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface ChevronDownIconProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function ChevronDownIcon(props: ChevronDownIconProps) {
|
|
6
|
+
return (
|
|
7
|
+
<svg className={props.className ?? 'w-4 h-4'} viewBox="0 0 16 16" fill="currentColor">
|
|
8
|
+
<path d="M12.78 5.47a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06 0L3.22 6.53a.75.75 0 011.06-1.06L8 9.19l3.72-3.72a.75.75 0 011.06 0z" />
|
|
9
|
+
</svg>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { cn } from '../../lib/cn';
|
|
2
|
+
|
|
3
|
+
interface ChevronIconProps {
|
|
4
|
+
expanded: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function ChevronIcon(props: ChevronIconProps) {
|
|
8
|
+
return (
|
|
9
|
+
<svg
|
|
10
|
+
className={cn(
|
|
11
|
+
'w-3 h-3 shrink-0 text-text-muted transition-transform duration-150',
|
|
12
|
+
props.expanded && 'rotate-90'
|
|
13
|
+
)}
|
|
14
|
+
viewBox="0 0 16 16"
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
>
|
|
17
|
+
<path d="M6.22 3.22a.75.75 0 011.06 0l4.25 4.25a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 010-1.06z" />
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function ChevronUpDownIcon() {
|
|
2
|
+
return (
|
|
3
|
+
<svg className="w-[14px] h-[14px]" viewBox="0 0 16 16" fill="currentColor">
|
|
4
|
+
<path d="M8.177 2.073a.25.25 0 00-.354 0L4.427 5.47a.25.25 0 00.177.427h6.792a.25.25 0 00.177-.427L8.177 2.073zM7.823 13.927a.25.25 0 00.354 0l3.396-3.397a.25.25 0 00-.177-.427H4.604a.25.25 0 00-.177.427l3.396 3.397z" />
|
|
5
|
+
</svg>
|
|
6
|
+
);
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface ChevronUpIconProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function ChevronUpIcon(props: ChevronUpIconProps) {
|
|
6
|
+
return (
|
|
7
|
+
<svg className={props.className ?? 'w-4 h-4'} viewBox="0 0 16 16" fill="currentColor">
|
|
8
|
+
<path d="M3.22 10.53a.75.75 0 010-1.06l4.25-4.25a.75.75 0 011.06 0l4.25 4.25a.75.75 0 01-1.06 1.06L8 6.81 4.28 10.53a.75.75 0 01-1.06 0z" />
|
|
9
|
+
</svg>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function CommentIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
6
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M2.5 6C2.5 4.75736 3.50736 3.75 4.75 3.75H19.25C20.4926 3.75 21.5 4.75736 21.5 6V16.5484C21.5 17.791 20.4926 18.7984 19.25 18.7984H7.635L3.75032 22.277C3.52993 22.4743 3.21411 22.5237 2.94401 22.403C2.67391 22.2823 2.5 22.0141 2.5 21.7182V6ZM4.75 5.25C4.33579 5.25 4 5.58579 4 6V20.0399L6.84795 17.4897C6.9855 17.3665 7.16364 17.2984 7.34827 17.2984H19.25C19.6642 17.2984 20 16.9626 20 16.5484V6C20 5.58579 19.6642 5.25 19.25 5.25H4.75Z" fill="currentColor" />
|
|
7
|
+
</svg>
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function CopyIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" {...props}>
|
|
6
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2" />
|
|
7
|
+
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" />
|
|
8
|
+
</svg>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function EyeIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" {...props}>
|
|
6
|
+
<path d="M1.5 8s2.5-4.5 6.5-4.5S14.5 8 14.5 8s-2.5 4.5-6.5 4.5S1.5 8 1.5 8z" />
|
|
7
|
+
<circle cx="8" cy="8" r="2" />
|
|
8
|
+
</svg>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function EyeOffIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" {...props}>
|
|
6
|
+
<path d="M2 2l12 12" />
|
|
7
|
+
<path d="M6.5 6.5a2 2 0 0 0 2.83 2.83" />
|
|
8
|
+
<path d="M4.2 4.2C2.7 5.3 1.5 8 1.5 8s2.5 4.5 6.5 4.5c1.3 0 2.5-.4 3.5-1" />
|
|
9
|
+
<path d="M12.5 10.5c1-1.1 2-2.5 2-2.5s-2.5-4.5-6.5-4.5c-.5 0-1 .05-1.5.15" />
|
|
10
|
+
</svg>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function FileIcon() {
|
|
2
|
+
return (
|
|
3
|
+
<svg className="w-4 h-4 shrink-0 text-text-muted" viewBox="0 0 16 16" fill="currentColor">
|
|
4
|
+
<path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0113.25 16h-9.5A1.75 1.75 0 012 14.25V1.75zm1.75-.25a.25.25 0 00-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 00.25-.25V6h-2.75A1.75 1.75 0 019 4.25V1.5H3.75zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011z" />
|
|
5
|
+
</svg>
|
|
6
|
+
);
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface FolderIconProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function FolderIcon(props: FolderIconProps) {
|
|
6
|
+
if (props.open) {
|
|
7
|
+
return (
|
|
8
|
+
<svg className="w-4 h-4 shrink-0 text-accent opacity-80" viewBox="0 0 16 16" fill="currentColor">
|
|
9
|
+
<path d="M.513 1.513A1.75 1.75 0 011.75 1h3.5c.55 0 1.07.26 1.4.7l.9 1.2a.25.25 0 00.2.1h6.5A1.75 1.75 0 0116 4.75v8.5A1.75 1.75 0 0114.25 15H1.75A1.75 1.75 0 010 13.25V2.75c0-.464.184-.91.513-1.237zM1.75 2.5a.25.25 0 00-.25.25v10.5c0 .138.112.25.25.25h12.5a.25.25 0 00.25-.25v-8.5a.25.25 0 00-.25-.25H7.5c-.55 0-1.07-.26-1.4-.7l-.9-1.2a.25.25 0 00-.2-.1h-3.5a.25.25 0 00-.25.25z" />
|
|
10
|
+
</svg>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<svg className="w-4 h-4 shrink-0 text-accent opacity-80" viewBox="0 0 16 16" fill="currentColor">
|
|
16
|
+
<path d="M1.75 1A1.75 1.75 0 000 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0016 13.25v-8.5A1.75 1.75 0 0014.25 3H7.5a.25.25 0 01-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75z" />
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function GitBranchIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" {...props}>
|
|
6
|
+
<line x1="5" y1="3.5" x2="5" y2="12.5" />
|
|
7
|
+
<circle cx="5" cy="3.5" r="1.5" />
|
|
8
|
+
<circle cx="5" cy="12.5" r="1.5" />
|
|
9
|
+
<circle cx="11" cy="5.5" r="1.5" />
|
|
10
|
+
<path d="M11 7c0 2-2 3.5-6 4" />
|
|
11
|
+
</svg>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function KeyboardIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" {...props}>
|
|
6
|
+
<rect x="1" y="3.5" width="14" height="9" rx="2" />
|
|
7
|
+
<line x1="4" y1="6.5" x2="5" y2="6.5" />
|
|
8
|
+
<line x1="7.5" y1="6.5" x2="8.5" y2="6.5" />
|
|
9
|
+
<line x1="11" y1="6.5" x2="12" y2="6.5" />
|
|
10
|
+
<line x1="5" y1="9.5" x2="11" y2="9.5" />
|
|
11
|
+
</svg>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function MoonIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" {...props}>
|
|
6
|
+
<path d="M13.5 8.5a5.5 5.5 0 0 1-7-7 5.5 5.5 0 1 0 7 7z" />
|
|
7
|
+
</svg>
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function PlusIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
6
|
+
<path d="M7.75 2a.75.75 0 01.75.75V7h4.25a.75.75 0 110 1.5H8.5v4.25a.75.75 0 11-1.5 0V8.5H2.75a.75.75 0 010-1.5H7V2.75A.75.75 0 017.75 2z" />
|
|
7
|
+
</svg>
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function SearchIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" {...props}>
|
|
6
|
+
<circle cx="7" cy="7" r="4.5" />
|
|
7
|
+
<line x1="10.2" y1="10.2" x2="14" y2="14" />
|
|
8
|
+
</svg>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function SidebarIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" {...props}>
|
|
6
|
+
<rect x="1.5" y="2.5" width="13" height="11" rx="2" />
|
|
7
|
+
<line x1="5.5" y1="2.5" x2="5.5" y2="13.5" />
|
|
8
|
+
</svg>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function SplitViewIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" {...props}>
|
|
6
|
+
<rect x="1.5" y="1.5" width="13" height="13" rx="2" />
|
|
7
|
+
<line x1="8" y1="1.5" x2="8" y2="14.5" />
|
|
8
|
+
</svg>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function SunIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" {...props}>
|
|
6
|
+
<circle cx="8" cy="8" r="3" />
|
|
7
|
+
<line x1="8" y1="1" x2="8" y2="2.5" />
|
|
8
|
+
<line x1="8" y1="13.5" x2="8" y2="15" />
|
|
9
|
+
<line x1="1" y1="8" x2="2.5" y2="8" />
|
|
10
|
+
<line x1="13.5" y1="8" x2="15" y2="8" />
|
|
11
|
+
<line x1="3.05" y1="3.05" x2="4.1" y2="4.1" />
|
|
12
|
+
<line x1="11.9" y1="11.9" x2="12.95" y2="12.95" />
|
|
13
|
+
<line x1="3.05" y1="12.95" x2="4.1" y2="11.9" />
|
|
14
|
+
<line x1="11.9" y1="4.1" x2="12.95" y2="3.05" />
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function TrashIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
6
|
+
<path d="M14.7223 12.7585C14.7426 12.3448 14.4237 11.9929 14.01 11.9726C13.5963 11.9522 13.2444 12.2711 13.2241 12.6848L12.9999 17.2415C12.9796 17.6552 13.2985 18.0071 13.7122 18.0274C14.1259 18.0478 14.4778 17.7289 14.4981 17.3152L14.7223 12.7585Z" fill="currentColor" />
|
|
7
|
+
<path d="M9.98802 11.9726C9.5743 11.9929 9.25542 12.3448 9.27577 12.7585L9.49993 17.3152C9.52028 17.7289 9.87216 18.0478 10.2859 18.0274C10.6996 18.0071 11.0185 17.6552 10.9981 17.2415L10.774 12.6848C10.7536 12.2711 10.4017 11.9522 9.98802 11.9726Z" fill="currentColor" />
|
|
8
|
+
<path fillRule="evenodd" clipRule="evenodd" d="M10.249 2C9.00638 2 7.99902 3.00736 7.99902 4.25V5H5.5C4.25736 5 3.25 6.00736 3.25 7.25C3.25 8.28958 3.95503 9.16449 4.91303 9.42267L5.54076 19.8848C5.61205 21.0729 6.59642 22 7.78672 22H16.2113C17.4016 22 18.386 21.0729 18.4573 19.8848L19.085 9.42267C20.043 9.16449 20.748 8.28958 20.748 7.25C20.748 6.00736 19.7407 5 18.498 5H15.999V4.25C15.999 3.00736 14.9917 2 13.749 2H10.249ZM14.499 5V4.25C14.499 3.83579 14.1632 3.5 13.749 3.5H10.249C9.83481 3.5 9.49902 3.83579 9.49902 4.25V5H14.499ZM5.5 6.5C5.08579 6.5 4.75 6.83579 4.75 7.25C4.75 7.66421 5.08579 8 5.5 8H18.498C18.9123 8 19.248 7.66421 19.248 7.25C19.248 6.83579 18.9123 6.5 18.498 6.5H5.5ZM6.42037 9.5H17.5777L16.96 19.7949C16.9362 20.191 16.6081 20.5 16.2113 20.5H7.78672C7.38995 20.5 7.06183 20.191 7.03807 19.7949L6.42037 9.5Z" fill="currentColor" />
|
|
9
|
+
</svg>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function UndoIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
6
|
+
<path fillRule="evenodd" d="M2.854 3.146a.5.5 0 0 0-.708 0l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 1 0 .708-.708L1.707 6H7.5A4.5 4.5 0 1 1 3 10.5a.5.5 0 0 0-1 0A5.5 5.5 0 1 0 7.5 5H1.707l1.147-1.146a.5.5 0 0 0 0-.708Z" />
|
|
7
|
+
</svg>
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function UnifiedViewIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" {...props}>
|
|
6
|
+
<rect x="1.5" y="1.5" width="13" height="13" rx="2" />
|
|
7
|
+
<line x1="4.5" y1="5.5" x2="11.5" y2="5.5" />
|
|
8
|
+
<line x1="4.5" y1="8" x2="11.5" y2="8" />
|
|
9
|
+
<line x1="4.5" y1="10.5" x2="11.5" y2="10.5" />
|
|
10
|
+
</svg>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
export function XIcon(props: SVGProps<SVGSVGElement>) {
|
|
4
|
+
return (
|
|
5
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" {...props}>
|
|
6
|
+
<line x1="4" y1="4" x2="12" y2="12" />
|
|
7
|
+
<line x1="12" y1="4" x2="4" y2="12" />
|
|
8
|
+
</svg>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cn } from '../lib/cn';
|
|
2
|
+
|
|
3
|
+
interface LineNumberCellProps {
|
|
4
|
+
lineNumber: number | null;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const baseClass = 'w-12.5 min-w-12.5 px-2 text-right text-text-muted select-none cursor-pointer align-top text-xs leading-6';
|
|
9
|
+
|
|
10
|
+
export function LineNumberCell(props: LineNumberCellProps) {
|
|
11
|
+
const { lineNumber, className } = props;
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<td className={cn(baseClass, className)}>
|
|
15
|
+
{lineNumber ?? ''}
|
|
16
|
+
</td>
|
|
17
|
+
);
|
|
18
|
+
}
|