@uiw/react-json-view 2.0.0-alpha.1 → 2.0.0-alpha.10

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.
Files changed (166) hide show
  1. package/README.md +83 -26
  2. package/cjs/Container.js +4 -8
  3. package/cjs/comps/Copied.js +15 -13
  4. package/cjs/comps/KeyValues.js +24 -20
  5. package/cjs/comps/NestedClose.js +3 -4
  6. package/cjs/comps/NestedOpen.js +18 -16
  7. package/cjs/comps/Value.js +14 -16
  8. package/cjs/editor/KeyName.d.ts +2 -0
  9. package/cjs/editor/KeyName.js +82 -0
  10. package/cjs/editor/index.d.ts +19 -0
  11. package/cjs/editor/index.js +44 -0
  12. package/cjs/editor/store.d.ts +28 -0
  13. package/cjs/editor/store.js +23 -0
  14. package/cjs/index.d.ts +3 -3
  15. package/cjs/index.js +7 -8
  16. package/cjs/section/Copied.d.ts +1 -1
  17. package/cjs/section/Copied.js +1 -2
  18. package/cjs/section/CountInfo.d.ts +10 -1
  19. package/cjs/section/CountInfo.js +42 -4
  20. package/cjs/section/CountInfoExtra.d.ts +10 -1
  21. package/cjs/section/CountInfoExtra.js +32 -4
  22. package/cjs/section/Ellipsis.d.ts +10 -0
  23. package/cjs/section/Ellipsis.js +30 -4
  24. package/cjs/section/KeyName.d.ts +8 -0
  25. package/cjs/section/KeyName.js +38 -4
  26. package/cjs/store/Expands.js +2 -4
  27. package/cjs/store/Section.d.ts +3 -2
  28. package/cjs/store/Section.js +2 -4
  29. package/cjs/store/ShowTools.js +2 -4
  30. package/cjs/store/Symbols.d.ts +2 -2
  31. package/cjs/store/Symbols.js +3 -4
  32. package/cjs/store/Types.d.ts +28 -24
  33. package/cjs/store/Types.js +8 -8
  34. package/cjs/store.d.ts +7 -4
  35. package/cjs/store.js +5 -10
  36. package/cjs/symbol/Arrow.d.ts +1 -1
  37. package/cjs/symbol/Arrow.js +1 -2
  38. package/cjs/symbol/BraceLeft.d.ts +1 -1
  39. package/cjs/symbol/BraceLeft.js +1 -2
  40. package/cjs/symbol/BraceRight.d.ts +1 -1
  41. package/cjs/symbol/BraceRight.js +1 -2
  42. package/cjs/symbol/BracketsLeft.d.ts +1 -1
  43. package/cjs/symbol/BracketsLeft.js +1 -2
  44. package/cjs/symbol/BracketsRight.d.ts +1 -1
  45. package/cjs/symbol/BracketsRight.js +1 -2
  46. package/cjs/symbol/Colon.d.ts +1 -1
  47. package/cjs/symbol/Colon.js +1 -2
  48. package/cjs/symbol/Quote.d.ts +1 -1
  49. package/cjs/symbol/Quote.js +1 -2
  50. package/cjs/symbol/ValueQuote.d.ts +1 -1
  51. package/cjs/symbol/ValueQuote.js +1 -2
  52. package/{esm/comps/ReRender/Symbols.d.ts → cjs/symbol/index.d.ts} +4 -6
  53. package/cjs/{comps/ReRender/Symbols.js → symbol/index.js} +32 -33
  54. package/cjs/theme/basic.js +2 -3
  55. package/cjs/theme/dark.js +2 -3
  56. package/cjs/theme/github.dark.js +2 -3
  57. package/cjs/theme/github.light.js +2 -3
  58. package/cjs/theme/gruvbox.js +2 -3
  59. package/cjs/theme/light.js +2 -3
  60. package/cjs/theme/monokai.js +2 -3
  61. package/cjs/theme/nord.js +2 -3
  62. package/cjs/theme/vscode.js +2 -3
  63. package/cjs/types/Bigint.d.ts +1 -1
  64. package/cjs/types/Bigint.js +1 -2
  65. package/cjs/types/Date.d.ts +1 -1
  66. package/cjs/types/Date.js +1 -2
  67. package/cjs/types/False.d.ts +1 -1
  68. package/cjs/types/False.js +1 -2
  69. package/cjs/types/Float.d.ts +1 -1
  70. package/cjs/types/Float.js +1 -2
  71. package/cjs/types/Int.d.ts +1 -1
  72. package/cjs/types/Int.js +1 -2
  73. package/cjs/types/Map.d.ts +1 -1
  74. package/cjs/types/Map.js +1 -2
  75. package/cjs/types/Nan.d.ts +1 -1
  76. package/cjs/types/Nan.js +1 -2
  77. package/cjs/types/Null.d.ts +1 -1
  78. package/cjs/types/Null.js +1 -2
  79. package/cjs/types/Set.d.ts +1 -1
  80. package/cjs/types/Set.js +1 -2
  81. package/cjs/types/String.d.ts +1 -1
  82. package/cjs/types/String.js +1 -2
  83. package/cjs/types/True.d.ts +1 -1
  84. package/cjs/types/True.js +1 -2
  85. package/cjs/types/Undefined.d.ts +1 -1
  86. package/cjs/types/Undefined.js +1 -2
  87. package/cjs/types/Url.d.ts +1 -1
  88. package/cjs/types/Url.js +1 -2
  89. package/{esm/comps/ReRender/Types.d.ts → cjs/types/index.d.ts} +8 -13
  90. package/cjs/{comps/ReRender/Types.js → types/index.js} +103 -121
  91. package/cjs/utils/useHighlight.js +0 -1
  92. package/cjs/utils/useRender.d.ts +1 -1
  93. package/editor.d.ts +22 -20
  94. package/esm/Container.js +4 -5
  95. package/esm/comps/Copied.js +14 -11
  96. package/esm/comps/KeyValues.js +14 -9
  97. package/esm/comps/NestedClose.js +1 -1
  98. package/esm/comps/NestedOpen.js +12 -9
  99. package/esm/comps/Value.js +1 -1
  100. package/esm/editor/KeyName.d.ts +2 -0
  101. package/esm/editor/KeyName.js +77 -0
  102. package/esm/editor/index.d.ts +19 -0
  103. package/esm/editor/index.js +34 -0
  104. package/esm/editor/store.d.ts +28 -0
  105. package/esm/editor/store.js +13 -0
  106. package/esm/index.d.ts +3 -3
  107. package/esm/index.js +3 -3
  108. package/esm/section/Copied.d.ts +1 -1
  109. package/esm/section/CountInfo.d.ts +10 -1
  110. package/esm/section/CountInfo.js +43 -1
  111. package/esm/section/CountInfoExtra.d.ts +10 -1
  112. package/esm/section/CountInfoExtra.js +32 -1
  113. package/esm/section/Ellipsis.d.ts +10 -0
  114. package/esm/section/Ellipsis.js +31 -1
  115. package/esm/section/KeyName.d.ts +8 -0
  116. package/esm/section/KeyName.js +39 -1
  117. package/esm/store/Section.d.ts +3 -2
  118. package/esm/store/Symbols.d.ts +2 -2
  119. package/esm/store/Symbols.js +1 -0
  120. package/esm/store/Types.d.ts +28 -24
  121. package/esm/store/Types.js +6 -4
  122. package/esm/store.d.ts +7 -4
  123. package/esm/symbol/Arrow.d.ts +1 -1
  124. package/esm/symbol/BraceLeft.d.ts +1 -1
  125. package/esm/symbol/BraceRight.d.ts +1 -1
  126. package/esm/symbol/BracketsLeft.d.ts +1 -1
  127. package/esm/symbol/BracketsRight.d.ts +1 -1
  128. package/esm/symbol/Colon.d.ts +1 -1
  129. package/esm/symbol/Quote.d.ts +1 -1
  130. package/esm/symbol/ValueQuote.d.ts +1 -1
  131. package/{cjs/comps/ReRender/Symbols.d.ts → esm/symbol/index.d.ts} +4 -6
  132. package/esm/{comps/ReRender/Symbols.js → symbol/index.js} +26 -24
  133. package/esm/types/Bigint.d.ts +1 -1
  134. package/esm/types/Date.d.ts +1 -1
  135. package/esm/types/False.d.ts +1 -1
  136. package/esm/types/Float.d.ts +1 -1
  137. package/esm/types/Int.d.ts +1 -1
  138. package/esm/types/Map.d.ts +1 -1
  139. package/esm/types/Nan.d.ts +1 -1
  140. package/esm/types/Null.d.ts +1 -1
  141. package/esm/types/Set.d.ts +1 -1
  142. package/esm/types/String.d.ts +1 -1
  143. package/esm/types/True.d.ts +1 -1
  144. package/esm/types/Undefined.d.ts +1 -1
  145. package/esm/types/Url.d.ts +1 -1
  146. package/{cjs/comps/ReRender/Types.d.ts → esm/types/index.d.ts} +8 -13
  147. package/esm/{comps/ReRender/Types.js → types/index.js} +84 -94
  148. package/esm/utils/useHighlight.js +0 -1
  149. package/esm/utils/useRender.d.ts +1 -1
  150. package/package.json +3 -4
  151. package/cjs/comps/CountInfo.d.ts +0 -19
  152. package/cjs/comps/CountInfo.js +0 -72
  153. package/cjs/comps/Ellipsis.d.ts +0 -10
  154. package/cjs/comps/Ellipsis.js +0 -35
  155. package/cjs/comps/Key.d.ts +0 -7
  156. package/cjs/comps/Key.js +0 -39
  157. package/cjs/type.d.ts +0 -50
  158. package/cjs/type.js +0 -57
  159. package/esm/comps/CountInfo.d.ts +0 -19
  160. package/esm/comps/CountInfo.js +0 -70
  161. package/esm/comps/Ellipsis.d.ts +0 -10
  162. package/esm/comps/Ellipsis.js +0 -31
  163. package/esm/comps/Key.d.ts +0 -7
  164. package/esm/comps/Key.js +0 -35
  165. package/esm/type.d.ts +0 -50
  166. package/esm/type.js +0 -50
package/README.md CHANGED
@@ -1,13 +1,14 @@
1
1
  react-json-view
2
2
  ===
3
3
 
4
+ [![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee)](https://jaywcjlove.github.io/#/sponsor)
4
5
  [![CI](https://github.com/uiwjs/react-json-view/actions/workflows/ci.yml/badge.svg)](https://github.com/uiwjs/react-json-view/actions/workflows/ci.yml)
5
6
  [![npm version](https://img.shields.io/npm/v/@uiw/react-json-view.svg)](https://www.npmjs.com/package/@uiw/react-json-view)
6
7
  [![NPM Downloads](https://img.shields.io/npm/dm/@uiw/react-json-view.svg?style=flat&label=)](https://www.npmjs.com/package/@uiw/react-json-view)
7
8
  [![react@^18](https://shields.io/badge/react-^18-green?style=flat&logo=react)](https://github.com/facebook/react/releases)
8
9
  [![Coverage Status](https://uiwjs.github.io/react-json-view/badges.svg)](https://uiwjs.github.io/react-json-view/lcov-report/)
9
10
 
10
- A React component for displaying and editing javascript arrays and JSON objects.
11
+ A React component for displaying and editing javascript arrays and JSON objects. Preview of [**v1 documentation**](https://raw.githack.com/uiwjs/react-json-view/v1-docs/index.html) is available [here](https://raw.githack.com/uiwjs/react-json-view/v1-docs/index.html).
11
12
 
12
13
  <!--rehype:ignore:start-->
13
14
  <a href="https://uiwjs.github.io/react-json-view/" target="_blank">
@@ -26,11 +27,12 @@ A React component for displaying and editing javascript arrays and JSON objects.
26
27
  ✏️ Support editing and adding features
27
28
  ♻️ Whether to highlight updates.
28
29
 
29
- The new version [**v2**](https://raw.githack.com/uiwjs/react-json-view/v2-docs/index.html) has redesigned the API to make the code more maintainable and introduced a simpler and more flexible component customization rendering API. Each component can now have custom rendering, and the new API resembles React more closely. Preview [v2 documentation](https://raw.githack.com/uiwjs/react-json-view/v2-docs/index.html) and [examples](https://raw.githack.com/uiwjs/react-json-view/v2-docs/index.html).
30
+ The new version [**v2**](https://uiwjs.github.io/react-json-view/) has redesigned the API to make the code more maintainable and introduced a simpler and more flexible component customization rendering API. Each component can now have custom rendering, and the new API resembles React more closely. Preview [v2 documentation](https://uiwjs.github.io/react-json-view/) and [examples](https://uiwjs.github.io/react-json-view/).
30
31
 
31
32
  - [x] Complete all features of displaying JSON in v1.
32
33
  - [ ] Add editing functionality to v2.
33
- - [ ] Add test cases to v2.
34
+ - [x] Add test cases to v2.
35
+
34
36
 
35
37
  ## Quick Start
36
38
 
@@ -323,13 +325,13 @@ export default function Demo() {
323
325
  }}
324
326
  >
325
327
  <JsonView.String
326
- render={({ children, ...reset }, { type }) => {
327
- const isImg = /^https?.*\.(jpg|png)$/i.test(children)
328
+ render={({ children, ...reset }, { type, value, keyName }) => {
329
+ const isImg = /^https?.*\.(jpg|png)$/i.test(value)
328
330
  if (type === 'type' && isImg) {
329
331
  return <span />
330
332
  }
331
333
  if (type === 'value' && isImg) {
332
- return <img {...reset} height="26" src={children} />
334
+ return <img {...reset} height="26" src={value} />
333
335
  }
334
336
  }}
335
337
  />
@@ -414,6 +416,59 @@ export default function Demo() {
414
416
  }
415
417
  ```
416
418
 
419
+ More in-depth customization ([#19](https://github.com/uiwjs/react-json-view/issues/19))
420
+
421
+ ```tsx mdx:preview
422
+ import React from 'react';
423
+ import JsonView from '@uiw/react-json-view';
424
+
425
+ const object = {
426
+ _id: "ObjectId('13212hakjdhajksd')",
427
+ uid: "test1",
428
+ attival_time: new Date('Tue Sep 13 2022 14:07:44 GMT-0500 (Central Daylight Time)'),
429
+ __v: 0
430
+ }
431
+
432
+ export default function Demo() {
433
+ return (
434
+ <JsonView
435
+ value={object}
436
+ // keyName="root"
437
+ displayObjectSize={false}
438
+ style={{
439
+ '--w-rjv-background-color': '#ffffff',
440
+ }}
441
+ >
442
+ <JsonView.Quote render={() => <span />}/>
443
+ <JsonView.String
444
+ render={({ children, ...reset }, { type, value, keyName }) => {
445
+ if (type === 'type') {
446
+ return <span />
447
+ }
448
+ if (type === 'value' && /ObjectId\(['"](.*?)['"]\)/.test(value)) {
449
+ return <span {...reset}>{children}</span>
450
+ }
451
+ }}
452
+ />
453
+ <JsonView.Date
454
+ render={({ children, ...reset }, { type, value, keyName }) => {
455
+ if (type === 'type') {
456
+ return <span />
457
+ }
458
+ }}
459
+ />
460
+ <JsonView.Int
461
+ render={({ children, ...reset }, { type, value, keyName }) => {
462
+ if (type === 'type') {
463
+ return <span />
464
+ }
465
+ }}
466
+ />
467
+ </JsonView>
468
+ )
469
+ }
470
+ ```
471
+
417
472
  Inspector
418
473
 
419
474
  ```tsx mdx:preview
@@ -670,7 +725,7 @@ export default function Demo() {
670
725
 
671
726
  ## Props
672
727
 
673
- Migrate from kkt v1 to v2. The new v2 version has removed the ~~`quotes`~~ and ~~`components`~~ props.
728
+ Migrate from JSON View v1 to v2. The new v2 version has removed the ~~`quotes`~~ and ~~`components`~~ props.
674
729
 
675
730
  ```diff
676
731
  export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
@@ -686,7 +741,7 @@ export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps
686
741
  /** Define the root node name. @default undefined */
687
742
  keyName?: string | number;
688
743
  /** Whether sort keys through `String.prototype.localeCompare()` @default false */
689
- objectSortKeys?: boolean | ((a: string, b: string) => number);
744
+ objectSortKeys?: boolean | ((keyA: string, keyB: string, valueA: T, valueB: T) => number);
690
745
  /** Set the indent-width for nested objects @default 15 */
691
746
  indentWidth?: number;
692
747
  /** When set to `true`, `objects` and `arrays` are labeled with size @default true */
@@ -695,8 +750,12 @@ export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps
695
750
  displayDataTypes?: boolean;
696
751
  /** The user can copy objects and arrays to clipboard by clicking on the clipboard icon. @default true */
697
752
  enableClipboard?: boolean;
753
+ /** When set to true, all nodes will be collapsed by default. Use an integer value to collapse at a particular depth. @default false */
754
+ collapsed?: boolean | number;
698
755
  /** Whether to highlight updates. @default true */
699
756
  highlightUpdates?: boolean;
757
+ /** Shorten long JSON strings, Set to `0` to disable this feature @default 30 */
758
+ shortenTextAfterLength?: number;
700
759
  /** Callback function for when a treeNode is expanded or collapsed */
701
760
  onExpand?: (props: {
702
761
  expand: boolean;
@@ -716,7 +775,6 @@ import { BracketsLeft } from './symbol/BracketsLeft';
716
775
  import { BracketsRight } from './symbol/BracketsRight';
717
776
  import { Arrow } from './symbol/Arrow';
718
777
  import { Colon } from './symbol/Colon';
719
- import { Ellipsis } from './symbol/Ellipsis';
720
778
  import { Quote } from './symbol/Quote';
721
779
  import { ValueQuote } from './symbol/ValueQuote';
722
780
  import { Bigint } from './types/Bigint';
@@ -735,10 +793,8 @@ import { Url } from './types/Url';
735
793
  import { Copied } from './section/Copied';
736
794
  import { CountInfo } from './section/CountInfo';
737
795
  import { CountInfoExtra } from './section/CountInfoExtra';
796
+ import { Ellipsis } from './section/Ellipsis';
738
797
  import { KeyName } from './section/KeyName';
739
- import { type CountInfoProps } from "./comps/CountInfo";
740
- import { type CopiedOption } from "./comps/Copied";
741
- import { type NestedOpenProps } from "./comps/NestedOpen";
742
798
 
743
799
  type JsonViewComponent = React.FC<React.PropsWithRef<JsonViewProps<object>>> & {
744
800
  Bigint: typeof Bigint;
@@ -776,19 +832,20 @@ export default JsonView;
776
832
 
777
833
  Here is the size benchmark (using [bundlephobia.com](https://bundlephobia.com)) against similar React libraries (found by [`npmjs.com/search`](https://www.npmjs.com/search?q=react%20json&ranking=popularity)):
778
834
 
779
- | Library | Bundle size (gzip) | Deps | Last commit | Download | Editable |
780
- | ------- | ------- | ------- | ------- | ------- | ------- |
781
- | **@uiw/react-json-view** | [![](https://img.shields.io/bundlephobia/min/@uiw/react-json-view?color=6ead0a&label=)](https://bundlephobia.com/result?p=@uiw/react-json-view) [![](https://img.shields.io/bundlephobia/minzip/@uiw/react-json-view?color=6ead0a&label=gzip)](https://bundlephobia.com/result?p=@uiw/react-json-view) | [![](https://badgen.net/bundlephobia/dependency-count/%40uiw%2Freact-json-view?color=6ead0a&label=)](https://bundlephobia.com/result?p=@uiw/react-json-view) | [![GitHub last commit](https://img.shields.io/github/last-commit/uiwjs/react-json-view?style=flat&label=)](https://github.com/uiwjs/react-json-view/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/@uiw/react-json-view.svg?style=flat&label=)](https://www.npmjs.com/package/@uiw/react-json-view) | ✅ |
782
- | react-json-view-lite | [![](https://img.shields.io/bundlephobia/min/react-json-view-lite?color=red&label=)](https://bundlephobia.com/result?p=react-json-view-lite) [![](https://img.shields.io/bundlephobia/minzip/react-json-view-lite?color=red&label=gzip)](https://bundlephobia.com/result?p=react-json-view-lite) | [![](https://badgen.net/bundlephobia/dependency-count/react-json-view-lite?color=red&label=)](https://bundlephobia.com/result?p=react-json-view-lite) | [![GitHub last commit](https://img.shields.io/github/last-commit/AnyRoad/react-json-view-lite?style=flat&label=)](https://github.com/AnyRoad/react-json-view-lite/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-json-view-lite.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-json-view-lite) | ❌ |
783
- | react-json-pretty | [![](https://img.shields.io/bundlephobia/min/react-json-pretty?color=red&label=)](https://bundlephobia.com/result?p=react-json-pretty) [![](https://img.shields.io/bundlephobia/minzip/react-json-pretty?color=red&label=gzip)](https://bundlephobia.com/result?p=react-json-pretty) | [![](https://badgen.net/bundlephobia/dependency-count/react-json-pretty?color=red&label=)](https://bundlephobia.com/result?p=react-json-pretty) | [![GitHub last commit](https://img.shields.io/github/last-commit/chenckang/react-json-pretty?style=flat&label=)](https://github.com/chenckang/react-json-pretty/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-json-pretty.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-json-pretty) | ❌ |
784
- | react-json-inspector | [![](https://img.shields.io/bundlephobia/min/react-json-inspector?color=red&label=)](https://bundlephobia.com/result?p=react-json-inspector) [![](https://img.shields.io/bundlephobia/minzip/react-json-inspector?color=red&label=gzip)](https://bundlephobia.com/result?p=react-json-inspector) | [![](https://badgen.net/bundlephobia/dependency-count/react-json-inspector?color=red&label=)](https://bundlephobia.com/result?p=react-json-inspector) | [![GitHub last commit](https://img.shields.io/github/last-commit/Lapple/react-json-inspector?style=flat&label=)](https://github.com/Lapple/react-json-inspector/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-json-inspector.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-json-inspector) | ❌ |
785
- | react-json-tree | [![](https://img.shields.io/bundlephobia/min/react-json-tree?color=red&label=)](https://bundlephobia.com/result?p=react-json-tree) [![](https://img.shields.io/bundlephobia/minzip/react-json-tree?color=red&label=gzip)](https://bundlephobia.com/result?p=react-json-tree) | [![](https://badgen.net/bundlephobia/dependency-count/react-json-tree?color=red&label=)](https://bundlephobia.com/result?p=react-json-tree) | [![GitHub last commit](https://img.shields.io/github/last-commit/reduxjs/redux-devtools?style=flat&label=)](https://github.com/reduxjs/redux-devtools/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-json-tree.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-json-tree) | ❌ |
786
- | ~~react-json-view~~ | [![](https://img.shields.io/bundlephobia/min/react-json-view?color=red&label=)](https://bundlephobia.com/result?p=react-json-view) [![](https://img.shields.io/bundlephobia/minzip/react-json-view?color=red&label=gzip)](https://bundlephobia.com/result?p=react-json-view) | [![](https://badgen.net/bundlephobia/dependency-count/react-json-view?color=red&label=&t=123)](https://bundlephobia.com/result?p=react-json-view) | [![GitHub last commit](https://img.shields.io/github/last-commit/mac-s-g/react-json-view?style=flat&label=)](https://github.com/mac-s-g/react-json-view/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-json-view.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-json-view) | ✅ |
787
- | ~~react-json-tree-viewer~~ | [![](https://img.shields.io/bundlephobia/min/react-json-tree-viewer?color=red&label=)](https://bundlephobia.com/result?p=react-json-tree-viewer) [![](https://img.shields.io/bundlephobia/minzip/react-json-tree-viewer?color=red&label=gzip)](https://bundlephobia.com/result?p=react-json-tree-viewer) | [![](https://badgen.net/bundlephobia/dependency-count/react-json-tree-viewer?color=red&label=&t=123)](https://bundlephobia.com/result?p=react-json-tree-viewer) | [![GitHub last commit](https://img.shields.io/github/last-commit/nsisodiya/react-json-viewer?style=flat&label=)](https://github.com/nsisodiya/react-json-viewer/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-json-tree-viewer.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-json-tree-viewer) | ❌ |
788
- | react-inspector | [![](https://img.shields.io/bundlephobia/min/react-inspector?color=red&label=)](https://bundlephobia.com/result?p=react-inspector) [![](https://img.shields.io/bundlephobia/minzip/react-inspector?color=red&label=gzip)](https://bundlephobia.com/result?p=react-inspector) | [![](https://badgen.net/bundlephobia/dependency-count/react-inspector?color=red&label=)](https://bundlephobia.com/result?p=react-inspector) | [![GitHub last commit](https://img.shields.io/github/last-commit/storybookjs/react-inspector?style=flat&label=)](https://github.com/storybookjs/react-inspector/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-inspector.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-inspector) | ❌ |
789
- | react-domify | [![](https://img.shields.io/bundlephobia/min/react-domify?color=red&label=)](https://bundlephobia.com/result?p=react-domify) [![](https://img.shields.io/bundlephobia/minzip/react-domify?color=red&label=gzip)](https://bundlephobia.com/result?p=react-domify) | [![](https://badgen.net/bundlephobia/dependency-count/react-domify?color=red&label=)](https://bundlephobia.com/result?p=react-domify) | [![GitHub last commit](https://img.shields.io/github/last-commit/JedWatson/react-domify?style=flat&label=)](https://github.com/JedWatson/react-domify/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-domify.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-domify) | ❌ |
790
- | react18-json-view | [![](https://img.shields.io/bundlephobia/min/react18-json-view?color=red&label=)](https://bundlephobia.com/result?p=react18-json-view) [![](https://img.shields.io/bundlephobia/minzip/react18-json-view?color=red&label=gzip)](https://bundlephobia.com/result?p=react18-json-view) | [![](https://badgen.net/bundlephobia/dependency-count/react18-json-view?color=red&label=)](https://bundlephobia.com/result?p=react18-json-view) | [![GitHub last commit](https://img.shields.io/github/last-commit/YYsuni/react18-json-view?style=flat&label=)](https://github.com/YYsuni/react18-json-view/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react18-json-view.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react18-json-view) | ❌ |
791
- | @textea/json-viewer | [![](https://img.shields.io/bundlephobia/min/@textea/json-viewer?color=red&label=)](https://bundlephobia.com/result?p=@textea/json-viewer) [![](https://img.shields.io/bundlephobia/minzip/@textea/json-viewer?color=red&label=gzip)](https://bundlephobia.com/result?p=@textea/json-viewer) | [![](https://badgen.net/bundlephobia/dependency-count/%40textea%2Fjson-viewer?color=red&label=&t=vvv12213)](https://bundlephobia.com/result?p=@textea/json-viewer) | [![GitHub last commit](https://img.shields.io/github/last-commit/TexteaInc/json-viewer?style=flat&label=)](https://github.com/TexteaInc/json-viewer/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/@textea/json-viewer.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/@textea/json-viewer) | ✅ |
835
+ | Library | Bundle size (gzip) | Deps | Last commit | Download | Editable | Demo |
836
+ | ------- | ------- | ------- | ------- | ------- | ------- | ------- |
837
+ | **[@uiw/react-json-view](https://github.com/uiwjs/react-json-view)** | [![](https://img.shields.io/bundlephobia/min/@uiw/react-json-view?color=6ead0a&label=)](https://bundlephobia.com/result?p=@uiw/react-json-view) [![](https://img.shields.io/bundlephobia/minzip/@uiw/react-json-view?color=6ead0a&label=gzip)](https://bundlephobia.com/result?p=@uiw/react-json-view) | [![](https://badgen.net/bundlephobia/dependency-count/%40uiw%2Freact-json-view?color=6ead0a&label=)](https://bundlephobia.com/result?p=@uiw/react-json-view) | [![GitHub last commit](https://img.shields.io/github/last-commit/uiwjs/react-json-view?style=flat&label=)](https://github.com/uiwjs/react-json-view/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/@uiw/react-json-view.svg?style=flat&label=)](https://www.npmjs.com/package/@uiw/react-json-view) | ✅ | [demo](https://uiwjs.github.io/react-json-view/) |
838
+ | [react-json-view-lite](https://github.com/anyroad/react-json-view-lite) | [![](https://img.shields.io/bundlephobia/min/react-json-view-lite?color=red&label=)](https://bundlephobia.com/result?p=react-json-view-lite) [![](https://img.shields.io/bundlephobia/minzip/react-json-view-lite?color=red&label=gzip)](https://bundlephobia.com/result?p=react-json-view-lite) | [![](https://badgen.net/bundlephobia/dependency-count/react-json-view-lite?color=red&label=)](https://bundlephobia.com/result?p=react-json-view-lite) | [![GitHub last commit](https://img.shields.io/github/last-commit/AnyRoad/react-json-view-lite?style=flat&label=)](https://github.com/AnyRoad/react-json-view-lite/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-json-view-lite.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-json-view-lite) | ❌ | [demo](https://anyroad.github.io/react-json-view-lite/) |
839
+ | [react-json-pretty](https://github.com/chenckang/react-json-pretty) | [![](https://img.shields.io/bundlephobia/min/react-json-pretty?color=red&label=)](https://bundlephobia.com/result?p=react-json-pretty) [![](https://img.shields.io/bundlephobia/minzip/react-json-pretty?color=red&label=gzip)](https://bundlephobia.com/result?p=react-json-pretty) | [![](https://badgen.net/bundlephobia/dependency-count/react-json-pretty?color=red&label=)](https://bundlephobia.com/result?p=react-json-pretty) | [![GitHub last commit](https://img.shields.io/github/last-commit/chenckang/react-json-pretty?style=flat&label=)](https://github.com/chenckang/react-json-pretty/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-json-pretty.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-json-pretty) | ❌ | - |
840
+ | [~~react-json-inspector~~](https://github.com/Lapple/react-json-inspector) | [![](https://img.shields.io/bundlephobia/min/react-json-inspector?color=red&label=)](https://bundlephobia.com/result?p=react-json-inspector) [![](https://img.shields.io/bundlephobia/minzip/react-json-inspector?color=red&label=gzip)](https://bundlephobia.com/result?p=react-json-inspector) | [![](https://badgen.net/bundlephobia/dependency-count/react-json-inspector?color=red&label=)](https://bundlephobia.com/result?p=react-json-inspector) | [![GitHub last commit](https://img.shields.io/github/last-commit/Lapple/react-json-inspector?style=flat&label=)](https://github.com/Lapple/react-json-inspector/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-json-inspector.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-json-inspector) | ❌ | [demo](https://lapple.github.io/react-json-inspector/)
841
+ | [react-json-tree](https://github.com/reduxjs/redux-devtools/tree/main/packages/react-json-tree) | [![](https://img.shields.io/bundlephobia/min/react-json-tree?color=red&label=)](https://bundlephobia.com/result?p=react-json-tree) [![](https://img.shields.io/bundlephobia/minzip/react-json-tree?color=red&label=gzip)](https://bundlephobia.com/result?p=react-json-tree) | [![](https://badgen.net/bundlephobia/dependency-count/react-json-tree?color=red&label=)](https://bundlephobia.com/result?p=react-json-tree) | [![GitHub last commit](https://img.shields.io/github/last-commit/reduxjs/redux-devtools?style=flat&label=)](https://github.com/reduxjs/redux-devtools/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-json-tree.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-json-tree) | ❌ |
842
+ | ~~[react-json-view](https://github.com/mac-s-g/react-json-view)~~ | [![](https://img.shields.io/bundlephobia/min/react-json-view?color=red&label=)](https://bundlephobia.com/result?p=react-json-view) [![](https://img.shields.io/bundlephobia/minzip/react-json-view?color=red&label=gzip)](https://bundlephobia.com/result?p=react-json-view) | [![](https://badgen.net/bundlephobia/dependency-count/react-json-view?color=red&label=&t=123)](https://bundlephobia.com/result?p=react-json-view) | [![GitHub last commit](https://img.shields.io/github/last-commit/mac-s-g/react-json-view?style=flat&label=)](https://github.com/mac-s-g/react-json-view/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-json-view.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-json-view) | ✅ | [demo](https://mac-s-g.github.io/react-json-view/demo/dist/) |
843
+ | [react-inspector](https://github.com/storybookjs/react-inspector) | [![](https://img.shields.io/bundlephobia/min/react-inspector?color=red&label=)](https://bundlephobia.com/result?p=react-inspector) [![](https://img.shields.io/bundlephobia/minzip/react-inspector?color=red&label=gzip)](https://bundlephobia.com/result?p=react-inspector) | [![](https://badgen.net/bundlephobia/dependency-count/react-inspector?color=red&label=)](https://bundlephobia.com/result?p=react-inspector) | [![GitHub last commit](https://img.shields.io/github/last-commit/storybookjs/react-inspector?style=flat&label=)](https://github.com/storybookjs/react-inspector/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-inspector.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-inspector) | ❌ | [demo](https://react-inspector.netlify.app/) |
844
+ | [react-domify](https://github.com/JedWatson/react-domify) | [![](https://img.shields.io/bundlephobia/min/react-domify?color=red&label=)](https://bundlephobia.com/result?p=react-domify) [![](https://img.shields.io/bundlephobia/minzip/react-domify?color=red&label=gzip)](https://bundlephobia.com/result?p=react-domify) | [![](https://badgen.net/bundlephobia/dependency-count/react-domify?color=red&label=)](https://bundlephobia.com/result?p=react-domify) | [![GitHub last commit](https://img.shields.io/github/last-commit/JedWatson/react-domify?style=flat&label=)](https://github.com/JedWatson/react-domify/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-domify.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-domify) | ❌ | [demo](https://jedwatson.github.io/react-domify/) |
845
+ | [react18-json-view](https://github.com/YYsuni/react18-json-view) | [![](https://img.shields.io/bundlephobia/min/react18-json-view?color=red&label=)](https://bundlephobia.com/result?p=react18-json-view) [![](https://img.shields.io/bundlephobia/minzip/react18-json-view?color=red&label=gzip)](https://bundlephobia.com/result?p=react18-json-view) | [![](https://badgen.net/bundlephobia/dependency-count/react18-json-view?color=red&label=)](https://bundlephobia.com/result?p=react18-json-view) | [![GitHub last commit](https://img.shields.io/github/last-commit/YYsuni/react18-json-view?style=flat&label=)](https://github.com/YYsuni/react18-json-view/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react18-json-view.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react18-json-view) | ❌ | [demo](https://jv.yysuni.com/) |
846
+ | [@textea/json-viewer](https://github.com/TexteaInc/json-viewer) | [![](https://img.shields.io/bundlephobia/min/@textea/json-viewer?color=red&label=)](https://bundlephobia.com/result?p=@textea/json-viewer) [![](https://img.shields.io/bundlephobia/minzip/@textea/json-viewer?color=red&label=gzip)](https://bundlephobia.com/result?p=@textea/json-viewer) | [![](https://badgen.net/bundlephobia/dependency-count/%40textea%2Fjson-viewer?color=red&label=&t=vvv12213)](https://bundlephobia.com/result?p=@textea/json-viewer) | [![GitHub last commit](https://img.shields.io/github/last-commit/TexteaInc/json-viewer?style=flat&label=)](https://github.com/TexteaInc/json-viewer/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/@textea/json-viewer.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/@textea/json-viewer) | ✅ | [demo](https://stackblitz.com/edit/textea-json-viewer-v3-b4wgxq) |
847
+ | [react-editable-json-tree](https://github.com/oxyno-zeta/react-editable-json-tree) | [![](https://img.shields.io/bundlephobia/min/react-editable-json-tree?color=red&label=)](https://bundlephobia.com/result?p=react-editable-json-tree) [![](https://img.shields.io/bundlephobia/minzip/react-editable-json-tree?color=red&label=gzip)](https://bundlephobia.com/result?p=react-editable-json-tree) | [![](https://badgen.net/bundlephobia/dependency-count/%40textea%2Fjson-viewer?color=red&label=&t=vvv12213)](https://bundlephobia.com/result?p=react-editable-json-tree) | [![GitHub last commit](https://img.shields.io/github/last-commit/TexteaInc/json-viewer?style=flat&label=)](https://github.com/TexteaInc/json-viewer/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/react-editable-json-tree.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/react-editable-json-tree) | ✅ | [demo](https://oxyno-zeta.github.io/react-editable-json-tree/) |
848
+ | [react-json-view](https://github.com/HuolalaTech/react-json-view) | [![](https://img.shields.io/bundlephobia/min/@huolala-tech/react-json-view?color=red&label=)](https://bundlephobia.com/result?p=@huolala-tech/react-json-view) [![](https://img.shields.io/bundlephobia/minzip/@huolala-tech/react-json-view?color=red&label=gzip)](https://bundlephobia.com/result?p=@huolala-tech/react-json-view) | [![](https://badgen.net/bundlephobia/dependency-count/%40textea%2Fjson-viewer?color=red&label=&t=vvv12213)](https://bundlephobia.com/result?p=@huolala-tech/react-json-view) | [![GitHub last commit](https://img.shields.io/github/last-commit/TexteaInc/json-viewer?style=flat&label=)](https://github.com/HuolalaTech/react-json-view/commits) | [![NPM Downloads](https://img.shields.io/npm/dm/@huolala-tech/react-json-view.svg?style=flat&color=747474&label=)](https://www.npmjs.com/package/@huolala-tech/react-json-view) | ❌ | [demo](https://huolalatech.github.io/react-json-view/) |
792
849
 
793
850
  ## Development
794
851
 
@@ -819,7 +876,7 @@ As always, thanks to our amazing contributors!
819
876
  <img src="https://uiwjs.github.io/react-json-view/CONTRIBUTORS.svg" />
820
877
  </a>
821
878
 
822
- Made with [action-contributors](https://github.com/jaywcjlove/github-action-contributors).
879
+ Made with [contributors](https://github.com/jaywcjlove/github-action-contributors).
823
880
 
824
881
  ## License
825
882
 
package/cjs/Container.js CHANGED
@@ -16,7 +16,7 @@ var _KeyValues = require("./comps/KeyValues");
16
16
  var _ShowTools = require("./store/ShowTools");
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
18
  var _excluded = ["className", "children", "parentValue", "keyid", "level", "value", "initialValue", "keyName"];
19
- var Container = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
19
+ var Container = exports.Container = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
20
20
  var _props$className = props.className,
21
21
  className = _props$className === void 0 ? '' : _props$className,
22
22
  children = props.children,
@@ -28,13 +28,9 @@ var Container = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
28
28
  initialValue = props.initialValue,
29
29
  keyName = props.keyName,
30
30
  elmProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
31
- var $ref = (0, _react.useRef)(null);
32
31
  var dispatch = (0, _ShowTools.useShowToolsDispatch)();
33
- (0, _react.useImperativeHandle)(ref, function () {
34
- return $ref.current;
35
- }, [$ref]);
36
32
  var subkeyid = (0, _react.useId)();
37
- var defaultClassNames = "w-rjv-inner ".concat(className);
33
+ var defaultClassNames = [className, 'w-rjv-inner'].filter(Boolean).join(' ');
38
34
  var reset = {
39
35
  onMouseEnter: function onMouseEnter() {
40
36
  return dispatch((0, _defineProperty2["default"])({}, subkeyid, true));
@@ -44,7 +40,8 @@ var Container = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
44
40
  }
45
41
  };
46
42
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({
47
- className: defaultClassNames
43
+ className: defaultClassNames,
44
+ ref: ref
48
45
  }, elmProps), reset), {}, {
49
46
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_NestedOpen.NestedOpen, {
50
47
  expandKey: subkeyid,
@@ -63,5 +60,4 @@ var Container = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
63
60
  })]
64
61
  }));
65
62
  });
66
- exports.Container = Container;
67
63
  Container.displayName = 'JVR.Container';
@@ -15,7 +15,7 @@ var _Section = require("../store/Section");
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
16
  var _excluded = ["keyName", "value", "expandKey"],
17
17
  _excluded2 = ["as", "render"];
18
- var Copied = function Copied(props) {
18
+ var Copied = exports.Copied = function Copied(props) {
19
19
  var keyName = props.keyName,
20
20
  value = props.value,
21
21
  expandKey = props.expandKey,
@@ -35,18 +35,21 @@ var Copied = function Copied(props) {
35
35
  if (enableClipboard === false || !isShowTools) return null;
36
36
  var click = function click(event) {
37
37
  event.stopPropagation();
38
- var copyText = JSON.stringify(value, function (key, value) {
39
- if (typeof value === 'bigint') {
40
- return value.toString();
41
- }
42
- return value;
43
- }, 2);
44
- if (typeof value === 'number' && value === Infinity) copyText = 'Infinity';
45
- if (typeof value === 'number' && isNaN(value)) copyText = 'NaN';
46
- if (typeof value === 'bigint') copyText = value + 'n';
38
+ var copyText = '';
39
+ if (typeof value === 'number' && value === Infinity) {
40
+ copyText = 'Infinity';
41
+ } else if (typeof value === 'number' && isNaN(value)) {
42
+ copyText = 'NaN';
43
+ } else if (typeof value === 'bigint') {
44
+ copyText = value + 'n';
45
+ } else if (value instanceof Date) {
46
+ copyText = value.toLocaleString();
47
+ } else {
48
+ copyText = JSON.stringify(value, null, 2);
49
+ }
50
+ onCopied && onCopied(copyText, value);
51
+ setCopied(true);
47
52
  navigator.clipboard.writeText(copyText).then(function () {
48
- onCopied && onCopied(copyText, value);
49
- setCopied(true);
50
53
  var timer = setTimeout(function () {
51
54
  setCopied(false);
52
55
  clearTimeout(timer);
@@ -86,5 +89,4 @@ var Copied = function Copied(props) {
86
89
  })
87
90
  }));
88
91
  };
89
- exports.Copied = Copied;
90
92
  Copied.displayName = 'JVR.Copied';
@@ -14,12 +14,12 @@ var _store = require("../store");
14
14
  var _Expands = require("../store/Expands");
15
15
  var _ShowTools = require("../store/ShowTools");
16
16
  var _Value = require("./Value");
17
- var _Key = require("./Key");
17
+ var _KeyName = require("../section/KeyName");
18
18
  var _Container = require("../Container");
19
- var _Symbols = require("./ReRender/Symbols");
19
+ var _symbol = require("../symbol");
20
20
  var _useHighlight = require("../utils/useHighlight");
21
21
  var _jsxRuntime = require("react/jsx-runtime");
22
- var KeyValues = function KeyValues(props) {
22
+ var KeyValues = exports.KeyValues = function KeyValues(props) {
23
23
  var _expands$expandKey;
24
24
  var value = props.value,
25
25
  _props$expandKey = props.expandKey,
@@ -47,11 +47,13 @@ var KeyValues = function KeyValues(props) {
47
47
  b = _ref4[0];
48
48
  return typeof a === 'string' && typeof b === 'string' ? a.localeCompare(b) : 0;
49
49
  }) : entries.sort(function (_ref5, _ref6) {
50
- var _ref7 = (0, _slicedToArray2["default"])(_ref5, 1),
51
- a = _ref7[0];
52
- var _ref8 = (0, _slicedToArray2["default"])(_ref6, 1),
53
- b = _ref8[0];
54
- return typeof a === 'string' && typeof b === 'string' ? objectSortKeys(a, b) : 0;
50
+ var _ref7 = (0, _slicedToArray2["default"])(_ref5, 2),
51
+ a = _ref7[0],
52
+ valA = _ref7[1];
53
+ var _ref8 = (0, _slicedToArray2["default"])(_ref6, 2),
54
+ b = _ref8[0],
55
+ valB = _ref8[1];
56
+ return typeof a === 'string' && typeof b === 'string' ? objectSortKeys(a, b, valA, valB) : 0;
55
57
  });
56
58
  }
57
59
  var style = {
@@ -75,10 +77,10 @@ var KeyValues = function KeyValues(props) {
75
77
  })
76
78
  });
77
79
  };
78
- exports.KeyValues = KeyValues;
79
80
  KeyValues.displayName = 'JVR.KeyValues';
80
- var KayName = function KayName(props) {
81
+ var KayName = exports.KayName = function KayName(props) {
81
82
  var keyName = props.keyName,
83
+ parentValue = props.parentValue,
82
84
  value = props.value;
83
85
  var _useStore2 = (0, _store.useStore)(),
84
86
  highlightUpdates = _useStore2.highlightUpdates;
@@ -92,21 +94,23 @@ var KayName = function KayName(props) {
92
94
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
93
95
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
94
96
  ref: highlightContainer,
95
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Symbols.Quote, {
96
- isNumber: isNumber
97
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Key.Key, {
97
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_symbol.Quote, {
98
+ isNumber: isNumber,
99
+ "data-placement": "left"
100
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_KeyName.KeyNameComp, {
98
101
  keyName: keyName,
99
102
  value: value,
103
+ parentValue: parentValue,
100
104
  children: keyName
101
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Symbols.Quote, {
102
- isNumber: isNumber
105
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_symbol.Quote, {
106
+ isNumber: isNumber,
107
+ "data-placement": "right"
103
108
  })]
104
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Symbols.Colon, {})]
109
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_symbol.Colon, {})]
105
110
  });
106
111
  };
107
- exports.KayName = KayName;
108
112
  KayName.displayName = 'JVR.KayName';
109
- var KeyValuesItem = function KeyValuesItem(props) {
113
+ var KeyValuesItem = exports.KeyValuesItem = function KeyValuesItem(props) {
110
114
  var keyName = props.keyName,
111
115
  value = props.value,
112
116
  parentValue = props.parentValue,
@@ -144,7 +148,8 @@ var KeyValuesItem = function KeyValuesItem(props) {
144
148
  }, reset), {}, {
145
149
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(KayName, {
146
150
  keyName: keyName,
147
- value: value
151
+ value: value,
152
+ parentValue: parentValue
148
153
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Value.Value, {
149
154
  keyName: keyName,
150
155
  value: value,
@@ -152,5 +157,4 @@ var KeyValuesItem = function KeyValuesItem(props) {
152
157
  })]
153
158
  }));
154
159
  };
155
- exports.KeyValuesItem = KeyValuesItem;
156
160
  KeyValuesItem.displayName = 'JVR.KeyValuesItem';
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.NestedClose = void 0;
7
7
  var _store = require("../store");
8
8
  var _Expands = require("../store/Expands");
9
- var _Symbols = require("./ReRender/Symbols");
9
+ var _symbol = require("../symbol");
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
- var NestedClose = function NestedClose(props) {
11
+ var NestedClose = exports.NestedClose = function NestedClose(props) {
12
12
  var _expands$expandKey;
13
13
  var value = props.value,
14
14
  expandKey = props.expandKey,
@@ -28,11 +28,10 @@ var NestedClose = function NestedClose(props) {
28
28
  };
29
29
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
30
30
  style: style,
31
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Symbols.BracketsClose, {
31
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_symbol.BracketsClose, {
32
32
  isBrackets: isArray || isMySet,
33
33
  isVisiable: true
34
34
  })
35
35
  });
36
36
  };
37
- exports.NestedClose = NestedClose;
38
37
  NestedClose.displayName = 'JVR.NestedClose';
@@ -12,12 +12,13 @@ var _KeyValues = require("./KeyValues");
12
12
  var _Expands = require("../store/Expands");
13
13
  var _store = require("../store");
14
14
  var _Copied = require("./Copied");
15
- var _CountInfo = require("./CountInfo");
16
- var _Symbols = require("./ReRender/Symbols");
17
- var _Ellipsis = require("./Ellipsis");
18
- var _Types = require("./ReRender/Types");
15
+ var _CountInfoExtra = require("../section/CountInfoExtra");
16
+ var _CountInfo = require("../section/CountInfo");
17
+ var _symbol = require("../symbol");
18
+ var _Ellipsis = require("../section/Ellipsis");
19
+ var _types = require("../types");
19
20
  var _jsxRuntime = require("react/jsx-runtime");
20
- var NestedOpen = function NestedOpen(props) {
21
+ var NestedOpen = exports.NestedOpen = function NestedOpen(props) {
21
22
  var _expands$expandKey;
22
23
  var keyName = props.keyName,
23
24
  expandKey = props.expandKey,
@@ -60,28 +61,30 @@ var NestedOpen = function NestedOpen(props) {
60
61
  reset.onClick = click;
61
62
  }
62
63
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
63
- children: [showArrow && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Symbols.Arrow, {
64
+ children: [showArrow && /*#__PURE__*/(0, _jsxRuntime.jsx)(_symbol.Arrow, {
64
65
  style: arrowStyle,
65
66
  expandKey: expandKey
66
67
  }), (keyName || typeof keyName === 'number') && /*#__PURE__*/(0, _jsxRuntime.jsx)(_KeyValues.KayName, {
67
68
  keyName: keyName
68
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Types.SetComp, {
69
- isSet: initialValue instanceof Set
70
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Types.MapComp, {
71
- isMap: initialValue instanceof Map
72
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Symbols.BracketsOpen, {
69
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_types.SetComp, {
70
+ value: initialValue,
71
+ keyName: keyName
72
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_types.MapComp, {
73
+ value: initialValue,
74
+ keyName: keyName
75
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_symbol.BracketsOpen, {
73
76
  isBrackets: isArray || isMySet
74
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Ellipsis.Ellipsis, {
77
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Ellipsis.EllipsisComp, {
75
78
  keyName: keyName,
76
79
  value: value,
77
80
  isExpanded: isExpanded
78
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Symbols.BracketsClose, {
81
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_symbol.BracketsClose, {
79
82
  isVisiable: isExpanded || !showArrow,
80
83
  isBrackets: isArray || isMySet
81
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CountInfo.CountInfo, {
84
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CountInfo.CountInfoComp, {
82
85
  value: value,
83
86
  keyName: keyName
84
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CountInfo.CountInfoExtra, {
87
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CountInfoExtra.CountInfoExtraComps, {
85
88
  value: value,
86
89
  keyName: keyName
87
90
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Copied.Copied, {
@@ -91,5 +94,4 @@ var NestedOpen = function NestedOpen(props) {
91
94
  })]
92
95
  }));
93
96
  };
94
- exports.NestedOpen = NestedOpen;
95
97
  NestedOpen.displayName = 'JVR.NestedOpen';
@@ -6,13 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.isFloat = exports.Value = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _Types = require("./ReRender/Types");
9
+ var _types = require("../types");
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
- var isFloat = function isFloat(n) {
11
+ var isFloat = exports.isFloat = function isFloat(n) {
12
12
  return Number(n) === n && n % 1 !== 0 || isNaN(n);
13
13
  };
14
- exports.isFloat = isFloat;
15
- var Value = function Value(props) {
14
+ var Value = exports.Value = function Value(props) {
16
15
  var value = props.value,
17
16
  keyName = props.keyName,
18
17
  expandKey = props.expandKey;
@@ -21,58 +20,57 @@ var Value = function Value(props) {
21
20
  expandKey: expandKey
22
21
  };
23
22
  if (value instanceof URL) {
24
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Types.TypeUrl, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
23
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_types.TypeUrl, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
25
24
  children: value
26
25
  }));
27
26
  }
28
27
  if (typeof value === 'string') {
29
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Types.TypeString, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
28
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_types.TypeString, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
30
29
  children: value
31
30
  }));
32
31
  }
33
32
  if (value === true) {
34
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Types.TypeTrue, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
33
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_types.TypeTrue, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
35
34
  children: value
36
35
  }));
37
36
  }
38
37
  if (value === false) {
39
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Types.TypeFalse, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
38
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_types.TypeFalse, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
40
39
  children: value
41
40
  }));
42
41
  }
43
42
  if (value === null) {
44
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Types.TypeNull, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
43
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_types.TypeNull, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
45
44
  children: value
46
45
  }));
47
46
  }
48
47
  if (value === undefined) {
49
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Types.TypeUndefined, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
48
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_types.TypeUndefined, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
50
49
  children: value
51
50
  }));
52
51
  }
53
52
  if (value instanceof Date) {
54
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Types.TypeDate, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
53
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_types.TypeDate, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
55
54
  children: value
56
55
  }));
57
56
  }
58
57
  if (typeof value === 'number' && isNaN(value)) {
59
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Types.TypeNan, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
58
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_types.TypeNan, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
60
59
  children: value
61
60
  }));
62
61
  } else if (typeof value === 'number' && isFloat(value)) {
63
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Types.TypeFloat, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
62
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_types.TypeFloat, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
64
63
  children: value
65
64
  }));
66
65
  } else if (typeof value === 'bigint') {
67
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Types.TypeBigint, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
66
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_types.TypeBigint, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
68
67
  children: value
69
68
  }));
70
69
  } else if (typeof value === 'number') {
71
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Types.TypeInt, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
70
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_types.TypeInt, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
72
71
  children: value
73
72
  }));
74
73
  }
75
74
  return null;
76
75
  };
77
- exports.Value = Value;
78
76
  Value.displayName = 'JVR.Value';
@@ -0,0 +1,2 @@
1
+ import { SectionElementProps } from '../store/Section';
2
+ export declare const KeyNameRender: SectionElementProps['render'];