Skip to content

Commit 027bd6d

Browse files
update
1 parent 1b6bfd0 commit 027bd6d

File tree

22 files changed

+57
-37
lines changed

22 files changed

+57
-37
lines changed

packages/cli/src/components/tools.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ export const createDiffConfigStore = <T = any>(
2222

2323
const setTabSpace = (_tabSpace: boolean) => (tabSpace.value = _tabSpace);
2424

25-
const tabWidth = ref(props.diffViewTabWidth || 'medium');
25+
const tabWidth = ref(props.diffViewTabWidth || "medium");
2626

27-
const setTabWidth = (_tabWidth: 'small' | 'medium' | 'large') => (tabWidth.value = _tabWidth);
27+
const setTabWidth = (_tabWidth: "small" | "medium" | "large") => (tabWidth.value = _tabWidth);
2828

2929
const wrapper = ref<{ current: DOMElement }>(markRaw({ current: null }));
3030

@@ -103,8 +103,8 @@ export const createDiffConfigStore = <T = any>(
103103
setMounted: (mounted: boolean) => void;
104104
tabSpace: Ref<boolean>;
105105
setTabSpace: (tabSpace: boolean) => void;
106-
tabWidth: Ref<'small' | 'medium' | 'large'>;
107-
setTabWidth: (tabWidth: 'small' | 'medium' | 'large') => void;
106+
tabWidth: Ref<"small" | "medium" | "large">;
107+
setTabWidth: (tabWidth: "small" | "medium" | "large") => void;
108108
enableHighlight: Ref<boolean>;
109109
setEnableHighlight: (enableHighlight: boolean) => void;
110110
extendData: Ref<{

packages/cli/test/index.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ getDiffViewHighlighter().then((highlighter) => {
9090
newFile: { 107: { data: "test extend data" } },
9191
},
9292
renderExtendLine: ({ data }) => {
93-
return createElement(Box, { backgroundColor: "red", width: '100%', padding: '1' }, createElement(Text, null, data));
93+
return createElement(
94+
Box,
95+
{ backgroundColor: "red", width: "100%", padding: "1" },
96+
createElement(Text, null, data)
97+
);
9498
},
9599
diffViewHighlight: true,
96100
registerHighlighter: highlighter,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class DiffLine {
2424
public plainTemplate?: string,
2525
public plainTemplateMode?: "fast-diff" | "relative",
2626
public syntaxTemplate?: string,
27-
public syntaxTemplateMode?: "fast-diff" | "relative",
27+
public syntaxTemplateMode?: "fast-diff" | "relative"
2828
) {}
2929

3030
public withNoTrailingNewLine(noTrailingNewLine: boolean): DiffLine {

packages/file/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Generated by dts-bundle-generator v9.5.1
22

3-
import { PatchOptions } from 'diff';
3+
import { CreatePatchOptionsNonabortable } from 'diff';
44
import { Root } from 'hast';
55

66
declare class Cache$1<K, V> extends Map<K, V> {
@@ -810,8 +810,8 @@ export type SyntaxNode = {
810810
};
811811
children?: SyntaxNode[];
812812
};
813-
export declare function generateDiffFile(oldFileName: string, oldFileContent: string, newFileName: string, newFileContent: string, oldFileLang: DiffHighlighterLang, newFileLang: DiffHighlighterLang, option?: PatchOptions, uuid?: string): DiffFile;
814-
export declare function generateDiffFile(oldFileName: string, oldFileContent: string, newFileName: string, newFileContent: string, oldFileLang: string, newFileLang: string, option?: PatchOptions, uuid?: string): DiffFile;
813+
export declare function generateDiffFile(oldFileName: string, oldFileContent: string, newFileName: string, newFileContent: string, oldFileLang: DiffHighlighterLang, newFileLang: DiffHighlighterLang, option?: CreatePatchOptionsNonabortable, uuid?: string): DiffFile;
814+
export declare function generateDiffFile(oldFileName: string, oldFileContent: string, newFileName: string, newFileContent: string, oldFileLang: string, newFileLang: string, option?: CreatePatchOptionsNonabortable, uuid?: string): DiffFile;
815815

816816
export {
817817
File$1 as File,

packages/file/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { DiffFile, _cacheMap } from "@git-diff-view/core";
2-
import { createTwoFilesPatch, type PatchOptions } from "diff";
2+
import { createTwoFilesPatch, type CreatePatchOptionsNonabortable } from "diff";
33

44
import type { DiffHighlighterLang } from "@git-diff-view/core";
55

@@ -12,7 +12,7 @@ export function generateDiffFile(
1212
newFileContent: string,
1313
oldFileLang: DiffHighlighterLang,
1414
newFileLang: DiffHighlighterLang,
15-
option?: PatchOptions,
15+
option?: CreatePatchOptionsNonabortable,
1616
uuid?: string
1717
): DiffFile;
1818
export function generateDiffFile(
@@ -22,7 +22,7 @@ export function generateDiffFile(
2222
newFileContent: string,
2323
oldFileLang: string,
2424
newFileLang: string,
25-
option?: PatchOptions,
25+
option?: CreatePatchOptionsNonabortable,
2626
uuid?: string
2727
): DiffFile;
2828
export function generateDiffFile(
@@ -32,7 +32,7 @@ export function generateDiffFile(
3232
newFileContent: string,
3333
oldFileLang: DiffHighlighterLang | string,
3434
newFileLang: DiffHighlighterLang | string,
35-
option?: PatchOptions,
35+
option?: CreatePatchOptionsNonabortable,
3636
uuid?: string
3737
) {
3838
const diffString = createTwoFilesPatch(oldFileName, newFileName, oldFileContent, newFileContent, "", "", option);

packages/react/src/components/DiffAddWidget.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const DiffSplitAddWidget = ({
2828
style={{
2929
width: `calc(var(${diffFontSizeName}) * 1.4)`,
3030
height: `calc(var(${diffFontSizeName}) * 1.4)`,
31-
top: `calc(var(${diffFontSizeName}) * 0.1)`
31+
top: `calc(var(${diffFontSizeName}) * 0.1)`,
3232
}}
3333
>
3434
<button
@@ -67,7 +67,7 @@ export const DiffUnifiedAddWidget = ({
6767
style={{
6868
width: `calc(var(${diffFontSizeName}) * 1.4)`,
6969
height: `calc(var(${diffFontSizeName}) * 1.4)`,
70-
top: `calc(var(${diffFontSizeName}) * 0.1)`
70+
top: `calc(var(${diffFontSizeName}) * 0.1)`,
7171
}}
7272
>
7373
<button

packages/react/src/hooks/useDomWidth.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ export const useDomWidth = ({ selector, enable }: { selector: string; enable: bo
1313

1414
const { useDiffContext } = useDiffViewContext();
1515

16-
const { id, mounted, dom } = useDiffContext.useShallowStableSelector((s) => ({ id: s.id, mounted: s.mounted, dom: s.dom }));
16+
const { id, mounted, dom } = useDiffContext.useShallowStableSelector((s) => ({
17+
id: s.id,
18+
mounted: s.mounted,
19+
dom: s.dom,
20+
}));
1721

1822
useEffect(() => {
1923
if (enable) {

packages/react/src/hooks/useSyncHeight.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ export const useSyncHeight = ({
1818
}) => {
1919
const { useDiffContext } = useDiffViewContext();
2020

21-
const { id, mounted, dom } = useDiffContext.useShallowStableSelector((s) => ({ id: s.id, mounted: s.mounted, dom: s.dom }));
21+
const { id, mounted, dom } = useDiffContext.useShallowStableSelector((s) => ({
22+
id: s.id,
23+
mounted: s.mounted,
24+
dom: s.dom,
25+
}));
2226

2327
useEffect(() => {
2428
if (enable) {

packages/solid/src/components/DiffAddWidget.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const DiffSplitAddWidget = (props: {
2121
style={{
2222
width: `calc(var(${diffFontSizeName}) * 1.4)`,
2323
height: `calc(var(${diffFontSizeName}) * 1.4)`,
24-
top: `calc(var(${diffFontSizeName}) * 0.1)`
24+
top: `calc(var(${diffFontSizeName}) * 0.1)`,
2525
}}
2626
>
2727
<button
@@ -55,7 +55,7 @@ export const DiffUnifiedAddWidget = (props: {
5555
style={{
5656
width: `calc(var(${diffFontSizeName}) * 1.4)`,
5757
height: `calc(var(${diffFontSizeName}) * 1.4)`,
58-
top: `calc(var(${diffFontSizeName}) * 0.1)`
58+
top: `calc(var(${diffFontSizeName}) * 0.1)`,
5959
}}
6060
>
6161
<button

packages/solid/src/hooks/useDom.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ import { generateHook } from "./generate";
22

33
import type { Accessor } from "solid-js";
44

5-
65
export const useDom = generateHook("dom") as () => Accessor<HTMLElement | undefined>;

0 commit comments

Comments
 (0)