@uiw/react-json-view 1.12.0 → 2.0.0-alpha.1
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.
- package/README.md +256 -262
- package/cjs/Container.d.ts +10 -0
- package/cjs/Container.js +67 -0
- package/cjs/arrow/TriangleArrow.js +3 -1
- package/cjs/arrow/TriangleSolidArrow.js +7 -3
- package/cjs/comps/Copied.d.ts +16 -0
- package/cjs/{copied.js → comps/Copied.js} +44 -32
- package/cjs/comps/CountInfo.d.ts +19 -0
- package/cjs/comps/CountInfo.js +72 -0
- package/cjs/comps/Ellipsis.d.ts +10 -0
- package/cjs/comps/Ellipsis.js +35 -0
- package/cjs/comps/Key.d.ts +7 -0
- package/cjs/comps/Key.js +39 -0
- package/cjs/comps/KeyValues.d.ts +22 -0
- package/cjs/comps/KeyValues.js +156 -0
- package/cjs/comps/NestedClose.d.ts +10 -0
- package/cjs/comps/NestedClose.js +38 -0
- package/cjs/comps/NestedOpen.d.ts +11 -0
- package/cjs/comps/NestedOpen.js +95 -0
- package/cjs/comps/ReRender/Symbols.d.ts +44 -0
- package/cjs/comps/ReRender/Symbols.js +144 -0
- package/cjs/comps/ReRender/Types.d.ts +36 -0
- package/cjs/comps/ReRender/Types.js +590 -0
- package/cjs/comps/Value.d.ts +11 -0
- package/cjs/comps/Value.js +78 -0
- package/cjs/index.d.ts +74 -52
- package/cjs/index.js +147 -27
- package/cjs/section/Copied.d.ts +6 -0
- package/cjs/section/Copied.js +17 -0
- package/cjs/section/CountInfo.d.ts +6 -0
- package/cjs/section/CountInfo.js +17 -0
- package/cjs/section/CountInfoExtra.d.ts +6 -0
- package/cjs/section/CountInfoExtra.js +17 -0
- package/cjs/section/Ellipsis.d.ts +6 -0
- package/cjs/section/Ellipsis.js +17 -0
- package/cjs/section/KeyName.d.ts +6 -0
- package/cjs/section/KeyName.js +17 -0
- package/cjs/store/Expands.d.ts +16 -0
- package/cjs/store/Expands.js +44 -0
- package/cjs/store/Section.d.ts +33 -0
- package/cjs/store/Section.js +86 -0
- package/cjs/store/ShowTools.d.ts +14 -0
- package/cjs/store/ShowTools.js +44 -0
- package/cjs/store/Symbols.d.ts +37 -0
- package/cjs/store/Symbols.js +112 -0
- package/cjs/store/Types.d.ts +52 -0
- package/cjs/store/Types.js +162 -0
- package/cjs/store.d.ts +29 -5
- package/cjs/store.js +96 -46
- package/cjs/symbol/Arrow.d.ts +6 -0
- package/cjs/symbol/Arrow.js +17 -0
- package/cjs/symbol/BraceLeft.d.ts +6 -0
- package/cjs/symbol/BraceLeft.js +17 -0
- package/cjs/symbol/BraceRight.d.ts +6 -0
- package/cjs/symbol/BraceRight.js +17 -0
- package/cjs/symbol/BracketsLeft.d.ts +6 -0
- package/cjs/symbol/BracketsLeft.js +17 -0
- package/cjs/symbol/BracketsRight.d.ts +6 -0
- package/cjs/symbol/BracketsRight.js +17 -0
- package/cjs/symbol/Colon.d.ts +6 -0
- package/cjs/symbol/Colon.js +17 -0
- package/cjs/symbol/Quote.d.ts +6 -0
- package/cjs/symbol/Quote.js +17 -0
- package/cjs/symbol/ValueQuote.d.ts +6 -0
- package/cjs/symbol/ValueQuote.js +17 -0
- package/cjs/theme/basic.js +3 -0
- package/cjs/theme/dark.js +3 -0
- package/cjs/theme/github.dark.js +3 -0
- package/cjs/theme/github.light.js +3 -0
- package/cjs/theme/gruvbox.js +3 -0
- package/cjs/theme/light.js +3 -0
- package/cjs/theme/monokai.js +3 -0
- package/cjs/theme/nord.js +3 -0
- package/cjs/theme/vscode.js +3 -0
- package/cjs/type.d.ts +50 -0
- package/cjs/type.js +57 -0
- package/cjs/types/Bigint.d.ts +5 -0
- package/cjs/types/Bigint.js +17 -0
- package/cjs/types/Date.d.ts +5 -0
- package/cjs/types/Date.js +17 -0
- package/cjs/types/False.d.ts +5 -0
- package/cjs/types/False.js +17 -0
- package/cjs/types/Float.d.ts +5 -0
- package/cjs/types/Float.js +17 -0
- package/cjs/types/Int.d.ts +5 -0
- package/cjs/types/Int.js +17 -0
- package/cjs/types/Map.d.ts +5 -0
- package/cjs/types/Map.js +17 -0
- package/cjs/types/Nan.d.ts +5 -0
- package/cjs/types/Nan.js +17 -0
- package/cjs/types/Null.d.ts +5 -0
- package/cjs/types/Null.js +17 -0
- package/cjs/types/Set.d.ts +5 -0
- package/cjs/types/Set.js +17 -0
- package/cjs/types/String.d.ts +5 -0
- package/cjs/types/String.js +17 -0
- package/cjs/types/True.d.ts +5 -0
- package/cjs/types/True.js +17 -0
- package/cjs/types/Undefined.d.ts +5 -0
- package/cjs/types/Undefined.js +17 -0
- package/cjs/types/Url.d.ts +5 -0
- package/cjs/types/Url.js +17 -0
- package/cjs/utils/useHighlight.d.ts +9 -0
- package/cjs/utils/useHighlight.js +62 -0
- package/cjs/utils/useRender.d.ts +6 -0
- package/cjs/utils/useRender.js +51 -0
- package/esm/Container.d.ts +10 -0
- package/esm/Container.js +53 -0
- package/esm/arrow/TriangleArrow.js +3 -1
- package/esm/arrow/TriangleSolidArrow.js +7 -3
- package/esm/comps/Copied.d.ts +16 -0
- package/esm/{copied.js → comps/Copied.js} +44 -29
- package/esm/comps/CountInfo.d.ts +19 -0
- package/esm/comps/CountInfo.js +70 -0
- package/esm/comps/Ellipsis.d.ts +10 -0
- package/esm/comps/Ellipsis.js +31 -0
- package/esm/comps/Key.d.ts +7 -0
- package/esm/comps/Key.js +35 -0
- package/esm/comps/KeyValues.d.ts +22 -0
- package/esm/comps/KeyValues.js +142 -0
- package/esm/comps/NestedClose.d.ts +10 -0
- package/esm/comps/NestedClose.js +34 -0
- package/esm/comps/NestedOpen.d.ts +11 -0
- package/esm/comps/NestedOpen.js +91 -0
- package/esm/comps/ReRender/Symbols.d.ts +44 -0
- package/esm/comps/ReRender/Symbols.js +155 -0
- package/esm/comps/ReRender/Types.d.ts +36 -0
- package/esm/comps/ReRender/Types.js +621 -0
- package/esm/comps/Value.d.ts +11 -0
- package/esm/comps/Value.js +69 -0
- package/esm/index.d.ts +74 -52
- package/esm/index.js +98 -18
- package/esm/section/Copied.d.ts +6 -0
- package/esm/section/Copied.js +10 -0
- package/esm/section/CountInfo.d.ts +6 -0
- package/esm/section/CountInfo.js +10 -0
- package/esm/section/CountInfoExtra.d.ts +6 -0
- package/esm/section/CountInfoExtra.js +10 -0
- package/esm/section/Ellipsis.d.ts +6 -0
- package/esm/section/Ellipsis.js +10 -0
- package/esm/section/KeyName.d.ts +6 -0
- package/esm/section/KeyName.js +10 -0
- package/esm/store/Expands.d.ts +16 -0
- package/esm/store/Expands.js +32 -0
- package/esm/store/Section.d.ts +33 -0
- package/esm/store/Section.js +73 -0
- package/esm/store/ShowTools.d.ts +14 -0
- package/esm/store/ShowTools.js +32 -0
- package/esm/store/Symbols.d.ts +37 -0
- package/esm/store/Symbols.js +100 -0
- package/esm/store/Types.d.ts +52 -0
- package/esm/store/Types.js +150 -0
- package/esm/store.d.ts +29 -5
- package/esm/store.js +66 -32
- package/esm/symbol/Arrow.d.ts +6 -0
- package/esm/symbol/Arrow.js +10 -0
- package/esm/symbol/BraceLeft.d.ts +6 -0
- package/esm/symbol/BraceLeft.js +10 -0
- package/esm/symbol/BraceRight.d.ts +6 -0
- package/esm/symbol/BraceRight.js +10 -0
- package/esm/symbol/BracketsLeft.d.ts +6 -0
- package/esm/symbol/BracketsLeft.js +10 -0
- package/esm/symbol/BracketsRight.d.ts +6 -0
- package/esm/symbol/BracketsRight.js +10 -0
- package/esm/symbol/Colon.d.ts +6 -0
- package/esm/symbol/Colon.js +10 -0
- package/esm/symbol/Quote.d.ts +6 -0
- package/esm/symbol/Quote.js +10 -0
- package/esm/symbol/ValueQuote.d.ts +6 -0
- package/esm/symbol/ValueQuote.js +10 -0
- package/esm/theme/basic.js +3 -0
- package/esm/theme/dark.js +3 -0
- package/esm/theme/github.dark.js +3 -0
- package/esm/theme/github.light.js +3 -0
- package/esm/theme/gruvbox.js +3 -0
- package/esm/theme/light.js +3 -0
- package/esm/theme/monokai.js +3 -0
- package/esm/theme/nord.js +3 -0
- package/esm/theme/vscode.js +3 -0
- package/esm/type.d.ts +50 -0
- package/esm/type.js +50 -0
- package/esm/types/Bigint.d.ts +5 -0
- package/esm/types/Bigint.js +10 -0
- package/esm/types/Date.d.ts +5 -0
- package/esm/types/Date.js +10 -0
- package/esm/types/False.d.ts +5 -0
- package/esm/types/False.js +10 -0
- package/esm/types/Float.d.ts +5 -0
- package/esm/types/Float.js +10 -0
- package/esm/types/Int.d.ts +5 -0
- package/esm/types/Int.js +10 -0
- package/esm/types/Map.d.ts +5 -0
- package/esm/types/Map.js +10 -0
- package/esm/types/Nan.d.ts +5 -0
- package/esm/types/Nan.js +10 -0
- package/esm/types/Null.d.ts +5 -0
- package/esm/types/Null.js +10 -0
- package/esm/types/Set.d.ts +5 -0
- package/esm/types/Set.js +10 -0
- package/esm/types/String.d.ts +5 -0
- package/esm/types/String.js +10 -0
- package/esm/types/True.d.ts +5 -0
- package/esm/types/True.js +10 -0
- package/esm/types/Undefined.d.ts +5 -0
- package/esm/types/Undefined.js +10 -0
- package/esm/types/Url.d.ts +5 -0
- package/esm/types/Url.js +10 -0
- package/esm/utils/useHighlight.d.ts +9 -0
- package/esm/{semicolon.js → utils/useHighlight.js} +1 -52
- package/esm/utils/useRender.d.ts +6 -0
- package/esm/utils/useRender.js +41 -0
- package/package.json +1 -1
- package/cjs/comps/ellipsis.d.ts +0 -7
- package/cjs/comps/ellipsis.js +0 -37
- package/cjs/comps/meta.d.ts +0 -12
- package/cjs/comps/meta.js +0 -46
- package/cjs/copied.d.ts +0 -11
- package/cjs/editor/countInfoExtra.d.ts +0 -28
- package/cjs/editor/countInfoExtra.js +0 -101
- package/cjs/editor/icon/add.d.ts +0 -4
- package/cjs/editor/icon/add.js +0 -30
- package/cjs/editor/icon/delete.d.ts +0 -4
- package/cjs/editor/icon/delete.js +0 -30
- package/cjs/editor/icon/edit.d.ts +0 -4
- package/cjs/editor/icon/edit.js +0 -30
- package/cjs/editor/index.d.ts +0 -31
- package/cjs/editor/index.js +0 -60
- package/cjs/editor/objectKey.d.ts +0 -11
- package/cjs/editor/objectKey.js +0 -169
- package/cjs/editor/value.d.ts +0 -22
- package/cjs/editor/value.js +0 -240
- package/cjs/node.d.ts +0 -15
- package/cjs/node.js +0 -343
- package/cjs/semicolon.d.ts +0 -22
- package/cjs/semicolon.js +0 -115
- package/cjs/value.d.ts +0 -93
- package/cjs/value.js +0 -356
- package/esm/comps/ellipsis.d.ts +0 -7
- package/esm/comps/ellipsis.js +0 -31
- package/esm/comps/meta.d.ts +0 -12
- package/esm/comps/meta.js +0 -39
- package/esm/copied.d.ts +0 -11
- package/esm/editor/countInfoExtra.d.ts +0 -28
- package/esm/editor/countInfoExtra.js +0 -68
- package/esm/editor/icon/add.d.ts +0 -4
- package/esm/editor/icon/add.js +0 -24
- package/esm/editor/icon/delete.d.ts +0 -4
- package/esm/editor/icon/delete.js +0 -24
- package/esm/editor/icon/edit.d.ts +0 -4
- package/esm/editor/icon/edit.js +0 -24
- package/esm/editor/index.d.ts +0 -31
- package/esm/editor/index.js +0 -47
- package/esm/editor/objectKey.d.ts +0 -11
- package/esm/editor/objectKey.js +0 -135
- package/esm/editor/value.d.ts +0 -22
- package/esm/editor/value.js +0 -192
- package/esm/node.d.ts +0 -15
- package/esm/node.js +0 -299
- package/esm/semicolon.d.ts +0 -22
- package/esm/value.d.ts +0 -93
- package/esm/value.js +0 -331
package/README.md
CHANGED
|
@@ -26,6 +26,12 @@ A React component for displaying and editing javascript arrays and JSON objects.
|
|
|
26
26
|
✏️ Support editing and adding features
|
|
27
27
|
♻️ Whether to highlight updates.
|
|
28
28
|
|
|
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
|
+
|
|
31
|
+
- [x] Complete all features of displaying JSON in v1.
|
|
32
|
+
- [ ] Add editing functionality to v2.
|
|
33
|
+
- [ ] Add test cases to v2.
|
|
34
|
+
|
|
29
35
|
## Quick Start
|
|
30
36
|
|
|
31
37
|
```bash
|
|
@@ -119,6 +125,7 @@ export default function Demo() {
|
|
|
119
125
|
}
|
|
120
126
|
```
|
|
121
127
|
|
|
128
|
+
|
|
122
129
|
Example of custom `vscode` theme styles:
|
|
123
130
|
|
|
124
131
|
```tsx mdx:preview
|
|
@@ -138,31 +145,32 @@ const object = {
|
|
|
138
145
|
const customTheme = {
|
|
139
146
|
'--w-rjv-font-family': 'monospace',
|
|
140
147
|
'--w-rjv-color': '#9cdcfe',
|
|
148
|
+
'--w-rjv-key-string': '#9cdcfe',
|
|
141
149
|
'--w-rjv-background-color': '#1e1e1e',
|
|
142
|
-
'--w-rjv-line-color': '#
|
|
143
|
-
'--w-rjv-arrow-color': '
|
|
150
|
+
'--w-rjv-line-color': '#36334280',
|
|
151
|
+
'--w-rjv-arrow-color': '#838383',
|
|
144
152
|
'--w-rjv-edit-color': 'var(--w-rjv-color)',
|
|
145
|
-
'--w-rjv-
|
|
146
|
-
'--w-rjv-
|
|
147
|
-
'--w-rjv-info-color': '#656565',
|
|
148
|
-
'--w-rjv-update-color': '#ebcb8b',
|
|
153
|
+
'--w-rjv-info-color': '#9c9c9c7a',
|
|
154
|
+
'--w-rjv-update-color': '#9cdcfe',
|
|
149
155
|
'--w-rjv-copied-color': '#9cdcfe',
|
|
150
156
|
'--w-rjv-copied-success-color': '#28a745',
|
|
151
157
|
|
|
152
158
|
'--w-rjv-curlybraces-color': '#d4d4d4',
|
|
153
159
|
'--w-rjv-colon-color': '#d4d4d4',
|
|
154
160
|
'--w-rjv-brackets-color': '#d4d4d4',
|
|
161
|
+
'--w-rjv-quotes-color': 'var(--w-rjv-key-string)',
|
|
162
|
+
'--w-rjv-quotes-string-color': 'var(--w-rjv-type-string-color)',
|
|
155
163
|
|
|
156
164
|
'--w-rjv-type-string-color': '#ce9178',
|
|
157
|
-
'--w-rjv-type-int-color': '#
|
|
158
|
-
'--w-rjv-type-float-color': '#
|
|
159
|
-
'--w-rjv-type-bigint-color': '#
|
|
160
|
-
'--w-rjv-type-boolean-color': '#
|
|
161
|
-
'--w-rjv-type-date-color': '#
|
|
162
|
-
'--w-rjv-type-url-color': '#
|
|
163
|
-
'--w-rjv-type-null-color': '#
|
|
165
|
+
'--w-rjv-type-int-color': '#b5cea8',
|
|
166
|
+
'--w-rjv-type-float-color': '#b5cea8',
|
|
167
|
+
'--w-rjv-type-bigint-color': '#b5cea8',
|
|
168
|
+
'--w-rjv-type-boolean-color': '#569cd6',
|
|
169
|
+
'--w-rjv-type-date-color': '#b5cea8',
|
|
170
|
+
'--w-rjv-type-url-color': '#3b89cf',
|
|
171
|
+
'--w-rjv-type-null-color': '#569cd6',
|
|
164
172
|
'--w-rjv-type-nan-color': '#859900',
|
|
165
|
-
'--w-rjv-type-undefined-color': '#
|
|
173
|
+
'--w-rjv-type-undefined-color': '#569cd6',
|
|
166
174
|
};
|
|
167
175
|
|
|
168
176
|
export default function Demo() {
|
|
@@ -179,7 +187,7 @@ Online custom style example, please check in the [documentation website](https:/
|
|
|
179
187
|
```tsx mdx:preview:&title=Online Editing Theme
|
|
180
188
|
import React, { useState, useEffect } from 'react';
|
|
181
189
|
import Colorful from '@uiw/react-color-colorful';
|
|
182
|
-
import JsonView from '@uiw/react-json-view
|
|
190
|
+
import JsonView from '@uiw/react-json-view';
|
|
183
191
|
|
|
184
192
|
const object = {
|
|
185
193
|
avatar: 'https://i.imgur.com/MK3eW3As.jpg',
|
|
@@ -207,33 +215,32 @@ const object = {
|
|
|
207
215
|
}
|
|
208
216
|
const customTheme = {
|
|
209
217
|
'--w-rjv-color': '#9cdcfe',
|
|
218
|
+
'--w-rjv-key-string': '#9cdcfe',
|
|
210
219
|
'--w-rjv-background-color': '#1e1e1e',
|
|
211
|
-
'--w-rjv-line-color': '#
|
|
212
|
-
'--w-rjv-arrow-color': '#
|
|
213
|
-
'--w-rjv-edit-color': '#
|
|
214
|
-
'--w-rjv-
|
|
215
|
-
'--w-rjv-
|
|
216
|
-
'--w-rjv-
|
|
217
|
-
'--w-rjv-update-color': '#ebcb8b',
|
|
218
|
-
'--w-rjv-copied-color': '#0184a6',
|
|
220
|
+
'--w-rjv-line-color': '#36334280',
|
|
221
|
+
'--w-rjv-arrow-color': '#838383',
|
|
222
|
+
'--w-rjv-edit-color': '#9cdcfe',
|
|
223
|
+
'--w-rjv-info-color': '#9c9c9c7a',
|
|
224
|
+
'--w-rjv-update-color': '#9cdcfe',
|
|
225
|
+
'--w-rjv-copied-color': '#9cdcfe',
|
|
219
226
|
'--w-rjv-copied-success-color': '#28a745',
|
|
220
227
|
|
|
221
228
|
'--w-rjv-curlybraces-color': '#d4d4d4',
|
|
222
|
-
'--w-rjv-colon-color': '#
|
|
229
|
+
'--w-rjv-colon-color': '#d4d4d4',
|
|
223
230
|
'--w-rjv-brackets-color': '#d4d4d4',
|
|
231
|
+
'--w-rjv-quotes-color': '#9cdcfe',
|
|
232
|
+
'--w-rjv-quotes-string-color': '#ce9178',
|
|
224
233
|
|
|
225
234
|
'--w-rjv-type-string-color': '#ce9178',
|
|
226
|
-
'--w-rjv-type-int-color': '#
|
|
227
|
-
'--w-rjv-type-float-color': '#
|
|
228
|
-
'--w-rjv-type-bigint-color': '#
|
|
229
|
-
'--w-rjv-type-boolean-color': '#
|
|
230
|
-
'--w-rjv-type-date-color': '#
|
|
231
|
-
'--w-rjv-type-url-color': '#
|
|
235
|
+
'--w-rjv-type-int-color': '#b5cea8',
|
|
236
|
+
'--w-rjv-type-float-color': '#b5cea8',
|
|
237
|
+
'--w-rjv-type-bigint-color': '#b5cea8',
|
|
238
|
+
'--w-rjv-type-boolean-color': '#569cd6',
|
|
239
|
+
'--w-rjv-type-date-color': '#b5cea8',
|
|
240
|
+
'--w-rjv-type-url-color': '#3b89cf',
|
|
241
|
+
'--w-rjv-type-null-color': '#569cd6',
|
|
232
242
|
'--w-rjv-type-nan-color': '#859900',
|
|
233
|
-
'--w-rjv-type-undefined-color': '#
|
|
234
|
-
'--w-rjv-type-null-color': '#d33682',
|
|
235
|
-
'--w-rjv-type-set-color': '#268bd2',
|
|
236
|
-
'--w-rjv-type-map-color': '#268bd2',
|
|
243
|
+
'--w-rjv-type-undefined-color': '#569cd6',
|
|
237
244
|
};
|
|
238
245
|
|
|
239
246
|
export default function Demo() {
|
|
@@ -261,20 +268,11 @@ export default function Demo() {
|
|
|
261
268
|
const changeEditable = (evn) => setEditable(evn.target.checked);
|
|
262
269
|
return (
|
|
263
270
|
<React.Fragment>
|
|
264
|
-
<label>
|
|
265
|
-
<input type="checkbox" checked={editable} onChange={changeEditable} /> Editable
|
|
266
|
-
</label>
|
|
267
271
|
<div style={{ display: 'flex', gap: '1rem', alignItems: 'flex-start' }}>
|
|
268
272
|
<JsonView
|
|
269
|
-
editable={editable}
|
|
273
|
+
// editable={editable}
|
|
270
274
|
value={src}
|
|
271
275
|
keyName="root"
|
|
272
|
-
onAdd={(keyOrValue, newValue, value, isAdd) => {
|
|
273
|
-
return isAdd;
|
|
274
|
-
}}
|
|
275
|
-
onEdit={(opts) => {
|
|
276
|
-
return true;
|
|
277
|
-
}}
|
|
278
276
|
style={{ flex: 1, overflow: 'auto', ...theme }}
|
|
279
277
|
/>
|
|
280
278
|
<div>
|
|
@@ -291,18 +289,18 @@ export default function Demo() {
|
|
|
291
289
|
</div>
|
|
292
290
|
</div>
|
|
293
291
|
</div>
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
{
|
|
292
|
+
<pre style={{ padding: 10 }}>
|
|
293
|
+
Copy the theme configuration below into your project.
|
|
294
|
+
<JsonView value={theme} displayDataTypes={false} />
|
|
297
295
|
</pre>
|
|
298
296
|
</React.Fragment>
|
|
299
|
-
)
|
|
297
|
+
);
|
|
300
298
|
}
|
|
301
299
|
```
|
|
302
300
|
|
|
303
301
|
## Render
|
|
304
302
|
|
|
305
|
-
|
|
303
|
+
**`v2`** version allows flexible customization of each "part" by providing small sub-components for customization, including value and type components: `<Bigint />`, `<Date />`, `<False />`, `<Float />`, `<Int />`, `<Map />`, `<Nan />`, `<Null />`, `<Set />`, `<String />`, `<True />`, `<Undefined />`, `<Url />`, and symbol components: `<ValueQuote />`, `<Arrow />`, `<Colon />`, `<Quote />`, `<BraceLeft />`, `<BraceRight />`, `<BracketsLeft />`, `<BracketsRight />`.
|
|
306
304
|
|
|
307
305
|
```tsx mdx:preview
|
|
308
306
|
import React from 'react';
|
|
@@ -314,29 +312,29 @@ const object = {
|
|
|
314
312
|
integer: 42,
|
|
315
313
|
}
|
|
316
314
|
|
|
317
|
-
function value({ type, children, value, setValue, keyName, parentValue, visible, ...props }) {
|
|
318
|
-
if (type === 'string' && /\.(jpg)$/.test(value)) {
|
|
319
|
-
return (
|
|
320
|
-
<span {...props}>
|
|
321
|
-
<img src={value} height="36" />
|
|
322
|
-
</span>
|
|
323
|
-
);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
|
|
327
315
|
export default function Demo() {
|
|
328
316
|
return (
|
|
329
317
|
<JsonView
|
|
330
318
|
value={object}
|
|
331
319
|
keyName="root"
|
|
332
|
-
// quotes=""
|
|
333
320
|
displayObjectSize={false}
|
|
334
|
-
displayDataTypes={false}
|
|
335
321
|
style={{
|
|
336
322
|
'--w-rjv-background-color': '#ffffff',
|
|
337
323
|
}}
|
|
338
|
-
|
|
339
|
-
|
|
324
|
+
>
|
|
325
|
+
<JsonView.String
|
|
326
|
+
render={({ children, ...reset }, { type }) => {
|
|
327
|
+
const isImg = /^https?.*\.(jpg|png)$/i.test(children)
|
|
328
|
+
if (type === 'type' && isImg) {
|
|
329
|
+
return <span />
|
|
330
|
+
}
|
|
331
|
+
if (type === 'value' && isImg) {
|
|
332
|
+
return <img {...reset} height="26" src={children} />
|
|
333
|
+
}
|
|
334
|
+
}}
|
|
335
|
+
/>
|
|
336
|
+
<JsonView.Colon> -> </JsonView.Colon>
|
|
337
|
+
</JsonView>
|
|
340
338
|
)
|
|
341
339
|
}
|
|
342
340
|
```
|
|
@@ -363,23 +361,13 @@ export default function Demo() {
|
|
|
363
361
|
}
|
|
364
362
|
```
|
|
365
363
|
|
|
364
|
+
Supports certain partial customizations such as: `<Copied />`, `<CountInfo />`, `<CountInfoExtra />`, `<Ellipsis />`, `<KeyName />`
|
|
365
|
+
|
|
366
366
|
```tsx mdx:preview
|
|
367
|
-
import React from 'react';
|
|
368
|
-
import JsonView from '@uiw/react-json-view';
|
|
367
|
+
import React, { Fragment } from 'react';
|
|
368
|
+
import JsonView, { ValueQuote } from '@uiw/react-json-view';
|
|
369
369
|
|
|
370
|
-
|
|
371
|
-
if (value instanceof URL) {
|
|
372
|
-
return (
|
|
373
|
-
<span {...props}>
|
|
374
|
-
<a href={value.href} target="_blank" rel="noopener noreferrer">
|
|
375
|
-
{children}
|
|
376
|
-
</a>
|
|
377
|
-
Open URL
|
|
378
|
-
{visible && <del>Button</del>}
|
|
379
|
-
</span>
|
|
380
|
-
);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
370
|
+
const Copied = JsonView.Copied;
|
|
383
371
|
|
|
384
372
|
export default function Demo() {
|
|
385
373
|
return (
|
|
@@ -389,11 +377,39 @@ export default function Demo() {
|
|
|
389
377
|
urlStr: "https://example.com",
|
|
390
378
|
github: "https://example.com",
|
|
391
379
|
}}
|
|
392
|
-
components={{ value }}
|
|
393
380
|
style={{
|
|
394
381
|
'--w-rjv-background-color': '#ffffff',
|
|
395
382
|
}}
|
|
396
|
-
|
|
383
|
+
>
|
|
384
|
+
<Copied
|
|
385
|
+
render={({ 'data-copied': copied, style, onClick, ...props }, { value }) => {
|
|
386
|
+
const styl = { whiteSpace: 'nowrap' }
|
|
387
|
+
if (copied) {
|
|
388
|
+
return <span style={{ ...style, ...styl }}>复制成功</span>
|
|
389
|
+
}
|
|
390
|
+
return <span style={{ ...style, ...styl }} onClick={onClick}>复制</span>
|
|
391
|
+
}}
|
|
392
|
+
/>
|
|
393
|
+
<JsonView.Url
|
|
394
|
+
render={(props, { type, value }) => {
|
|
395
|
+
if (type === 'type' && value instanceof URL) {
|
|
396
|
+
return <span />
|
|
397
|
+
}
|
|
398
|
+
if (type === 'value' && value instanceof URL) {
|
|
399
|
+
return (
|
|
400
|
+
<Fragment>
|
|
401
|
+
<a href={value.href} target="_blank" {...props}>
|
|
402
|
+
<ValueQuote />
|
|
403
|
+
{value.href}
|
|
404
|
+
<ValueQuote />
|
|
405
|
+
</a>
|
|
406
|
+
Open URL
|
|
407
|
+
</Fragment>
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
}}
|
|
411
|
+
/>
|
|
412
|
+
</JsonView>
|
|
397
413
|
)
|
|
398
414
|
}
|
|
399
415
|
```
|
|
@@ -440,92 +456,73 @@ const customTheme = {
|
|
|
440
456
|
'--w-rjv-border-left-width': 0,
|
|
441
457
|
'--w-rjv-color': '#881391',
|
|
442
458
|
'--w-rjv-type-int-color': '#881391',
|
|
459
|
+
'--w-rjv-key-number': '#881391',
|
|
460
|
+
'--w-rjv-key-string': '#881391',
|
|
443
461
|
};
|
|
444
462
|
|
|
463
|
+
const Quote = JsonView.Quote;
|
|
464
|
+
const BraceLeft = JsonView.BraceLeft;
|
|
465
|
+
const BraceRight = JsonView.BraceRight;
|
|
466
|
+
const CountInfo = JsonView.CountInfo;
|
|
467
|
+
const Ellipsis = JsonView.Ellipsis;
|
|
468
|
+
const CountInfoExtra = JsonView.CountInfoExtra;
|
|
469
|
+
|
|
445
470
|
export default function Demo() {
|
|
446
471
|
return (
|
|
447
472
|
<JsonView
|
|
448
473
|
value={object}
|
|
449
474
|
style={customTheme}
|
|
450
|
-
quotes=""
|
|
451
475
|
enableClipboard={false}
|
|
452
476
|
displayDataTypes={false}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
if (
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
if (level === 1) {
|
|
464
|
-
return <span>{Array.from({ length: 3 }, () => 'Object').join(', ')}</span>;
|
|
477
|
+
>
|
|
478
|
+
<Ellipsis
|
|
479
|
+
render={({ 'data-expanded': isExpanded, className, ...props }, { value }) => {
|
|
480
|
+
if (Array.isArray(value) && isExpanded) {
|
|
481
|
+
console.log('props:',value, isExpanded, props)
|
|
482
|
+
return (
|
|
483
|
+
<span className={className}>
|
|
484
|
+
{Array.from({ length: value.length }, () => 'Object').join(', ')}
|
|
485
|
+
</span>
|
|
486
|
+
)
|
|
465
487
|
}
|
|
466
488
|
return <span />;
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
|
|
489
|
+
}}
|
|
490
|
+
/>
|
|
491
|
+
<Quote>
|
|
492
|
+
<span />
|
|
493
|
+
</Quote>
|
|
494
|
+
<BraceLeft>
|
|
495
|
+
<span />
|
|
496
|
+
</BraceLeft>
|
|
497
|
+
<BraceRight>
|
|
498
|
+
<span />
|
|
499
|
+
</BraceRight>
|
|
500
|
+
<CountInfo
|
|
501
|
+
render={({ 'data-length': length, ...props }, { value }) => {
|
|
502
|
+
const isArray = Array.isArray(value);
|
|
503
|
+
if (isArray) return <span />;
|
|
504
|
+
return (
|
|
505
|
+
<span {...props}>Object</span>
|
|
506
|
+
);
|
|
507
|
+
}}
|
|
508
|
+
/>
|
|
509
|
+
</JsonView>
|
|
470
510
|
);
|
|
471
511
|
}
|
|
472
512
|
```
|
|
473
513
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
```tsx mdx:preview
|
|
477
|
-
import React, { useRef } from 'react';
|
|
478
|
-
import JsonViewEditor from '@uiw/react-json-view/editor';
|
|
479
|
-
import { type SemicolonProps, useHighlight } from '@uiw/react-json-view';
|
|
480
|
-
|
|
481
|
-
const object = {
|
|
482
|
-
string: 'Lorem ipsum dolor sit amet',
|
|
483
|
-
integer: 42,
|
|
484
|
-
float: 114.514,
|
|
485
|
-
object: {
|
|
486
|
-
'first-child': true,
|
|
487
|
-
'second-child': false,
|
|
488
|
-
'last-child': null,
|
|
489
|
-
'child': {
|
|
490
|
-
'first': true,
|
|
491
|
-
'second': false,
|
|
492
|
-
'last': null,
|
|
493
|
-
},
|
|
494
|
-
},
|
|
495
|
-
nestedArray: [ [1, 2], [3, 4], { a: 1} ],
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
const ObjectKey: SemicolonProps['render'] = ({ value, keyName, parentName, ...props }) => {
|
|
499
|
-
const $edit = useRef<HTMLSpanElement & HTMLModElement>(null);
|
|
500
|
-
useHighlight({ value, highlightUpdates: true, highlightContainer: $edit });
|
|
501
|
-
if (keyName === 'integer' && typeof value === 'number' && value > 40) {
|
|
502
|
-
return <del {...props} ref={$edit} />;
|
|
503
|
-
}
|
|
504
|
-
return <span {...props} ref={$edit} />;
|
|
505
|
-
}
|
|
514
|
+
Passing **as="tagName"** will automatically infer the type.
|
|
506
515
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
// opts.namespace: ['object', 'child', 'last']
|
|
518
|
-
// opts.oldValue: null
|
|
519
|
-
// opts.type: "value"
|
|
520
|
-
// opts.value: "NULL3"
|
|
521
|
-
return true;
|
|
522
|
-
}}
|
|
523
|
-
components={{
|
|
524
|
-
objectKey: ObjectKey
|
|
525
|
-
}}
|
|
526
|
-
/>
|
|
527
|
-
);
|
|
528
|
-
}
|
|
516
|
+
```tsx
|
|
517
|
+
<JsonView.CountInfo
|
|
518
|
+
as="del"
|
|
519
|
+
render={(props, { value, keyName }) => {
|
|
520
|
+
if (keyName === 'integer' && typeof value === 'number' && value > 10) {
|
|
521
|
+
console.log('value:', value, props)
|
|
522
|
+
return <del {...props}>{keyName}</del>;
|
|
523
|
+
}
|
|
524
|
+
}}
|
|
525
|
+
/>
|
|
529
526
|
```
|
|
530
527
|
|
|
531
528
|
## Highlight Updates
|
|
@@ -603,10 +600,11 @@ export default function Demo() {
|
|
|
603
600
|
'--w-rjv-background-color': '#ffffff',
|
|
604
601
|
'--w-rjv-border-left': '1px dashed #ebebeb',
|
|
605
602
|
}}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
603
|
+
>
|
|
604
|
+
<JsonView.Arrow>
|
|
605
|
+
<TriangleSolidArrow />
|
|
606
|
+
</JsonView.Arrow>
|
|
607
|
+
</JsonView>
|
|
610
608
|
)
|
|
611
609
|
}
|
|
612
610
|
```
|
|
@@ -616,6 +614,8 @@ Display of custom **svg** `icon` components
|
|
|
616
614
|
```tsx mdx:preview
|
|
617
615
|
import React from 'react';
|
|
618
616
|
import JsonView from '@uiw/react-json-view';
|
|
617
|
+
import { TriangleArrow } from '@uiw/react-json-view/triangle-arrow';
|
|
618
|
+
import { TriangleSolidArrow } from '@uiw/react-json-view/triangle-solid-arrow';
|
|
619
619
|
|
|
620
620
|
const object = {
|
|
621
621
|
string: 'Lorem ipsum dolor sit amet',
|
|
@@ -631,29 +631,6 @@ const object = {
|
|
|
631
631
|
[3, 4],
|
|
632
632
|
],
|
|
633
633
|
}
|
|
634
|
-
|
|
635
|
-
const Arrow = (props) => {
|
|
636
|
-
const { style, 'data-expand': expand, ...reset } = props;
|
|
637
|
-
const svgProps = {
|
|
638
|
-
style: { cursor: 'pointer', height: '1em', width: '1em' },
|
|
639
|
-
viewBox: '0 0 24 24',
|
|
640
|
-
fill: 'var(--w-rjv-arrow-color, currentColor)',
|
|
641
|
-
...reset
|
|
642
|
-
}
|
|
643
|
-
if (!expand) {
|
|
644
|
-
return (
|
|
645
|
-
<svg {...svgProps}>
|
|
646
|
-
<path d="M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,7H11V11H7V13H11V17H13V13H17V11H13V7Z" />
|
|
647
|
-
</svg>
|
|
648
|
-
);
|
|
649
|
-
}
|
|
650
|
-
return (
|
|
651
|
-
<svg {...svgProps}>
|
|
652
|
-
<path d="M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M7,13H17V11H7" />
|
|
653
|
-
</svg>
|
|
654
|
-
);
|
|
655
|
-
}
|
|
656
|
-
|
|
657
634
|
export default function Demo() {
|
|
658
635
|
return (
|
|
659
636
|
<JsonView
|
|
@@ -663,119 +640,136 @@ export default function Demo() {
|
|
|
663
640
|
'--w-rjv-background-color': '#ffffff',
|
|
664
641
|
'--w-rjv-border-left': '1px dashed #ebebeb',
|
|
665
642
|
}}
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
643
|
+
>
|
|
644
|
+
<JsonView.Arrow
|
|
645
|
+
render={({ 'data-expanded': isExpanded, ...props }) => {
|
|
646
|
+
const svgProps = {
|
|
647
|
+
style: {
|
|
648
|
+
cursor: 'pointer', height: '1em', width: '1em', marginRight: 5, userSelect: 'none'
|
|
649
|
+
},
|
|
650
|
+
fill: "var(--w-rjv-arrow-color, currentColor)"
|
|
651
|
+
}
|
|
652
|
+
if (!isExpanded) {
|
|
653
|
+
return (
|
|
654
|
+
<svg viewBox="0 0 24 24" {...svgProps}>
|
|
655
|
+
<path d="M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,7H11V11H7V13H11V17H13V13H17V11H13V7Z" />
|
|
656
|
+
</svg>
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
return (
|
|
660
|
+
<svg viewBox="0 0 24 24" {...svgProps}>
|
|
661
|
+
<path d="M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M7,13H17V11H7" />
|
|
662
|
+
</svg>
|
|
663
|
+
);
|
|
664
|
+
}}
|
|
665
|
+
/>
|
|
666
|
+
</JsonView>
|
|
667
|
+
);
|
|
671
668
|
}
|
|
672
669
|
```
|
|
673
670
|
|
|
674
671
|
## Props
|
|
675
672
|
|
|
676
|
-
|
|
673
|
+
Migrate from kkt v1 to v2. The new v2 version has removed the ~~`quotes`~~ and ~~`components`~~ props.
|
|
674
|
+
|
|
675
|
+
```diff
|
|
676
|
+
export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
677
|
+
- quotes?: "'" | '"' | '';
|
|
678
|
+
- components?: {};
|
|
679
|
+
}
|
|
680
|
+
```
|
|
677
681
|
|
|
678
682
|
```ts
|
|
679
|
-
|
|
680
|
-
import { MetaProps, SemicolonProps, EllipsisProps, ValueViewProps } from '@uiw/react-json-view';
|
|
681
|
-
import type { CountInfoExtraProps } from '@uiw/react-json-view/cjs/editor/countInfoExtra';
|
|
682
|
-
export interface JsonViewProps<T> extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
683
|
+
export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
683
684
|
/** This property contains your input JSON */
|
|
684
685
|
value?: T;
|
|
686
|
+
/** Define the root node name. @default undefined */
|
|
687
|
+
keyName?: string | number;
|
|
688
|
+
/** Whether sort keys through `String.prototype.localeCompare()` @default false */
|
|
689
|
+
objectSortKeys?: boolean | ((a: string, b: string) => number);
|
|
685
690
|
/** Set the indent-width for nested objects @default 15 */
|
|
686
691
|
indentWidth?: number;
|
|
687
|
-
/** When set to `true`, data type labels prefix values @default true */
|
|
688
|
-
displayDataTypes?: boolean;
|
|
689
692
|
/** When set to `true`, `objects` and `arrays` are labeled with size @default true */
|
|
690
693
|
displayObjectSize?: boolean;
|
|
691
|
-
/**
|
|
692
|
-
|
|
693
|
-
/** Define the root node name. @default undefined */
|
|
694
|
-
keyName?: string | number;
|
|
694
|
+
/** When set to `true`, data type labels prefix values @default true */
|
|
695
|
+
displayDataTypes?: boolean;
|
|
695
696
|
/** The user can copy objects and arrays to clipboard by clicking on the clipboard icon. @default true */
|
|
696
697
|
enableClipboard?: boolean;
|
|
697
698
|
/** Whether to highlight updates. @default true */
|
|
698
699
|
highlightUpdates?: boolean;
|
|
699
|
-
/** Whether sort keys through `String.prototype.localeCompare()` @default false */
|
|
700
|
-
objectSortKeys?: boolean | ((a: string, b: string) => number);
|
|
701
|
-
/** Display for quotes in object-key @default " */
|
|
702
|
-
quotes?: "'" | '"' | '';
|
|
703
|
-
/** When set to true, all nodes will be collapsed by default. Use an integer value to collapse at a particular depth. @default false */
|
|
704
|
-
collapsed?: boolean | number;
|
|
705
700
|
/** Callback function for when a treeNode is expanded or collapsed */
|
|
706
701
|
onExpand?: (props: {
|
|
707
702
|
expand: boolean;
|
|
708
|
-
value
|
|
703
|
+
value?: T;
|
|
709
704
|
keyid: string;
|
|
710
705
|
keyName?: string | number;
|
|
711
706
|
}) => void;
|
|
712
707
|
/** Fires event when you copy */
|
|
713
|
-
onCopied?:
|
|
714
|
-
/** Redefine interface elements to re-render. */
|
|
715
|
-
components?: {
|
|
716
|
-
braces?: MetaProps['render'];
|
|
717
|
-
ellipsis?: EllipsisProps['render'];
|
|
718
|
-
arrow?: JSX.Element;
|
|
719
|
-
objectKey?: SemicolonProps['render'];
|
|
720
|
-
value?: (props: RenderValueProps<T>) => JSX.Element;
|
|
721
|
-
copied?: CopiedProps<T>['render'];
|
|
722
|
-
countInfo?: (props: CountInfoProps) => JSX.Element;
|
|
723
|
-
countInfoExtra?: (props: Omit<CountInfoExtraProps<T>, 'editable'>) => JSX.Element;
|
|
724
|
-
};
|
|
725
|
-
}
|
|
726
|
-
interface RenderValueProps<T extends object> extends React.HTMLAttributes<HTMLSpanElement> {
|
|
727
|
-
type: TypeProps['type'];
|
|
728
|
-
value?: unknown;
|
|
729
|
-
parentValue?: T;
|
|
730
|
-
data?: T;
|
|
731
|
-
visible?: boolean;
|
|
732
|
-
quotes?: JsonViewProps<T>['quotes'];
|
|
733
|
-
namespace?: Array<string | number>;
|
|
734
|
-
setValue?: React.Dispatch<React.SetStateAction<T>>;
|
|
735
|
-
keyName?: ValueViewProps<T>['keyName'];
|
|
736
|
-
}
|
|
737
|
-
declare const JsonView: React.ForwardRefExoticComponent<Omit<JsonViewProps<object>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
738
|
-
export default JsonView;
|
|
739
|
-
export interface CountInfoProps {
|
|
740
|
-
count: number;
|
|
741
|
-
level: number;
|
|
742
|
-
visible: boolean;
|
|
708
|
+
onCopied?: (text: string, value?: T) => void;
|
|
743
709
|
}
|
|
744
710
|
```
|
|
745
711
|
|
|
746
|
-
### JsonView Editor Props
|
|
747
|
-
|
|
748
712
|
```ts
|
|
749
|
-
import {
|
|
750
|
-
import
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
|
|
713
|
+
import { BraceLeft } from './symbol/BraceLeft';
|
|
714
|
+
import { BraceRight } from './symbol/BraceRight';
|
|
715
|
+
import { BracketsLeft } from './symbol/BracketsLeft';
|
|
716
|
+
import { BracketsRight } from './symbol/BracketsRight';
|
|
717
|
+
import { Arrow } from './symbol/Arrow';
|
|
718
|
+
import { Colon } from './symbol/Colon';
|
|
719
|
+
import { Ellipsis } from './symbol/Ellipsis';
|
|
720
|
+
import { Quote } from './symbol/Quote';
|
|
721
|
+
import { ValueQuote } from './symbol/ValueQuote';
|
|
722
|
+
import { Bigint } from './types/Bigint';
|
|
723
|
+
import { Date } from './types/Date';
|
|
724
|
+
import { False } from './types/False';
|
|
725
|
+
import { Float } from './types/Float';
|
|
726
|
+
import { Int } from './types/Int';
|
|
727
|
+
import { Map } from './types/Map';
|
|
728
|
+
import { Nan } from './types/Nan';
|
|
729
|
+
import { Null } from './types/Null';
|
|
730
|
+
import { Set } from './types/Set';
|
|
731
|
+
import { StringText } from './types/String';
|
|
732
|
+
import { True } from './types/True';
|
|
733
|
+
import { Undefined } from './types/Undefined';
|
|
734
|
+
import { Url } from './types/Url';
|
|
735
|
+
import { Copied } from './section/Copied';
|
|
736
|
+
import { CountInfo } from './section/CountInfo';
|
|
737
|
+
import { CountInfoExtra } from './section/CountInfoExtra';
|
|
738
|
+
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
|
+
|
|
743
|
+
type JsonViewComponent = React.FC<React.PropsWithRef<JsonViewProps<object>>> & {
|
|
744
|
+
Bigint: typeof Bigint;
|
|
745
|
+
Date: typeof Date;
|
|
746
|
+
False: typeof False;
|
|
747
|
+
Float: typeof Float;
|
|
748
|
+
Int: typeof Int;
|
|
749
|
+
Map: typeof Map;
|
|
750
|
+
Nan: typeof Nan;
|
|
751
|
+
Null: typeof Null;
|
|
752
|
+
Set: typeof Set;
|
|
753
|
+
String: typeof StringText;
|
|
754
|
+
True: typeof True;
|
|
755
|
+
Undefined: typeof Undefined;
|
|
756
|
+
Url: typeof Url;
|
|
757
|
+
BraceLeft: typeof BraceLeft;
|
|
758
|
+
BraceRight: typeof BraceRight;
|
|
759
|
+
BracketsLeft: typeof BracketsLeft;
|
|
760
|
+
BracketsRight: typeof BracketsRight;
|
|
761
|
+
Colon: typeof Colon;
|
|
762
|
+
Ellipsis: typeof Ellipsis;
|
|
763
|
+
Quote: typeof Quote;
|
|
764
|
+
ValueQuote: typeof ValueQuote;
|
|
765
|
+
Arrow: typeof Arrow;
|
|
766
|
+
Copied: typeof Copied;
|
|
767
|
+
CountInfo: typeof CountInfo;
|
|
768
|
+
CountInfoExtra: typeof CountInfoExtra;
|
|
769
|
+
KeyName: typeof KeyName;
|
|
770
|
+
};
|
|
771
|
+
declare const JsonView: JsonViewComponent;
|
|
772
|
+
export default JsonView;
|
|
779
773
|
```
|
|
780
774
|
|
|
781
775
|
## Size and dependencies
|