virtual-react-json-diff 1.0.3 → 1.0.4
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/README.md +8 -7
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/DiffViewer/Diff.stories.d.ts +1 -1
- package/dist/cjs/types/src/components/DiffViewer/components/DiffMinimap.d.ts +1 -1
- package/dist/cjs/types/src/components/DiffViewer/components/VirtualizedDiffViewer.d.ts +1 -1
- package/dist/cjs/types/src/components/DiffViewer/types/index.d.ts +15 -15
- package/dist/cjs/types/src/components/DiffViewer/utils/diffSearchUtils.d.ts +3 -3
- package/dist/cjs/types/src/components/DiffViewer/utils/preprocessDiff.d.ts +2 -2
- package/dist/cjs/types/src/components/SearchIcon.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/package.json +39 -24
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { VirtualDiffViewer } from "../..";
|
|
3
2
|
import type { DifferOptions } from "json-diff-kit";
|
|
3
|
+
import { VirtualDiffViewer } from "../..";
|
|
4
4
|
type StoryProps = React.ComponentProps<typeof VirtualDiffViewer> & {
|
|
5
5
|
detectCircular?: boolean;
|
|
6
6
|
maxDepth?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { VirtualizedDiffViewerProps } from "../types";
|
|
2
|
+
import type { VirtualizedDiffViewerProps } from "../types";
|
|
3
3
|
import "../styles/JsonDiffCustomTheme.css";
|
|
4
4
|
export declare const VirtualizedDiffViewer: React.FC<VirtualizedDiffViewerProps>;
|
|
5
5
|
export default VirtualizedDiffViewer;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import type { DifferOptions, DiffResult } from "json-diff-kit";
|
|
2
|
+
export type DiffRow = {
|
|
3
3
|
originalIndex: number;
|
|
4
|
-
}
|
|
4
|
+
} & DiffResult;
|
|
5
5
|
export type DiffRowOrCollapsed = DiffRow | CollapsedLine;
|
|
6
|
-
export
|
|
6
|
+
export type SegmentItem = {
|
|
7
7
|
start: number;
|
|
8
8
|
end: number;
|
|
9
9
|
isEqual: boolean;
|
|
10
10
|
isExpanded?: boolean;
|
|
11
11
|
originalStart?: number;
|
|
12
12
|
originalEnd?: number;
|
|
13
|
-
}
|
|
14
|
-
export
|
|
13
|
+
};
|
|
14
|
+
export type HiddenUnchangedLinesInfo = {
|
|
15
15
|
hasLinesBefore: boolean;
|
|
16
16
|
hasLinesAfter: boolean;
|
|
17
|
-
}
|
|
18
|
-
export
|
|
17
|
+
} & SegmentItem;
|
|
18
|
+
export type CollapsedLine = {
|
|
19
19
|
type: "collapsed";
|
|
20
20
|
segmentIndex: number;
|
|
21
21
|
originalIndex: number;
|
|
22
22
|
level: number;
|
|
23
23
|
text: string;
|
|
24
|
-
}
|
|
25
|
-
export
|
|
24
|
+
};
|
|
25
|
+
export type SearchState = {
|
|
26
26
|
term: string;
|
|
27
27
|
results: number[];
|
|
28
28
|
currentIndex: number;
|
|
29
|
-
}
|
|
30
|
-
export
|
|
29
|
+
};
|
|
30
|
+
export type VirtualizedDiffViewerProps = {
|
|
31
31
|
oldValue: object;
|
|
32
32
|
newValue: object;
|
|
33
33
|
height: number;
|
|
@@ -39,8 +39,8 @@ export interface VirtualizedDiffViewerProps {
|
|
|
39
39
|
differOptions?: DifferOptions;
|
|
40
40
|
className?: string;
|
|
41
41
|
miniMapWidth?: number;
|
|
42
|
-
}
|
|
43
|
-
export
|
|
42
|
+
};
|
|
43
|
+
export type DiffMinimapProps = {
|
|
44
44
|
leftDiff: DiffRowOrCollapsed[];
|
|
45
45
|
rightDiff: DiffRowOrCollapsed[];
|
|
46
46
|
height: number;
|
|
@@ -49,4 +49,4 @@ export interface DiffMinimapProps {
|
|
|
49
49
|
searchResults?: number[];
|
|
50
50
|
currentMatchIndex?: number;
|
|
51
51
|
miniMapWidth?: number;
|
|
52
|
-
}
|
|
52
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DiffRowOrCollapsed } from "../types";
|
|
2
|
-
export declare
|
|
3
|
-
export declare
|
|
1
|
+
import type { DiffRowOrCollapsed } from "../types";
|
|
2
|
+
export declare function performSearch(term: string, leftView: DiffRowOrCollapsed[]): number[];
|
|
3
|
+
export declare function highlightMatches(term: string, className?: string): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DiffResult } from "json-diff-kit";
|
|
2
|
-
import {
|
|
1
|
+
import type { DiffResult } from "json-diff-kit";
|
|
2
|
+
import type { DiffRowOrCollapsed, SegmentItem } from "../types";
|
|
3
3
|
export declare function preprocessDiffs(diff: DiffResult[], contextSize?: number, collapseThreshold?: number): DiffRowOrCollapsed[];
|
|
4
4
|
export declare function generateSegments(diff: DiffResult[], contextSize?: number): SegmentItem[];
|
|
5
5
|
export declare function buildViewFromSegments(segments: SegmentItem[], diff: DiffResult[], contextSize?: number): DiffRowOrCollapsed[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare function SearchIcon(): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DifferOptions } from 'json-diff-kit';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type VirtualizedDiffViewerProps = {
|
|
5
5
|
oldValue: object;
|
|
6
6
|
newValue: object;
|
|
7
7
|
height: number;
|
|
@@ -13,7 +13,7 @@ interface VirtualizedDiffViewerProps {
|
|
|
13
13
|
differOptions?: DifferOptions;
|
|
14
14
|
className?: string;
|
|
15
15
|
miniMapWidth?: number;
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
17
|
|
|
18
18
|
declare const VirtualizedDiffViewer: React.FC<VirtualizedDiffViewerProps>;
|
|
19
19
|
|
package/package.json
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "virtual-react-json-diff",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.4",
|
|
4
5
|
"description": "Fast, virtualized React component for visually comparing large JSON objects. Includes search, theming, and minimap.",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "bun run rollup",
|
|
12
|
-
"prepublishOnly": "bun run build",
|
|
13
|
-
"rollup": "rollup -c --bundleConfigAsCjs",
|
|
14
|
-
"storybook": "storybook dev -p 6006",
|
|
15
|
-
"build-storybook": "storybook build"
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Utku Akyüz"
|
|
16
8
|
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"homepage": "https://virtual-react-json-diff.netlify.app",
|
|
17
11
|
"repository": {
|
|
18
12
|
"type": "git",
|
|
19
13
|
"url": "https://github.com/utkuakyuz/virtual-react-json-diff"
|
|
@@ -21,12 +15,6 @@
|
|
|
21
15
|
"bugs": {
|
|
22
16
|
"url": "https://github.com/utkuakyuz/virtual-react-json-diff/issues"
|
|
23
17
|
},
|
|
24
|
-
"homepage": "https://virtual-react-json-diff.netlify.app",
|
|
25
|
-
"author": {
|
|
26
|
-
"name": "Utku Akyüz"
|
|
27
|
-
},
|
|
28
|
-
"license": "MIT",
|
|
29
|
-
"type": "module",
|
|
30
18
|
"keywords": [
|
|
31
19
|
"react",
|
|
32
20
|
"json",
|
|
@@ -42,7 +30,30 @@
|
|
|
42
30
|
"compare json",
|
|
43
31
|
"react diff viewer"
|
|
44
32
|
],
|
|
33
|
+
"main": "dist/cjs/index.js",
|
|
34
|
+
"types": "dist/index.d.ts",
|
|
35
|
+
"files": [
|
|
36
|
+
"dist"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "bun run rollup",
|
|
40
|
+
"prepublishOnly": "bun run build",
|
|
41
|
+
"rollup": "rollup -c --bundleConfigAsCjs",
|
|
42
|
+
"storybook": "storybook dev -p 6006",
|
|
43
|
+
"build-storybook": "storybook build",
|
|
44
|
+
"lint": "eslint",
|
|
45
|
+
"lint:fix": "eslint --fix"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"react": "^18.0.0"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"json-diff-kit": "^1.0.32",
|
|
52
|
+
"react-window": "^1.8.11"
|
|
53
|
+
},
|
|
45
54
|
"devDependencies": {
|
|
55
|
+
"@antfu/eslint-config": "^5.2.1",
|
|
56
|
+
"@eslint-react/eslint-plugin": "^1.52.6",
|
|
46
57
|
"@fontsource/inter": "^5.1.1",
|
|
47
58
|
"@rollup/plugin-commonjs": "^25.0.3",
|
|
48
59
|
"@rollup/plugin-image": "^3.0.3",
|
|
@@ -59,22 +70,26 @@
|
|
|
59
70
|
"@types/node": "^22.14.1",
|
|
60
71
|
"@types/react": "^18.2.15",
|
|
61
72
|
"@types/react-window": "^1.8.8",
|
|
73
|
+
"eslint": "^9.33.0",
|
|
74
|
+
"eslint-plugin-format": "^1.0.1",
|
|
75
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
76
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
77
|
+
"lint-staged": "^16.1.5",
|
|
62
78
|
"postcss": "^8.5.1",
|
|
63
|
-
"prettier": "^2.5.1",
|
|
64
79
|
"react": "^18.2.0",
|
|
65
80
|
"rollup": "^3.26.3",
|
|
66
81
|
"rollup-plugin-dts": "^5.3.0",
|
|
67
82
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
68
83
|
"rollup-plugin-postcss": "^4.0.2",
|
|
84
|
+
"simple-git-hooks": "^2.13.1",
|
|
69
85
|
"storybook": "8.6.0-alpha.0",
|
|
70
86
|
"tslib": "^2.6.0",
|
|
71
87
|
"typescript": "^5.1.6"
|
|
72
88
|
},
|
|
73
|
-
"
|
|
74
|
-
"
|
|
89
|
+
"simple-git-hooks": {
|
|
90
|
+
"pre-commit": "pnpm lint-staged"
|
|
75
91
|
},
|
|
76
|
-
"
|
|
77
|
-
"json
|
|
78
|
-
"react-window": "^1.8.11"
|
|
92
|
+
"lint-staged": {
|
|
93
|
+
"*.{js,jsx,ts,tsx,vue,html,md,json,yaml,css,scss}": "eslint --fix"
|
|
79
94
|
}
|
|
80
95
|
}
|