virtual-react-json-diff 1.0.7 → 1.0.9

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.
@@ -0,0 +1,5 @@
1
+ import "./App.css";
2
+ import "ace-builds/src-noconflict/mode-json";
3
+ import "ace-builds/src-noconflict/theme-github_dark";
4
+ import "ace-builds/src-noconflict/ext-language_tools";
5
+ export default function App(): import("react/jsx-runtime").JSX.Element;
@@ -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
+ };
@@ -1,3 +1,4 @@
1
+ import type { InlineDiffOptions } from "json-diff-kit";
1
2
  import type { ListChildComponentProps } from "react-window";
2
3
  import type { DiffRowOrCollapsed } from "../types";
3
4
  declare function ViewerRow({ index, style, data, }: ListChildComponentProps<{
@@ -5,5 +6,6 @@ declare function ViewerRow({ index, style, data, }: ListChildComponentProps<{
5
6
  rightDiff: DiffRowOrCollapsed[];
6
7
  onExpand: (segmentIndex: number) => void;
7
8
  searchTerm?: string;
9
+ inlineDiffOptions?: InlineDiffOptions;
8
10
  }>): import("react/jsx-runtime").JSX.Element;
9
11
  export default ViewerRow;
@@ -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,6 @@
1
1
  import type { DiffRowOrCollapsed } from "../types";
2
2
  type Props = {
3
- canvasRef: React.RefObject<HTMLCanvasElement>;
3
+ canvasRef: React.RefObject<HTMLCanvasElement | null>;
4
4
  height: number;
5
5
  miniMapWidth: number;
6
6
  leftDiff: DiffRowOrCollapsed[];
@@ -1,4 +1,4 @@
1
- import type { DifferOptions, DiffResult } from "json-diff-kit";
1
+ import type { DifferOptions, DiffResult, InlineDiffOptions } from "json-diff-kit";
2
2
  export type DiffRow = {
3
3
  originalIndex: number;
4
4
  } & DiffResult;
@@ -39,6 +39,7 @@ export type VirtualizedDiffViewerProps = {
39
39
  differOptions?: DifferOptions;
40
40
  className?: string;
41
41
  miniMapWidth?: number;
42
+ inlineDiffOptions?: InlineDiffOptions;
42
43
  };
43
44
  export type DiffMinimapProps = {
44
45
  leftDiff: DiffRowOrCollapsed[];
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DifferOptions } from 'json-diff-kit';
2
+ import { DifferOptions, InlineDiffOptions } from 'json-diff-kit';
3
3
 
4
4
  type VirtualizedDiffViewerProps = {
5
5
  oldValue: object;
@@ -13,6 +13,7 @@ type VirtualizedDiffViewerProps = {
13
13
  differOptions?: DifferOptions;
14
14
  className?: string;
15
15
  miniMapWidth?: number;
16
+ inlineDiffOptions?: InlineDiffOptions;
16
17
  };
17
18
 
18
19
  declare const VirtualizedDiffViewer: React.FC<VirtualizedDiffViewerProps>;
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.7",
4
+ "version": "1.0.9",
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"
@@ -39,10 +39,10 @@
39
39
  "build": "bun run rollup",
40
40
  "prepublishOnly": "bun run build",
41
41
  "rollup": "rollup -c --bundleConfigAsCjs",
42
- "storybook": "storybook dev -p 6006",
43
- "build-storybook": "storybook build",
44
42
  "lint": "eslint",
45
- "lint:fix": "eslint --fix"
43
+ "lint:fix": "eslint --fix",
44
+ "demo:dev": "cd demo && npm run dev",
45
+ "demo:build": "cd demo && npm run build"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "react": ">=18.0.0"
@@ -60,13 +60,6 @@
60
60
  "@rollup/plugin-node-resolve": "^15.1.0",
61
61
  "@rollup/plugin-terser": "^0.4.3",
62
62
  "@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
63
  "@types/node": "^22.14.1",
71
64
  "@types/react": ">=18.0.0",
72
65
  "@types/react-window": "^1.8.8",
@@ -82,7 +75,6 @@
82
75
  "rollup-plugin-peer-deps-external": "^2.2.4",
83
76
  "rollup-plugin-postcss": "^4.0.2",
84
77
  "simple-git-hooks": "^2.13.1",
85
- "storybook": "8.6.0-alpha.0",
86
78
  "tslib": "^2.6.0",
87
79
  "typescript": "^5.1.6"
88
80
  },