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