@uiw/react-json-view 2.0.0-alpha.20 → 2.0.0-alpha.22

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.
@@ -47,7 +47,9 @@ var Copied = exports.Copied = function Copied(props) {
47
47
  } else if (value instanceof Date) {
48
48
  copyText = value.toLocaleString();
49
49
  } else {
50
- copyText = JSON.stringify(value, null, 2);
50
+ copyText = JSON.stringify(value, function (_, v) {
51
+ return typeof v === 'bigint' ? v + 'n' : v;
52
+ }, 2);
51
53
  }
52
54
  onCopied && onCopied(copyText, value);
53
55
  setCopied(true);
@@ -43,7 +43,7 @@ var KeyNameComp = exports.KeyNameComp = function KeyNameComp(props) {
43
43
  value: value,
44
44
  parentValue: parentValue,
45
45
  keyName: keyName,
46
- keys: keys
46
+ keys: keys || (keyName ? [keyName] : [])
47
47
  });
48
48
  if (child) return child;
49
49
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Elm, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
@@ -3,8 +3,8 @@ import { type SymbolsElement } from '../store/Symbols';
3
3
  import { type TagType } from '../store/Types';
4
4
  export declare const Quote: {
5
5
  (props: {
6
- isNumber?: boolean | undefined;
7
- } & import("react").HTMLAttributes<HTMLElement>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
6
+ isNumber?: boolean;
7
+ } & React.HTMLAttributes<HTMLElement>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
8
8
  displayName: string;
9
9
  };
10
10
  export declare const ValueQuote: {
@@ -16,18 +16,14 @@ export declare const Colon: {
16
16
  displayName: string;
17
17
  };
18
18
  export declare const Arrow: {
19
- <T extends TagType>(props: {
20
- as?: T | undefined;
21
- render?: ((props: SymbolsElement<T>) => import("react").ReactNode) | undefined;
22
- 'data-type'?: string | undefined;
23
- } & import("react").PropsWithoutRef<import("react").ComponentProps<T>> & {
19
+ <T extends TagType>(props: SymbolsElement<T> & {
24
20
  expandKey: string;
25
21
  }): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
26
22
  displayName: string;
27
23
  };
28
24
  export declare const BracketsOpen: {
29
25
  ({ isBrackets }: {
30
- isBrackets?: boolean | undefined;
26
+ isBrackets?: boolean;
31
27
  }): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
32
28
  displayName: string;
33
29
  };
package/esm/Container.js CHANGED
@@ -6,8 +6,7 @@ import { NestedClose } from './comps/NestedClose';
6
6
  import { NestedOpen } from './comps/NestedOpen';
7
7
  import { KeyValues } from './comps/KeyValues';
8
8
  import { useShowToolsDispatch } from './store/ShowTools';
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
10
  export var Container = /*#__PURE__*/forwardRef((props, ref) => {
12
11
  var {
13
12
  className = '',
@@ -39,7 +39,7 @@ export var Copied = props => {
39
39
  } else if (value instanceof Date) {
40
40
  copyText = value.toLocaleString();
41
41
  } else {
42
- copyText = JSON.stringify(value, null, 2);
42
+ copyText = JSON.stringify(value, (_, v) => typeof v === 'bigint' ? v + 'n' : v, 2);
43
43
  }
44
44
  onCopied && onCopied(copyText, value);
45
45
  setCopied(true);
@@ -10,8 +10,7 @@ import { Container } from '../Container';
10
10
  import { Quote, Colon } from '../symbol';
11
11
  import { useHighlight } from '../utils/useHighlight';
12
12
  import { Copied } from '../comps/Copied';
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import { jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
14
  export var KeyValues = props => {
16
15
  var _expands$expandKey;
17
16
  var {
@@ -8,8 +8,7 @@ import { CountInfoComp } from '../section/CountInfo';
8
8
  import { Arrow, BracketsOpen, BracketsClose } from '../symbol';
9
9
  import { EllipsisComp } from '../section/Ellipsis';
10
10
  import { SetComp, MapComp } from '../types';
11
- import { jsx as _jsx } from "react/jsx-runtime";
12
- import { jsxs as _jsxs } from "react/jsx-runtime";
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
12
  export var NestedOpen = props => {
14
13
  var _expands$expandKey;
15
14
  var {
@@ -5,8 +5,7 @@ import { forwardRef } from 'react';
5
5
  import JsonView from '../';
6
6
  import { KeyNameRender } from './KeyName';
7
7
  import { Context, Dispatch, useStoreReducer } from './store';
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
9
  var JsonViewEditor = /*#__PURE__*/forwardRef((props, ref) => {
11
10
  var {
12
11
  children,
package/esm/index.js CHANGED
@@ -31,8 +31,7 @@ import { CountInfoExtra } from './section/CountInfoExtra';
31
31
  import { Ellipsis } from './section/Ellipsis';
32
32
  import { KeyName } from './section/KeyName';
33
33
  import { Row } from './section/Row';
34
- import { jsx as _jsx } from "react/jsx-runtime";
35
- import { jsxs as _jsxs } from "react/jsx-runtime";
34
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
36
35
  export * from './store';
37
36
  export * from './store/Expands';
38
37
  export * from './store/ShowTools';
@@ -40,7 +40,7 @@ export var KeyNameComp = props => {
40
40
  value,
41
41
  parentValue,
42
42
  keyName,
43
- keys
43
+ keys: keys || (keyName ? [keyName] : [])
44
44
  });
45
45
  if (child) return child;
46
46
  return /*#__PURE__*/_jsx(Elm, _extends({}, reset, {
@@ -3,8 +3,8 @@ import { type SymbolsElement } from '../store/Symbols';
3
3
  import { type TagType } from '../store/Types';
4
4
  export declare const Quote: {
5
5
  (props: {
6
- isNumber?: boolean | undefined;
7
- } & import("react").HTMLAttributes<HTMLElement>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
6
+ isNumber?: boolean;
7
+ } & React.HTMLAttributes<HTMLElement>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
8
8
  displayName: string;
9
9
  };
10
10
  export declare const ValueQuote: {
@@ -16,18 +16,14 @@ export declare const Colon: {
16
16
  displayName: string;
17
17
  };
18
18
  export declare const Arrow: {
19
- <T extends TagType>(props: {
20
- as?: T | undefined;
21
- render?: ((props: SymbolsElement<T>) => import("react").ReactNode) | undefined;
22
- 'data-type'?: string | undefined;
23
- } & import("react").PropsWithoutRef<import("react").ComponentProps<T>> & {
19
+ <T extends TagType>(props: SymbolsElement<T> & {
24
20
  expandKey: string;
25
21
  }): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
26
22
  displayName: string;
27
23
  };
28
24
  export declare const BracketsOpen: {
29
25
  ({ isBrackets }: {
30
- isBrackets?: boolean | undefined;
26
+ isBrackets?: boolean;
31
27
  }): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
32
28
  displayName: string;
33
29
  };
@@ -17,8 +17,7 @@ import { Fragment, useEffect, useState } from 'react';
17
17
  import { useTypesStore } from '../store/Types';
18
18
  import { useStore } from '../store';
19
19
  import { ValueQuote } from '../symbol';
20
- import { jsx as _jsx } from "react/jsx-runtime";
21
- import { jsxs as _jsxs } from "react/jsx-runtime";
20
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
21
  export var SetComp = _ref => {
23
22
  var {
24
23
  value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uiw/react-json-view",
3
- "version": "2.0.0-alpha.20",
3
+ "version": "2.0.0-alpha.22",
4
4
  "description": "JSON viewer for react.",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",