@uiw/react-json-view
Advanced tools
Comparing version 2.0.0-alpha.0 to 2.0.0-alpha.1
@@ -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); |
{ | ||
"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; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
291723
7125
827
0