@uiw/react-json-view 1.7.1 → 1.8.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 +18 -3
- package/cjs/editor/countInfoExtra.d.ts +9 -1
- package/cjs/editor/countInfoExtra.js +49 -7
- package/cjs/editor/icon/add.js +2 -2
- package/cjs/editor/icon/delete.d.ts +4 -0
- package/cjs/editor/icon/delete.js +30 -0
- package/cjs/editor/index.d.ts +6 -0
- package/cjs/editor/index.js +5 -2
- package/cjs/editor/objectKey.js +52 -20
- package/cjs/editor/value.d.ts +4 -0
- package/cjs/editor/value.js +42 -12
- package/cjs/node.d.ts +3 -0
- package/cjs/node.js +34 -16
- package/cjs/semicolon.d.ts +1 -0
- package/cjs/semicolon.js +3 -2
- package/cjs/value.d.ts +15 -7
- package/cjs/value.js +8 -2
- package/editor.d.ts +5 -0
- package/esm/editor/countInfoExtra.d.ts +9 -1
- package/esm/editor/countInfoExtra.js +36 -7
- package/esm/editor/icon/add.js +2 -2
- package/esm/editor/icon/delete.d.ts +4 -0
- package/esm/editor/icon/delete.js +24 -0
- package/esm/editor/index.d.ts +6 -0
- package/esm/editor/index.js +6 -3
- package/esm/editor/objectKey.js +34 -20
- package/esm/editor/value.d.ts +4 -0
- package/esm/editor/value.js +35 -12
- package/esm/node.d.ts +3 -0
- package/esm/node.js +26 -10
- package/esm/semicolon.d.ts +1 -0
- package/esm/semicolon.js +3 -2
- package/esm/value.d.ts +15 -7
- package/esm/value.js +8 -2
- package/package.json +1 -1
package/esm/editor/value.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
4
|
-
var _excluded = ["type", "value", "keyName", "visible", "quotes", "style", "children", "displayDataTypes", "editableValue", "onEdit"];
|
|
4
|
+
var _excluded = ["type", "value", "setValue", "data", "keyName", "visible", "quotes", "style", "children", "namespace", "displayDataTypes", "editableValue", "onDelete", "onEdit"];
|
|
5
5
|
import { Fragment, useEffect, useRef, useState } from 'react';
|
|
6
6
|
import { getValueString, isFloat, Type, typeMap } from '../value';
|
|
7
7
|
import { EditIcon } from './icon/edit';
|
|
8
|
+
import { DeleteIcon } from './icon/delete';
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
11
|
var Quotes = _ref => {
|
|
@@ -24,11 +25,16 @@ export function ReValue(props) {
|
|
|
24
25
|
var {
|
|
25
26
|
type,
|
|
26
27
|
value,
|
|
28
|
+
setValue,
|
|
29
|
+
data,
|
|
30
|
+
keyName,
|
|
27
31
|
visible,
|
|
28
32
|
quotes,
|
|
29
33
|
style,
|
|
34
|
+
namespace,
|
|
30
35
|
displayDataTypes,
|
|
31
36
|
editableValue,
|
|
37
|
+
onDelete,
|
|
32
38
|
onEdit
|
|
33
39
|
} = props,
|
|
34
40
|
reset = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -43,7 +49,7 @@ export function ReValue(props) {
|
|
|
43
49
|
if ($edit.current) {
|
|
44
50
|
var _$edit$current;
|
|
45
51
|
setEditable(true);
|
|
46
|
-
$edit.current.contentEditable
|
|
52
|
+
$edit.current.setAttribute('contentEditable', 'true');
|
|
47
53
|
(_$edit$current = $edit.current) == null ? void 0 : _$edit$current.focus();
|
|
48
54
|
}
|
|
49
55
|
};
|
|
@@ -53,7 +59,9 @@ export function ReValue(props) {
|
|
|
53
59
|
evn.stopPropagation();
|
|
54
60
|
evn.preventDefault();
|
|
55
61
|
setEditable(false);
|
|
56
|
-
$edit.current
|
|
62
|
+
if ($edit.current) {
|
|
63
|
+
$edit.current.setAttribute('contentEditable', 'false');
|
|
64
|
+
}
|
|
57
65
|
}
|
|
58
66
|
};
|
|
59
67
|
var blur = /*#__PURE__*/function () {
|
|
@@ -61,8 +69,8 @@ export function ReValue(props) {
|
|
|
61
69
|
if (!editableValue) return;
|
|
62
70
|
setEditable(false);
|
|
63
71
|
if ($edit.current) {
|
|
64
|
-
$edit.current.contentEditable
|
|
65
|
-
var text = $edit.current.
|
|
72
|
+
$edit.current.setAttribute('contentEditable', 'false');
|
|
73
|
+
var text = $edit.current.innerHTML;
|
|
66
74
|
var _typeStr = curentType;
|
|
67
75
|
if (curentType === 'number' || curentType === 'float') {
|
|
68
76
|
text = Number(text);
|
|
@@ -75,16 +83,16 @@ export function ReValue(props) {
|
|
|
75
83
|
if (Number.isNaN(text)) {
|
|
76
84
|
_typeStr = 'number';
|
|
77
85
|
}
|
|
78
|
-
if (typeof text === 'string' && /^(true|false)$/
|
|
79
|
-
text = /^(true)$/
|
|
86
|
+
if (typeof text === 'string' && /^(true|false)$/gi.test(text)) {
|
|
87
|
+
text = /^(true)$/gi.test(text) ? true : false;
|
|
80
88
|
_typeStr = 'boolean';
|
|
81
|
-
} else if (typeof text === 'string' && /^[\d]+n$/
|
|
82
|
-
text = BigInt(text.replace(/n$/
|
|
89
|
+
} else if (typeof text === 'string' && /^[\d]+n$/gi.test(text)) {
|
|
90
|
+
text = BigInt(text.replace(/n$/gi, ''));
|
|
83
91
|
_typeStr = 'bigint';
|
|
84
|
-
} else if (typeof text === 'string' && /^(null)$/
|
|
92
|
+
} else if (typeof text === 'string' && /^(null)$/gi.test(text)) {
|
|
85
93
|
text = null;
|
|
86
94
|
_typeStr = 'null';
|
|
87
|
-
} else if (typeof text === 'string' && /^(undefined)$/
|
|
95
|
+
} else if (typeof text === 'string' && /^(undefined)$/gi.test(text)) {
|
|
88
96
|
text = undefined;
|
|
89
97
|
_typeStr = 'undefined';
|
|
90
98
|
} else if (typeof text === 'string') {
|
|
@@ -100,7 +108,8 @@ export function ReValue(props) {
|
|
|
100
108
|
var result = yield onEdit({
|
|
101
109
|
type: 'value',
|
|
102
110
|
value: text,
|
|
103
|
-
oldValue: curentChild
|
|
111
|
+
oldValue: curentChild,
|
|
112
|
+
namespace
|
|
104
113
|
});
|
|
105
114
|
if (result) {
|
|
106
115
|
setCurentType(_typeStr);
|
|
@@ -145,6 +154,18 @@ export function ReValue(props) {
|
|
|
145
154
|
if (typeStr === 'null' || typeStr === 'undefined') {
|
|
146
155
|
typeView = /*#__PURE__*/_jsx(Fragment, {});
|
|
147
156
|
}
|
|
157
|
+
var deleteHandle = /*#__PURE__*/function () {
|
|
158
|
+
var _ref3 = _asyncToGenerator(function* (evn) {
|
|
159
|
+
evn.stopPropagation();
|
|
160
|
+
if (data && keyName && keyName in data && setValue) {
|
|
161
|
+
delete data[keyName];
|
|
162
|
+
setValue(_extends({}, data));
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
return function deleteHandle(_x) {
|
|
166
|
+
return _ref3.apply(this, arguments);
|
|
167
|
+
};
|
|
168
|
+
}();
|
|
148
169
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
149
170
|
children: [displayDataTypes && typeView, /*#__PURE__*/_jsx(Quotes, {
|
|
150
171
|
style: style,
|
|
@@ -160,6 +181,8 @@ export function ReValue(props) {
|
|
|
160
181
|
show: typeStr === 'string'
|
|
161
182
|
}), visible && editableValue && onEdit && /*#__PURE__*/_jsx(EditIcon, {
|
|
162
183
|
onClick: click
|
|
184
|
+
}), visible && editableValue && onDelete && /*#__PURE__*/_jsx(DeleteIcon, {
|
|
185
|
+
onClick: deleteHandle
|
|
163
186
|
})]
|
|
164
187
|
});
|
|
165
188
|
}
|
package/esm/node.d.ts
CHANGED
|
@@ -6,5 +6,8 @@ export interface RooNodeProps<T extends object> extends JsonViewProps<T> {
|
|
|
6
6
|
keyName?: string | number;
|
|
7
7
|
keyid?: string;
|
|
8
8
|
level?: number;
|
|
9
|
+
parentValue?: T;
|
|
10
|
+
namespace?: Array<string | number>;
|
|
11
|
+
setParentValue?: React.Dispatch<React.SetStateAction<T>>;
|
|
9
12
|
}
|
|
10
13
|
export declare function RooNode<T extends object>(props: RooNodeProps<T>): import("react/jsx-runtime").JSX.Element;
|
package/esm/node.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["value", "keyName", "className", "displayDataTypes", "components", "displayObjectSize", "enableClipboard", "highlightUpdates", "objectSortKeys", "indentWidth", "collapsed", "level", "keyid", "quotes", "onCopied", "onExpand"];
|
|
3
|
+
var _excluded = ["value", "keyName", "className", "displayDataTypes", "components", "displayObjectSize", "enableClipboard", "highlightUpdates", "objectSortKeys", "indentWidth", "collapsed", "level", "keyid", "quotes", "namespace", "onCopied", "onExpand", "parentValue", "setParentValue"];
|
|
4
4
|
import { Fragment, useId, cloneElement, useState, useEffect } from 'react';
|
|
5
5
|
import { ValueView, Colon, Label, Line, typeMap } from './value';
|
|
6
6
|
import { TriangleArrow } from './arrow/TriangleArrow';
|
|
@@ -42,18 +42,17 @@ export function RooNode(props) {
|
|
|
42
42
|
level = 1,
|
|
43
43
|
keyid = 'root',
|
|
44
44
|
quotes = '"',
|
|
45
|
+
namespace = [],
|
|
45
46
|
onCopied,
|
|
46
|
-
onExpand
|
|
47
|
+
onExpand,
|
|
48
|
+
parentValue,
|
|
49
|
+
setParentValue
|
|
47
50
|
} = props,
|
|
48
51
|
reset = _objectWithoutPropertiesLoose(props, _excluded);
|
|
49
52
|
var isArray = Array.isArray(value);
|
|
50
53
|
var subkeyid = useId();
|
|
51
54
|
var expands = useExpandsStatus();
|
|
52
55
|
var expand = (_expands$keyid = expands[keyid]) != null ? _expands$keyid : typeof collapsed === 'boolean' ? collapsed : typeof collapsed === 'number' ? level <= collapsed : true;
|
|
53
|
-
var arrowStyle = {
|
|
54
|
-
transform: "rotate(" + (expand ? '0' : '-90') + "deg)",
|
|
55
|
-
transition: 'all 0.3s'
|
|
56
|
-
};
|
|
57
56
|
var handle = () => {
|
|
58
57
|
onExpand && typeof onExpand === 'function' && onExpand({
|
|
59
58
|
expand: !expand,
|
|
@@ -63,6 +62,7 @@ export function RooNode(props) {
|
|
|
63
62
|
});
|
|
64
63
|
!expand ? store.expand(keyid) : store.collapse(keyid);
|
|
65
64
|
};
|
|
65
|
+
var [valueData, setValueData] = useState(value);
|
|
66
66
|
var subNodeProps = {
|
|
67
67
|
components,
|
|
68
68
|
indentWidth,
|
|
@@ -73,6 +73,8 @@ export function RooNode(props) {
|
|
|
73
73
|
onCopied,
|
|
74
74
|
onExpand,
|
|
75
75
|
collapsed,
|
|
76
|
+
parentValue: value,
|
|
77
|
+
setParentValue: setValueData,
|
|
76
78
|
quotes,
|
|
77
79
|
level: level + 1,
|
|
78
80
|
style: {
|
|
@@ -84,14 +86,20 @@ export function RooNode(props) {
|
|
|
84
86
|
displayObjectSize,
|
|
85
87
|
enableClipboard,
|
|
86
88
|
indentWidth,
|
|
89
|
+
data: valueData,
|
|
87
90
|
quotes,
|
|
91
|
+
setValue: setValueData,
|
|
88
92
|
renderBraces: components.braces,
|
|
89
93
|
renderValue: components.value
|
|
90
94
|
};
|
|
95
|
+
var arrowStyle = {
|
|
96
|
+
transform: "rotate(" + (expand ? '0' : '-90') + "deg)",
|
|
97
|
+
transition: 'all 0.3s'
|
|
98
|
+
};
|
|
91
99
|
var arrowView = components.arrow ? /*#__PURE__*/cloneElement(components.arrow, {
|
|
92
100
|
style: arrowStyle,
|
|
93
101
|
'data-expand': expand,
|
|
94
|
-
className:
|
|
102
|
+
className: 'w-rjv-arrow'
|
|
95
103
|
}) : /*#__PURE__*/_jsx(TriangleArrow, {
|
|
96
104
|
style: arrowStyle,
|
|
97
105
|
className: "w-rjv-arrow"
|
|
@@ -102,7 +110,6 @@ export function RooNode(props) {
|
|
|
102
110
|
eventProps.onMouseEnter = () => setShowTools(true);
|
|
103
111
|
eventProps.onMouseLeave = () => setShowTools(false);
|
|
104
112
|
}
|
|
105
|
-
var [valueData, setValueData] = useState(value);
|
|
106
113
|
useEffect(() => setValueData(value), [value]);
|
|
107
114
|
var nameKeys = isArray ? Object.keys(valueData).map(m => Number(m)) : Object.keys(valueData);
|
|
108
115
|
|
|
@@ -143,6 +150,7 @@ export function RooNode(props) {
|
|
|
143
150
|
value: valueData,
|
|
144
151
|
quotes: quotes,
|
|
145
152
|
"data-keys": keyid,
|
|
153
|
+
namespace: [...namespace],
|
|
146
154
|
render: components.objectKey,
|
|
147
155
|
keyName: keyName,
|
|
148
156
|
parentName: keyName,
|
|
@@ -165,8 +173,11 @@ export function RooNode(props) {
|
|
|
165
173
|
count: nameKeys.length,
|
|
166
174
|
level,
|
|
167
175
|
showTools,
|
|
176
|
+
keyName,
|
|
168
177
|
visible: expand,
|
|
169
178
|
value: valueData,
|
|
179
|
+
parentValue,
|
|
180
|
+
setParentValue,
|
|
170
181
|
setValue: setValueData
|
|
171
182
|
}), enableClipboard && /*#__PURE__*/_jsx(Copied, {
|
|
172
183
|
show: showTools,
|
|
@@ -180,13 +191,14 @@ export function RooNode(props) {
|
|
|
180
191
|
borderLeft: 'var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)',
|
|
181
192
|
marginLeft: 6
|
|
182
193
|
},
|
|
183
|
-
children: entries.length > 0 && entries.map((_ref6, idx) => {
|
|
194
|
+
children: entries.length > 0 && [...entries].map((_ref6, idx) => {
|
|
184
195
|
var [key, itemVal] = _ref6;
|
|
185
196
|
var item = itemVal;
|
|
186
197
|
var renderKey = /*#__PURE__*/_jsx(Semicolon, {
|
|
187
198
|
value: item,
|
|
188
199
|
"data-keys": keyid,
|
|
189
200
|
quotes: quotes,
|
|
201
|
+
namespace: [...namespace, key],
|
|
190
202
|
parentName: keyName,
|
|
191
203
|
highlightUpdates: highlightUpdates,
|
|
192
204
|
render: components.objectKey,
|
|
@@ -200,6 +212,7 @@ export function RooNode(props) {
|
|
|
200
212
|
className: "w-rjv-wrap",
|
|
201
213
|
children: /*#__PURE__*/_jsx(RooNode, _extends({
|
|
202
214
|
value: item,
|
|
215
|
+
namespace: [...namespace, label],
|
|
203
216
|
keyName: label,
|
|
204
217
|
keyid: keyid + subkeyid + label
|
|
205
218
|
}, subNodeProps))
|
|
@@ -210,6 +223,7 @@ export function RooNode(props) {
|
|
|
210
223
|
className: "w-rjv-wrap",
|
|
211
224
|
children: /*#__PURE__*/_jsx(RooNode, _extends({
|
|
212
225
|
value: item,
|
|
226
|
+
namespace: [...namespace, key],
|
|
213
227
|
keyName: key,
|
|
214
228
|
keyid: keyid + subkeyid + key
|
|
215
229
|
}, subNodeProps))
|
|
@@ -218,7 +232,9 @@ export function RooNode(props) {
|
|
|
218
232
|
if (typeof item === 'function') {
|
|
219
233
|
return;
|
|
220
234
|
}
|
|
221
|
-
return /*#__PURE__*/_jsx(ValueView, _extends({
|
|
235
|
+
return /*#__PURE__*/_jsx(ValueView, _extends({
|
|
236
|
+
namespace: [...namespace, key]
|
|
237
|
+
}, valueViewProps, {
|
|
222
238
|
renderKey: renderKey,
|
|
223
239
|
keyName: key,
|
|
224
240
|
value: item
|
package/esm/semicolon.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export interface SemicolonProps extends LabelProps {
|
|
|
15
15
|
quotes?: JsonViewProps<object>['quotes'];
|
|
16
16
|
value?: object;
|
|
17
17
|
label?: string;
|
|
18
|
+
namespace?: Array<string | number>;
|
|
18
19
|
render?: (props: SemicolonProps) => React.ReactNode;
|
|
19
20
|
}
|
|
20
21
|
export declare const Semicolon: FC<PropsWithChildren<SemicolonProps>>;
|
package/esm/semicolon.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["children", "render", "color", "value", "className", "keyName", "highlightUpdates", "quotes", "style", "parentName"];
|
|
3
|
+
var _excluded = ["children", "render", "color", "value", "className", "keyName", "highlightUpdates", "quotes", "style", "namespace", "parentName"];
|
|
4
4
|
import { useMemo, useRef, useEffect } from 'react';
|
|
5
5
|
import { Label } from './value';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -68,6 +68,7 @@ export var Semicolon = _ref2 => {
|
|
|
68
68
|
highlightUpdates,
|
|
69
69
|
quotes,
|
|
70
70
|
style,
|
|
71
|
+
namespace,
|
|
71
72
|
parentName
|
|
72
73
|
} = _ref2,
|
|
73
74
|
props = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
@@ -78,6 +79,7 @@ export var Semicolon = _ref2 => {
|
|
|
78
79
|
className
|
|
79
80
|
}, props, {
|
|
80
81
|
value,
|
|
82
|
+
namespace,
|
|
81
83
|
style: _extends({}, style, {
|
|
82
84
|
color
|
|
83
85
|
}),
|
|
@@ -88,7 +90,6 @@ export var Semicolon = _ref2 => {
|
|
|
88
90
|
children: content
|
|
89
91
|
}));
|
|
90
92
|
}
|
|
91
|
-
;
|
|
92
93
|
useHighlight({
|
|
93
94
|
value,
|
|
94
95
|
highlightUpdates,
|
package/esm/value.d.ts
CHANGED
|
@@ -46,24 +46,31 @@ export declare const typeMap: {
|
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
export declare const Colon: FC<PropsWithChildren<React.HTMLAttributes<HTMLSpanElement>>>;
|
|
49
|
+
interface RenderValueProps<T extends object> extends React.HTMLAttributes<HTMLSpanElement> {
|
|
50
|
+
type: TypeProps['type'];
|
|
51
|
+
value?: unknown;
|
|
52
|
+
data?: T;
|
|
53
|
+
visible?: boolean;
|
|
54
|
+
quotes?: JsonViewProps<T>['quotes'];
|
|
55
|
+
namespace?: Array<string | number>;
|
|
56
|
+
setValue?: React.Dispatch<React.SetStateAction<T>>;
|
|
57
|
+
keyName?: ValueViewProps<T>['keyName'];
|
|
58
|
+
}
|
|
49
59
|
export interface ValueViewProps<T extends object> extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> {
|
|
50
60
|
keyName?: string | number;
|
|
51
61
|
value?: unknown;
|
|
62
|
+
data?: T;
|
|
52
63
|
displayDataTypes: boolean;
|
|
53
64
|
displayObjectSize: boolean;
|
|
54
65
|
enableClipboard: boolean;
|
|
55
66
|
indentWidth: number;
|
|
56
67
|
level?: number;
|
|
68
|
+
namespace?: Array<string | number>;
|
|
57
69
|
quotes?: JsonViewProps<T>['quotes'];
|
|
58
70
|
renderKey?: JSX.Element;
|
|
59
71
|
renderBraces?: MetaProps['render'];
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
value?: unknown;
|
|
63
|
-
visible?: boolean;
|
|
64
|
-
quotes?: JsonViewProps<T>['quotes'];
|
|
65
|
-
keyName?: ValueViewProps<T>['keyName'];
|
|
66
|
-
}) => JSX.Element;
|
|
72
|
+
setValue?: React.Dispatch<React.SetStateAction<T>>;
|
|
73
|
+
renderValue?: (props: RenderValueProps<T>) => JSX.Element;
|
|
67
74
|
}
|
|
68
75
|
export declare function getValueString<T>(value: T): {
|
|
69
76
|
type: "string" | "number" | "bigint" | "boolean" | "undefined" | "date" | "url" | "float" | "null" | "NaN";
|
|
@@ -81,3 +88,4 @@ export interface TypeProps extends React.DetailedHTMLProps<React.HTMLAttributes<
|
|
|
81
88
|
type: keyof typeof typeMap;
|
|
82
89
|
}
|
|
83
90
|
export declare const Type: FC<PropsWithChildren<TypeProps>>;
|
|
91
|
+
export {};
|
package/esm/value.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
var _excluded = ["children", "style"],
|
|
4
|
-
_excluded2 = ["value", "keyName", "indentWidth", "renderKey", "quotes", "level", "renderValue", "renderBraces", "enableClipboard", "displayObjectSize", "displayDataTypes"],
|
|
4
|
+
_excluded2 = ["value", "setValue", "data", "keyName", "indentWidth", "namespace", "renderKey", "quotes", "level", "renderValue", "renderBraces", "enableClipboard", "displayObjectSize", "displayDataTypes"],
|
|
5
5
|
_excluded3 = ["children", "color", "fontSize", "opacity", "paddingRight", "style"];
|
|
6
6
|
import { Fragment, forwardRef, useState } from 'react';
|
|
7
7
|
import { CountInfo } from './node';
|
|
@@ -38,7 +38,7 @@ export var typeMap = {
|
|
|
38
38
|
},
|
|
39
39
|
url: {
|
|
40
40
|
color: 'var(--w-rjv-type-url-color, #0969da)',
|
|
41
|
-
label: '
|
|
41
|
+
label: 'url'
|
|
42
42
|
},
|
|
43
43
|
null: {
|
|
44
44
|
color: 'var(--w-rjv-type-null-color, #d33682)',
|
|
@@ -112,8 +112,11 @@ export function ValueView(props) {
|
|
|
112
112
|
var _typeMap$type;
|
|
113
113
|
var {
|
|
114
114
|
value,
|
|
115
|
+
setValue,
|
|
116
|
+
data,
|
|
115
117
|
keyName,
|
|
116
118
|
indentWidth,
|
|
119
|
+
namespace,
|
|
117
120
|
renderKey,
|
|
118
121
|
quotes,
|
|
119
122
|
renderValue,
|
|
@@ -169,8 +172,11 @@ export function ValueView(props) {
|
|
|
169
172
|
}, style),
|
|
170
173
|
type,
|
|
171
174
|
value,
|
|
175
|
+
setValue,
|
|
176
|
+
data,
|
|
172
177
|
quotes,
|
|
173
178
|
keyName,
|
|
179
|
+
namespace,
|
|
174
180
|
visible: showTools,
|
|
175
181
|
content,
|
|
176
182
|
children: content
|