virtual-react-json-diff 1.0.8 → 1.0.10
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 +31 -9
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/demo/src/App.d.ts +5 -0
- package/dist/cjs/types/demo/src/components/Sidebar.d.ts +8 -0
- package/dist/cjs/types/demo/src/main.d.ts +1 -0
- package/dist/cjs/types/demo/src/types/index.d.ts +18 -0
- package/dist/cjs/types/src/components/DiffViewer/hooks/useDragScroll.d.ts +1 -1
- package/dist/cjs/types/src/components/DiffViewer/hooks/useMinimapDraw.d.ts +3 -2
- package/dist/cjs/types/src/components/DiffViewer/types/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +7 -12
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./Sidebar.css";
|
|
2
|
+
import type { Config } from "../types";
|
|
3
|
+
type Props = {
|
|
4
|
+
config: Config;
|
|
5
|
+
updateConfig: (key: keyof Config, value: Config[keyof Config]) => void;
|
|
6
|
+
};
|
|
7
|
+
declare function Sidebar(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default Sidebar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DifferOptions } from "json-diff-kit";
|
|
2
|
+
export type Config = {
|
|
3
|
+
className: string;
|
|
4
|
+
leftTitle: string;
|
|
5
|
+
rightTitle: string;
|
|
6
|
+
miniMapWidth: number;
|
|
7
|
+
hideSearch: boolean;
|
|
8
|
+
height: number;
|
|
9
|
+
detectCircular: boolean;
|
|
10
|
+
maxDepth: number;
|
|
11
|
+
showModifications: boolean;
|
|
12
|
+
arrayDiffMethod: DifferOptions["arrayDiffMethod"];
|
|
13
|
+
compareKey: string;
|
|
14
|
+
ignoreCase: boolean;
|
|
15
|
+
ignoreCaseForKey: boolean;
|
|
16
|
+
recursiveEqual: boolean;
|
|
17
|
+
preserveKeyOrder: DifferOptions["preserveKeyOrder"];
|
|
18
|
+
};
|
|
@@ -4,7 +4,7 @@ type UseDragScrollParams = {
|
|
|
4
4
|
viewportHeight: number;
|
|
5
5
|
ROW_HEIGHT: number;
|
|
6
6
|
onScroll: (scrollTop: number) => void;
|
|
7
|
-
containerRef: React.RefObject<HTMLDivElement>;
|
|
7
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
8
8
|
};
|
|
9
9
|
type UseDragScrollReturn = {
|
|
10
10
|
handleMouseDown: (e: React.MouseEvent) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DiffRowOrCollapsed } from "../types";
|
|
2
2
|
type Props = {
|
|
3
|
-
canvasRef: React.RefObject<HTMLCanvasElement>;
|
|
3
|
+
canvasRef: React.RefObject<HTMLCanvasElement | null>;
|
|
4
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
4
5
|
height: number;
|
|
5
6
|
miniMapWidth: number;
|
|
6
7
|
leftDiff: DiffRowOrCollapsed[];
|
|
@@ -13,7 +14,7 @@ type Props = {
|
|
|
13
14
|
ROW_HEIGHT: number;
|
|
14
15
|
viewportHeight: number;
|
|
15
16
|
};
|
|
16
|
-
export declare function useMinimapDraw({ canvasRef, height, miniMapWidth, leftDiff, rightDiff, currentScrollTop, searchResults, currentMatchIndex, isDragging, totalLines, ROW_HEIGHT, viewportHeight, }: Props): {
|
|
17
|
+
export declare function useMinimapDraw({ canvasRef, containerRef, height, miniMapWidth, leftDiff, rightDiff, currentScrollTop, searchResults, currentMatchIndex, isDragging, totalLines, ROW_HEIGHT, viewportHeight, }: Props): {
|
|
17
18
|
drawScrollBox: (ctx: CanvasRenderingContext2D, color: string) => void;
|
|
18
19
|
drawMinimap: () => void;
|
|
19
20
|
};
|
|
@@ -37,6 +37,7 @@ export type VirtualizedDiffViewerProps = {
|
|
|
37
37
|
rightTitle?: string;
|
|
38
38
|
onSearchMatch?: (index: number) => void;
|
|
39
39
|
differOptions?: DifferOptions;
|
|
40
|
+
showSingleMinimap?: boolean;
|
|
40
41
|
className?: string;
|
|
41
42
|
miniMapWidth?: number;
|
|
42
43
|
inlineDiffOptions?: InlineDiffOptions;
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "virtual-react-json-diff",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.10",
|
|
5
5
|
"description": "Fast, virtualized React component for visually comparing large JSON objects. Includes search, theming, and minimap.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Utku Akyüz"
|
|
@@ -37,12 +37,14 @@
|
|
|
37
37
|
],
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "bun run rollup",
|
|
40
|
+
"watch": "bun run rollup --watch",
|
|
40
41
|
"prepublishOnly": "bun run build",
|
|
41
42
|
"rollup": "rollup -c --bundleConfigAsCjs",
|
|
42
|
-
"storybook": "storybook dev -p 6006",
|
|
43
|
-
"build-storybook": "storybook build",
|
|
44
43
|
"lint": "eslint",
|
|
45
|
-
"lint:fix": "eslint --fix"
|
|
44
|
+
"lint:fix": "eslint --fix",
|
|
45
|
+
"demo:dev": "cd demo && npm run dev",
|
|
46
|
+
"demo:build": "cd demo && npm run build",
|
|
47
|
+
"dev:watch": "concurrently \"npm run watch\" \"npm run demo:dev\""
|
|
46
48
|
},
|
|
47
49
|
"peerDependencies": {
|
|
48
50
|
"react": ">=18.0.0"
|
|
@@ -60,16 +62,10 @@
|
|
|
60
62
|
"@rollup/plugin-node-resolve": "^15.1.0",
|
|
61
63
|
"@rollup/plugin-terser": "^0.4.3",
|
|
62
64
|
"@rollup/plugin-typescript": "^11.1.2",
|
|
63
|
-
"@storybook/addon-essentials": "8.6.0-alpha.0",
|
|
64
|
-
"@storybook/addon-interactions": "8.6.0-alpha.0",
|
|
65
|
-
"@storybook/addon-onboarding": "8.6.0-alpha.0",
|
|
66
|
-
"@storybook/addon-styling-webpack": "^1.0.1",
|
|
67
|
-
"@storybook/blocks": "8.6.0-alpha.0",
|
|
68
|
-
"@storybook/react": "8.6.0-alpha.0",
|
|
69
|
-
"@storybook/react-vite": "8.6.0-alpha.0",
|
|
70
65
|
"@types/node": "^22.14.1",
|
|
71
66
|
"@types/react": ">=18.0.0",
|
|
72
67
|
"@types/react-window": "^1.8.8",
|
|
68
|
+
"concurrently": "^8.2.2",
|
|
73
69
|
"eslint": "^9.33.0",
|
|
74
70
|
"eslint-plugin-format": "^1.0.1",
|
|
75
71
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
@@ -82,7 +78,6 @@
|
|
|
82
78
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
83
79
|
"rollup-plugin-postcss": "^4.0.2",
|
|
84
80
|
"simple-git-hooks": "^2.13.1",
|
|
85
|
-
"storybook": "8.6.0-alpha.0",
|
|
86
81
|
"tslib": "^2.6.0",
|
|
87
82
|
"typescript": "^5.1.6"
|
|
88
83
|
},
|