Skip to content

Releases: TexteaInc/json-viewer

json-viewer: v3.1.1

20 Jun 18:45
Compare
Choose a tag to compare

3.1.1 (2023-06-20)

Bug Fixes

json-viewer: v3.1.0

20 Jun 18:01
Compare
Choose a tag to compare

3.1.0 (2023-06-20)

Features

  • support default inspect state with defaultInspectControl (7982300)

json-viewer: v3.0.0

25 Apr 16:15
624e32e
Compare
Choose a tag to compare

3.0.0 (2023-04-25)

For the detail and migration guide, check out the Migrating from v2 to v3

Main Changes

This major focus on providing the ability to customize and extend data types. We also moved MUI to peerdependency to reflect the correct dependency relationship.

Dependencies

Starting from v3, dependencies from Material-UI are no longer included in the package's dependencies.
Run this to install all the necessary dependencies.

npm install @mui/material @emotion/react @emotion/styled

Browser compatibility

This package was set to support ES5 by default, but it's no longer the case.
Since V3, as this package is using Material-UI, we have adjusted the browser compatibility to match the Material-UI's one.

Use defineDataType instead of createDataType

serialize and deserialize have been added to datatype to support editing feature on any data type.

As the result, createDataType has been renamed to defineDataType and the signature has been changed to accept an object instead of a long list of arguments. For more information, please refer to Defining data types.

- createDataType(
-   (value) => typeof value === 'string' && value.startsWith('https://i.imgur.com'),
-   (props) => <Image height={50} width={50} src={props.value} alt={props.value} />
- )
+ defineDataType({
+   is: (value) => typeof value === 'string' && value.startsWith('https://i.imgur.com'),
+   Component: (props) => <Image height={50} width={50} src={props.value} alt={props.value} />
+ })

Rename displayObjectSize to displaySize

displayObjectSize has been renamed to displaySize to describe the prop's purpose more accurately.

<JsonViewer
-  displayObjectSize={true}
+  displaySize={true}
   value={value}
/>

Now you can provide a function to customize this behavior by returning a boolean based on the value and path.

<JsonViewer
  displaySize={(path, value) => {
    if (Array.isArray(value)) return false
    if (value instanceof Map) return true
    return true
  }}
  value={value}
/>

Expose built-in type for extending

For more information, check Extend Built-in Data Types.

Features

  • dropping createDataType and change the signature of EditorComponent to only accept string
  • expose defineEasyType for easier customization (d727adb)
  • expose built-in type (ed64769)
  • rename displayObjectSize to displaySize (2e5739c)

Bug Fixes

  • fix editing on any datatype (69a359f)
  • improve deprecation message (5e73886)
  • move emotion to peer dependency (5616257)
  • move mui to peerDependencies (9c45b90)
  • remove @emotion/* from jsx importSource (658fddb)
  • type matching should not early return when value is object (0c9ef70)

json-viewer: v2.17.2

20 Apr 17:11
Compare
Choose a tag to compare

2.17.2 (2023-04-20)

Bug Fixes

  • use swc in the right way, reduce package size (4b437fb)

json-viewer: v2.17.1

20 Apr 08:47
Compare
Choose a tag to compare

2.17.1 (2023-04-20)

Bug Fixes

  • disable externalHelpers (aaa31a5)

json-viewer: v2.17.0

19 Apr 13:32
Compare
Choose a tag to compare

2.17.0 (2023-04-19)

Features

  • expose copy function to onCopy callback (5e4c7f3)

json-viewer: v2.16.2

02 Apr 18:47
Compare
Choose a tag to compare

2.16.2 (2023-04-02)

Bug Fixes

  • NaN should not trigger highlightUpdates (f09b769)

json-viewer: v2.16.1

28 Mar 15:11
Compare
Choose a tag to compare

2.16.1 (2023-03-28)

Bug Fixes

  • applyValue should shallow copy the input (5c632a4)
  • editing value not correct (8a8d1cb)

json-viewer: v2.16.0

27 Mar 13:49
Compare
Choose a tag to compare

2.16.0 (2023-03-27)

Features

Bug Fixes

  • husky hooks are not executable at unix (1e5169a)
  • use base0A for highlight color (4483e51)

json-viewer: v2.15.0

21 Mar 02:53
Compare
Choose a tag to compare

2.15.0 (2023-03-21)

Features

  • expose class json-viewer-theme-* for style customization (3ea2805)
  • support passing sx props to customize the style (e10fe1d)

Bug Fixes

  • copying on circular JSON/Array throws error (edfe2f3)
  • eliminate eslint warning (e598660)
  • improve copy on BigInt / Map / Set (7c46e07)