Skip to content

Commit 4462106

Browse files
release
1 parent 9b219ed commit 4462106

File tree

8 files changed

+29
-29
lines changed

8 files changed

+29
-29
lines changed

packages/core/src/parse/diff-tool.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ export const getDiffRange = (
109109
const deletion = deletions[i];
110110
// use the original text content to computed diff range
111111
// fix: get diff with ignoreWhiteSpace config
112-
const _addition = addition.clone(getAdditionRaw(addition.newLineNumber) || addition.text || '');
113-
const _deletion = deletion.clone(getDeletionRaw(deletion.oldLineNumber) || deletion.text || '');
112+
const _addition = addition.clone(getAdditionRaw(addition.newLineNumber) || addition.text || "");
113+
const _deletion = deletion.clone(getDeletionRaw(deletion.oldLineNumber) || deletion.text || "");
114114
const { addRange, delRange } = relativeChanges(_addition, _deletion);
115115
addition.changes = addRange;
116116
deletion.changes = delRange;

packages/vue/src/hooks/useSyncHeight.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const useSyncHeight = ({
7272
onCancel(() => {
7373
clean();
7474
clearTimeout(timer);
75-
})
75+
});
7676
}
7777
};
7878

ui/react-example/index.html

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<!doctype html>
22
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>React Git Diff Component</title>
8+
<!-- <link rel="stylesheet" href="https://fonts.cdnfonts.com/css/google-sans" /> -->
9+
<script src="https://unpkg.com/@ungap/[email protected]/min.js"></script>
10+
<link rel="preconnect" href="https://fonts.googleapis.com" />
11+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="" />
12+
<link
13+
href="https://fonts.googleapis.com/css2?family=Josefin+Sans:ital,wght@0,100..700;1,100..700&display=swap"
14+
rel="stylesheet"
15+
/>
16+
<meta name="description" content="github diff, github like, react diff component, diff component, git diff" />
17+
</head>
318

4-
<head>
5-
<meta charset="UTF-8" />
6-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>React Git Diff Component</title>
9-
<!-- <link rel="stylesheet" href="https://fonts.cdnfonts.com/css/google-sans" /> -->
10-
<script src="https://unpkg.com/@ungap/[email protected]/min.js"></script>
11-
<link rel="preconnect" href="https://fonts.googleapis.com" />
12-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="" />
13-
<link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:ital,wght@0,100..700;1,100..700&display=swap"
14-
rel="stylesheet" />
15-
<meta name="description" content="github diff, github like, react diff component, diff component, git diff" />
16-
</head>
17-
18-
<body>
19-
<div id="root"></div>
20-
<script type="module" src="/src/main.tsx"></script>
21-
</body>
22-
23-
</html>
19+
<body>
20+
<div id="root"></div>
21+
<script type="module" src="/src/main.tsx"></script>
22+
</body>
23+
</html>

ui/react-example/postcss.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ export default {
22
plugins: {
33
tailwindcss: {},
44
autoprefixer: {},
5-
'postcss-preset-mantine': {},
5+
"postcss-preset-mantine": {},
66
},
77
};

ui/react-example/src/components/ExampleContent.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const ExampleContent = ({ className }: { className?: string }) => {
1818

1919
useEffect(() => {
2020
const controller = new AbortController();
21-
21+
2222
window.addEventListener(
2323
"message",
2424
(e) => {

ui/react-example/src/components/MainContentDiffExample.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { MainContentDiffExampleCode } from "./MainContentDiffExampleCode";
1010
import { temp1, temp2 } from "./MainContentDiffExampleData";
1111
import { MainContentDiffExampleView } from "./MainContentDiffExampleView";
1212

13-
const _diffFile = generateDiffFile("temp1.tsx", temp1, "temp2.tsx", temp2, 'tsx', 'tsx');
13+
const _diffFile = generateDiffFile("temp1.tsx", temp1, "temp2.tsx", temp2, "tsx", "tsx");
1414

1515
const getNewDiffFile = () => {
1616
const instance = DiffFile.createInstance({

ui/react-example/src/components/MainContentDiffExampleData.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export const createHook = <T extends Record<string, unknown>, C extends Record<s
271271
typedUseSelector.getIsActive = () => active;
272272
273273
return typedUseSelector;
274-
};`
274+
};`;
275275

276276
export const temp2 = `/* eslint-disable @typescript-eslint/ban-types */
277277
import { readonly, toRaw } from "@vue/reactivity";
@@ -543,4 +543,4 @@ export const createHook = <T extends Record<string, unknown>, C extends Record<s
543543
typedUseSelector.getIsActive = () => active;
544544
545545
return typedUseSelector;
546-
};`
546+
};`;

ui/react-example/src/hooks/useDiffHighlighter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { highlighterReady } from "@git-diff-view/shiki";
22
import { useEffect, useState } from "react";
33

44
import type { DiffHighlighter } from "@git-diff-view/react";
5-
import type { Dispatch, SetStateAction} from "react";
5+
import type { Dispatch, SetStateAction } from "react";
66

77
export const useDiffHighlighter = ({ setLoading }: { setLoading: Dispatch<SetStateAction<boolean>> }) => {
88
const [highlighter, setHighlighter] = useState<Omit<DiffHighlighter, "getHighlighterEngine">>();

0 commit comments

Comments
 (0)