Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uiw/react-json-view

Package Overview
Dependencies
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uiw/react-json-view - npm Package Compare versions

Comparing version 2.0.0-alpha.0 to 2.0.0-alpha.1

2

cjs/index.d.ts

@@ -37,2 +37,4 @@ /// <reference types="react" />

value?: T;
/** Define the root node name. @default undefined */
keyName?: string | number;
/** Whether sort keys through `String.prototype.localeCompare()` @default false */

@@ -39,0 +41,0 @@ objectSortKeys?: boolean | ((a: string, b: string) => number);

@@ -37,2 +37,4 @@ /// <reference types="react" />

value?: T;
/** Define the root node name. @default undefined */
keyName?: string | number;
/** Whether sort keys through `String.prototype.localeCompare()` @default false */

@@ -39,0 +41,0 @@ objectSortKeys?: boolean | ((a: string, b: string) => number);

2

package.json
{
"name": "@uiw/react-json-view",
"version": "2.0.0-alpha.0",
"version": "2.0.0-alpha.1",
"description": "JSON viewer for react.",

@@ -5,0 +5,0 @@ "main": "cjs/index.js",

@@ -673,3 +673,42 @@ react-json-view

Migrate from kkt v1 to v2. The new v2 version has removed the ~~`quotes`~~ and ~~`components`~~ props.
```diff
export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
- quotes?: "'" | '"' | '';
- components?: {};
}
```
```ts
export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
/** This property contains your input JSON */
value?: T;
/** Define the root node name. @default undefined */
keyName?: string | number;
/** Whether sort keys through `String.prototype.localeCompare()` @default false */
objectSortKeys?: boolean | ((a: string, b: string) => number);
/** Set the indent-width for nested objects @default 15 */
indentWidth?: number;
/** When set to `true`, `objects` and `arrays` are labeled with size @default true */
displayObjectSize?: boolean;
/** When set to `true`, data type labels prefix values @default true */
displayDataTypes?: boolean;
/** The user can copy objects and arrays to clipboard by clicking on the clipboard icon. @default true */
enableClipboard?: boolean;
/** Whether to highlight updates. @default true */
highlightUpdates?: boolean;
/** Callback function for when a treeNode is expanded or collapsed */
onExpand?: (props: {
expand: boolean;
value?: T;
keyid: string;
keyName?: string | number;
}) => void;
/** Fires event when you copy */
onCopied?: (text: string, value?: T) => void;
}
```
```ts
import { BraceLeft } from './symbol/BraceLeft';

@@ -704,32 +743,3 @@ import { BraceRight } from './symbol/BraceRight';

import { type NestedOpenProps } from "./comps/NestedOpen";
export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
/** This property contains your input JSON */
value?: T;
/** Whether sort keys through `String.prototype.localeCompare()` @default false */
objectSortKeys?: boolean | ((a: string, b: string) => number);
/** Set the indent-width for nested objects @default 15 */
indentWidth?: number;
/** When set to `true`, `objects` and `arrays` are labeled with size @default true */
displayObjectSize?: boolean;
/** When set to `true`, data type labels prefix values @default true */
displayDataTypes?: boolean;
/** The user can copy objects and arrays to clipboard by clicking on the clipboard icon. @default true */
enableClipboard?: boolean;
/** Whether to highlight updates. @default true */
highlightUpdates?: boolean;
/** Callback function for when a treeNode is expanded or collapsed */
onExpand?: (props: {
expand: boolean;
value?: T;
keyid: string;
keyName?: string | number;
}) => void;
/** Fires event when you copy */
onCopied?: (text: string, value?: T) => void;
/** Redefine interface elements to re-render. */
components?: {
copied?: (props: React.SVGProps<SVGSVGElement>, opts: CopiedOption<T>) => React.ReactNode;
countInfoExtra?: (props: NestedOpenProps<T>) => React.ReactNode;
};
}
type JsonViewComponent = React.FC<React.PropsWithRef<JsonViewProps<object>>> & {

@@ -736,0 +746,0 @@ Bigint: typeof Bigint;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc