@oursprivacy/react-json-view 1.27.4 → 1.27.6
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 +50 -31
- package/dist/main.js +1 -0
- package/index.d.ts +303 -314
- package/package.json +295 -265
- package/dist/main.cjs.js +0 -32
- package/dist/main.cjs.js.map +0 -1
- package/dist/main.esm.js +0 -6869
- package/dist/main.esm.js.map +0 -1
- package/dist/main.umd.js +0 -32
- package/dist/main.umd.js.map +0 -1
package/index.d.ts
CHANGED
|
@@ -1,338 +1,327 @@
|
|
|
1
|
-
import type * as React from "react";
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* This
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* This file is internally maintained and can be modified as needed to match the library's implementation.
|
|
10
|
-
* If you need to make changes or download the latest version, please visit the GitHub repository:
|
|
11
|
-
*
|
|
12
|
-
* @see {@link https://github.com/with-ours/react-json-view | GitHub Repository}
|
|
13
|
-
*
|
|
14
|
-
* The repository contains the full source code, including this type definition file, making it easy
|
|
15
|
-
* to download, edit, and customize the types to suit your specific needs.
|
|
2
|
+
* Type definitions for react-json-view
|
|
3
|
+
*
|
|
4
|
+
* This is a fork maintained at: https://github.com/with-ours/react-json-view
|
|
5
|
+
* Engineers can edit this file and publish a new version as needed.
|
|
16
6
|
*/
|
|
17
7
|
|
|
8
|
+
import * as React from 'react'
|
|
9
|
+
|
|
18
10
|
export interface ReactJsonViewProps {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
string,
|
|
192
|
-
(children: React.ReactNode) => React.ReactNode
|
|
193
|
-
>;
|
|
11
|
+
/**
|
|
12
|
+
* This property contains your input JSON.
|
|
13
|
+
*
|
|
14
|
+
* Required.
|
|
15
|
+
*/
|
|
16
|
+
src: object
|
|
17
|
+
/**
|
|
18
|
+
* Contains the name of your root node. Use null or false for no name.
|
|
19
|
+
*
|
|
20
|
+
* Default: "root"
|
|
21
|
+
*/
|
|
22
|
+
name?: React.JSX.Element | string | null | false
|
|
23
|
+
/**
|
|
24
|
+
* RJV supports base-16 themes. Check out the list of supported themes in the demo.
|
|
25
|
+
* A custom "rjv-default" theme applies by default.
|
|
26
|
+
*
|
|
27
|
+
* Default: "rjv-default"
|
|
28
|
+
*/
|
|
29
|
+
theme?: ThemeKeys | ThemeObject
|
|
30
|
+
/**
|
|
31
|
+
* Style attributes for react-json-view container.
|
|
32
|
+
* Explicit style attributes will override attributes provided by a theme.
|
|
33
|
+
*
|
|
34
|
+
* Default: "rjv-default"
|
|
35
|
+
*/
|
|
36
|
+
style?: React.CSSProperties
|
|
37
|
+
/**
|
|
38
|
+
* Style of expand/collapse icons. Accepted values are "circle", triangle" or "square".
|
|
39
|
+
*
|
|
40
|
+
* Default: {}
|
|
41
|
+
*/
|
|
42
|
+
iconStyle?: 'circle' | 'triangle' | 'square'
|
|
43
|
+
/**
|
|
44
|
+
* Set the indent-width for nested objects.
|
|
45
|
+
*
|
|
46
|
+
* Default: 4
|
|
47
|
+
*/
|
|
48
|
+
indentWidth?: number
|
|
49
|
+
/**
|
|
50
|
+
* When set to true, all nodes will be collapsed by default.
|
|
51
|
+
* Use an integer value to collapse at a particular depth.
|
|
52
|
+
*
|
|
53
|
+
* Default: false
|
|
54
|
+
*/
|
|
55
|
+
collapsed?: boolean | number
|
|
56
|
+
/**
|
|
57
|
+
* When an integer value is assigned, strings will be cut off at that length.
|
|
58
|
+
* Collapsed strings are followed by an ellipsis.
|
|
59
|
+
* String content can be expanded and collapsed by clicking on the string value.
|
|
60
|
+
*
|
|
61
|
+
* Default: false
|
|
62
|
+
*/
|
|
63
|
+
collapseStringsAfterLength?: number | false
|
|
64
|
+
/**
|
|
65
|
+
* Callback function to provide control over what objects and arrays should be collapsed by default.
|
|
66
|
+
* An object is passed to the callback containing name, src, type ("array" or "object") and namespace.
|
|
67
|
+
*
|
|
68
|
+
* Default: false
|
|
69
|
+
*/
|
|
70
|
+
shouldCollapse?: false | ((field: CollapsedFieldProps) => boolean)
|
|
71
|
+
/**
|
|
72
|
+
* When an integer value is assigned, arrays will be displayed in groups by count of the value.
|
|
73
|
+
* Groups are displayed with brakcet notation and can be expanded and collapsed by clickong on the brackets.
|
|
74
|
+
*
|
|
75
|
+
* Default: 100
|
|
76
|
+
*/
|
|
77
|
+
groupArraysAfterLength?: number
|
|
78
|
+
/**
|
|
79
|
+
* When prop is not false, the user can copy objects and arrays to clipboard by clicking on the clipboard icon.
|
|
80
|
+
* Copy callbacks are supported.
|
|
81
|
+
*
|
|
82
|
+
* Default: true
|
|
83
|
+
*/
|
|
84
|
+
enableClipboard?: boolean | ((copy: OnCopyProps) => void)
|
|
85
|
+
/**
|
|
86
|
+
* When set to true, objects and arrays are labeled with size.
|
|
87
|
+
*
|
|
88
|
+
* Default: true
|
|
89
|
+
*/
|
|
90
|
+
displayObjectSize?: boolean
|
|
91
|
+
/**
|
|
92
|
+
* When set to true, data type labels prefix values.
|
|
93
|
+
*
|
|
94
|
+
* Default: true
|
|
95
|
+
*/
|
|
96
|
+
displayDataTypes?: boolean
|
|
97
|
+
/**
|
|
98
|
+
* When set to true, the index of the elements prefix values
|
|
99
|
+
*
|
|
100
|
+
* Default: true
|
|
101
|
+
*/
|
|
102
|
+
displayArrayKey?: boolean
|
|
103
|
+
/**
|
|
104
|
+
* set to false to remove quotes from keys (eg. "name": vs. name:)
|
|
105
|
+
*
|
|
106
|
+
* Default: true
|
|
107
|
+
*/
|
|
108
|
+
quotesOnKeys?: boolean
|
|
109
|
+
/**
|
|
110
|
+
* When a callback function is passed in, edit functionality is enabled.
|
|
111
|
+
* The callback is invoked before edits are completed. Returning false
|
|
112
|
+
* from onEdit will prevent the change from being made. see: onEdit docs.
|
|
113
|
+
*
|
|
114
|
+
* Default: false
|
|
115
|
+
*/
|
|
116
|
+
onEdit?: ((edit: InteractionProps) => false | any) | false
|
|
117
|
+
/**
|
|
118
|
+
* When a callback function is passed in, add functionality is enabled.
|
|
119
|
+
* The callback is invoked before additions are completed.
|
|
120
|
+
* Returning false from onAdd will prevent the change from being made. see: onAdd docs
|
|
121
|
+
*
|
|
122
|
+
* Default: false
|
|
123
|
+
*/
|
|
124
|
+
onAdd?: ((add: InteractionProps) => false | any) | false
|
|
125
|
+
/**
|
|
126
|
+
* When a callback function is passed in, delete functionality is enabled.
|
|
127
|
+
* The callback is invoked before deletions are completed.
|
|
128
|
+
* Returning false from onDelete will prevent the change from being made. see: onDelete docs
|
|
129
|
+
*
|
|
130
|
+
* Default: false
|
|
131
|
+
*/
|
|
132
|
+
onDelete?: ((del: InteractionProps) => false | any) | false
|
|
133
|
+
/**
|
|
134
|
+
* When a function is passed in, clicking a value triggers the onSelect method to be called.
|
|
135
|
+
*
|
|
136
|
+
* Default: false
|
|
137
|
+
*/
|
|
138
|
+
onSelect?: ((select: OnSelectProps) => void) | false
|
|
139
|
+
/**
|
|
140
|
+
* Custom message for validation failures to onEdit, onAdd, or onDelete callbacks.
|
|
141
|
+
*
|
|
142
|
+
* Default: "Validation Error"
|
|
143
|
+
*/
|
|
144
|
+
validationMessage?: string
|
|
145
|
+
/**
|
|
146
|
+
* Set to true to sort object keys.
|
|
147
|
+
*
|
|
148
|
+
* Default: false
|
|
149
|
+
*/
|
|
150
|
+
sortKeys?: boolean
|
|
151
|
+
/**
|
|
152
|
+
* Set to a value to be used as defaultValue when adding new key to json
|
|
153
|
+
*
|
|
154
|
+
* Default: null
|
|
155
|
+
*/
|
|
156
|
+
defaultValue?: TypeDefaultValue | TypeDefaultValue[] | null
|
|
157
|
+
/**
|
|
158
|
+
* Whether to select the textarea contents on edit
|
|
159
|
+
*
|
|
160
|
+
* Default: false
|
|
161
|
+
*/
|
|
162
|
+
selectOnFocus?: boolean
|
|
163
|
+
/**
|
|
164
|
+
* The key modifier to be combined with a click on JSON values to edit them
|
|
165
|
+
*
|
|
166
|
+
* Default: (e) => e.metaKey || e.ctrlKey
|
|
167
|
+
*/
|
|
168
|
+
keyModifier?: (event: Event, type: 'edit' | 'submit') => boolean
|
|
169
|
+
/**
|
|
170
|
+
* Set to true to escape strings sequences such as \n, \t, \r, \f
|
|
171
|
+
*
|
|
172
|
+
* Default: true
|
|
173
|
+
*/
|
|
174
|
+
escapeStrings?: boolean
|
|
175
|
+
/**
|
|
176
|
+
* Object mapping key names to decorator functions that replace the key name content.
|
|
177
|
+
* Decorator functions receive the key name (string) as children and return JSX that replaces the default span.
|
|
178
|
+
* Only applies to object keys, not array indices.
|
|
179
|
+
*
|
|
180
|
+
* Default: undefined
|
|
181
|
+
*/
|
|
182
|
+
keyDecorators?: Record<string, (children: string) => React.JSX.Element>
|
|
194
183
|
}
|
|
195
184
|
|
|
196
185
|
export interface OnCopyProps {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
186
|
+
/**
|
|
187
|
+
* The JSON tree source object
|
|
188
|
+
*/
|
|
189
|
+
src: object
|
|
190
|
+
/**
|
|
191
|
+
* List of keys.
|
|
192
|
+
*/
|
|
193
|
+
namespace: Array<string | null>
|
|
194
|
+
/**
|
|
195
|
+
* The last key in the namespace array.
|
|
196
|
+
*/
|
|
197
|
+
name: string | null
|
|
209
198
|
}
|
|
210
199
|
|
|
211
200
|
export interface CollapsedFieldProps {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
201
|
+
/**
|
|
202
|
+
* The name of the entry.
|
|
203
|
+
*/
|
|
204
|
+
name: string | null
|
|
205
|
+
/**
|
|
206
|
+
* The corresponding JSON subtree.
|
|
207
|
+
*/
|
|
208
|
+
src: object
|
|
209
|
+
/**
|
|
210
|
+
* The type of src. Can only be "array" or "object".
|
|
211
|
+
*/
|
|
212
|
+
type: 'array' | 'object'
|
|
213
|
+
/**
|
|
214
|
+
* The scopes above the current entry.
|
|
215
|
+
*/
|
|
216
|
+
namespace: Array<string | null>
|
|
228
217
|
}
|
|
229
218
|
|
|
230
219
|
export interface InteractionProps {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
220
|
+
/**
|
|
221
|
+
* The updated subtree of the JSON tree.
|
|
222
|
+
*/
|
|
223
|
+
updated_src: object
|
|
224
|
+
/**
|
|
225
|
+
* The existing subtree of the JSON tree.
|
|
226
|
+
*/
|
|
227
|
+
existing_src: object
|
|
228
|
+
/**
|
|
229
|
+
* The key of the entry that is interacted with.
|
|
230
|
+
*/
|
|
231
|
+
name: string | null
|
|
232
|
+
/**
|
|
233
|
+
* List of keys.
|
|
234
|
+
*/
|
|
235
|
+
namespace: Array<string | null>
|
|
236
|
+
/**
|
|
237
|
+
* The original value of the entry that is interacted with.
|
|
238
|
+
*/
|
|
239
|
+
existing_value: object | string | number | boolean | null
|
|
240
|
+
/**
|
|
241
|
+
* The updated value of the entry that is interacted with.
|
|
242
|
+
*/
|
|
243
|
+
new_value?: object | string | number | boolean | null
|
|
255
244
|
}
|
|
256
245
|
|
|
257
246
|
export interface OnSelectProps {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
247
|
+
/**
|
|
248
|
+
* The name of the currently selected entry.
|
|
249
|
+
*/
|
|
250
|
+
name: string | null
|
|
251
|
+
/**
|
|
252
|
+
* The value of the currently selected entry.
|
|
253
|
+
*/
|
|
254
|
+
value: object | string | number | boolean | null
|
|
255
|
+
/**
|
|
256
|
+
* The type of the value. For "number" type, it will be replaced with the more
|
|
257
|
+
* accurate types: "float", "integer", or "nan".
|
|
258
|
+
*/
|
|
259
|
+
type: string
|
|
260
|
+
/**
|
|
261
|
+
* List of keys representing the scopes above the selected entry.
|
|
262
|
+
*/
|
|
263
|
+
namespace: Array<string | null>
|
|
275
264
|
}
|
|
276
265
|
|
|
277
|
-
export type TypeDefaultValue = string | number | boolean | object
|
|
266
|
+
export type TypeDefaultValue = string | number | boolean | object
|
|
278
267
|
|
|
279
268
|
export interface ThemeObject {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
269
|
+
base00: string
|
|
270
|
+
base01: string
|
|
271
|
+
base02: string
|
|
272
|
+
base03: string
|
|
273
|
+
base04: string
|
|
274
|
+
base05: string
|
|
275
|
+
base06: string
|
|
276
|
+
base07: string
|
|
277
|
+
base08: string
|
|
278
|
+
base09: string
|
|
279
|
+
base0A: string
|
|
280
|
+
base0B: string
|
|
281
|
+
base0C: string
|
|
282
|
+
base0D: string
|
|
283
|
+
base0E: string
|
|
284
|
+
base0F: string
|
|
296
285
|
}
|
|
297
286
|
|
|
298
287
|
export type ThemeKeys =
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
288
|
+
| 'apathy'
|
|
289
|
+
| 'apathy:inverted'
|
|
290
|
+
| 'ashes'
|
|
291
|
+
| 'bespin'
|
|
292
|
+
| 'brewer'
|
|
293
|
+
| 'bright:inverted'
|
|
294
|
+
| 'bright'
|
|
295
|
+
| 'chalk'
|
|
296
|
+
| 'codeschool'
|
|
297
|
+
| 'colors'
|
|
298
|
+
| 'eighties'
|
|
299
|
+
| 'embers'
|
|
300
|
+
| 'flat'
|
|
301
|
+
| 'google'
|
|
302
|
+
| 'grayscale'
|
|
303
|
+
| 'grayscale:inverted'
|
|
304
|
+
| 'greenscreen'
|
|
305
|
+
| 'harmonic'
|
|
306
|
+
| 'hopscotch'
|
|
307
|
+
| 'isotope'
|
|
308
|
+
| 'marrakesh'
|
|
309
|
+
| 'mocha'
|
|
310
|
+
| 'monokai'
|
|
311
|
+
| 'ocean'
|
|
312
|
+
| 'paraiso'
|
|
313
|
+
| 'pop'
|
|
314
|
+
| 'railscasts'
|
|
315
|
+
| 'rjv-default'
|
|
316
|
+
| 'shapeshifter'
|
|
317
|
+
| 'shapeshifter:inverted'
|
|
318
|
+
| 'solarized'
|
|
319
|
+
| 'summerfruit'
|
|
320
|
+
| 'summerfruit:inverted'
|
|
321
|
+
| 'threezerotwofour'
|
|
322
|
+
| 'tomorrow'
|
|
323
|
+
| 'tube'
|
|
324
|
+
| 'twilight'
|
|
336
325
|
|
|
337
|
-
declare const ReactJson: React.ComponentType<ReactJsonViewProps
|
|
338
|
-
export default ReactJson
|
|
326
|
+
declare const ReactJson: React.ComponentType<ReactJsonViewProps>
|
|
327
|
+
export default ReactJson
|