@uiw/react-json-view 1.11.0 → 1.11.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 +1 -0
- package/cjs/editor/value.js +4 -1
- package/cjs/index.js +2 -1
- package/cjs/value.js +1 -4
- package/esm/editor/value.js +4 -1
- package/esm/index.js +2 -1
- package/esm/value.js +1 -4
- package/package.json +1 -1
package/README.md
CHANGED
package/cjs/editor/value.js
CHANGED
|
@@ -121,6 +121,9 @@ function ReValue(props) {
|
|
|
121
121
|
} else if (typeof text === 'string' && /^(null)$/gi.test(text)) {
|
|
122
122
|
text = null;
|
|
123
123
|
_typeStr = 'null';
|
|
124
|
+
} else if (typeof text === 'string' && /^(NaN)$/gi.test(text)) {
|
|
125
|
+
text = NaN;
|
|
126
|
+
_typeStr = 'NaN';
|
|
124
127
|
} else if (typeof text === 'string' && /^(undefined)$/gi.test(text)) {
|
|
125
128
|
text = undefined;
|
|
126
129
|
_typeStr = 'undefined';
|
|
@@ -183,7 +186,7 @@ function ReValue(props) {
|
|
|
183
186
|
var typeView = /*#__PURE__*/(0, _jsxRuntime.jsx)(_value.Type, {
|
|
184
187
|
type: typeStr
|
|
185
188
|
});
|
|
186
|
-
if (typeStr === 'null' || typeStr === 'undefined') {
|
|
189
|
+
if (typeStr === 'null' || typeStr === 'undefined' || type.toLocaleLowerCase() === 'nan') {
|
|
187
190
|
typeView = /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {});
|
|
188
191
|
}
|
|
189
192
|
var deleteHandle = function deleteHandle(_x) {
|
package/cjs/index.js
CHANGED
|
@@ -57,7 +57,8 @@ var JsonView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
57
57
|
lineHeight: 1.4,
|
|
58
58
|
fontFamily: 'var(--w-rjv-font-family, Menlo, monospace)',
|
|
59
59
|
color: 'var(--w-rjv-color, #002b36)',
|
|
60
|
-
backgroundColor: 'var(--w-rjv-background-color, #00000000)'
|
|
60
|
+
backgroundColor: 'var(--w-rjv-background-color, #00000000)',
|
|
61
|
+
fontSize: 13
|
|
61
62
|
}, style);
|
|
62
63
|
var cls = "w-json-view-container w-rjv ".concat(className || '');
|
|
63
64
|
var keyid = (0, _react.useId)();
|
package/cjs/value.js
CHANGED
|
@@ -218,13 +218,10 @@ function ValueView(props) {
|
|
|
218
218
|
fontWeight: 'bold'
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
|
-
if (value === undefined || type === '
|
|
221
|
+
if (value === undefined || type.toLocaleLowerCase() === 'nan' || !displayDataTypes) {
|
|
222
222
|
typeView = /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {});
|
|
223
223
|
}
|
|
224
224
|
var isURL = value instanceof URL;
|
|
225
|
-
if (!displayDataTypes) {
|
|
226
|
-
typeView = /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {});
|
|
227
|
-
}
|
|
228
225
|
color = ((_typeMap$type = typeMap[type]) === null || _typeMap$type === void 0 ? void 0 : _typeMap$type.color) || '';
|
|
229
226
|
var _useState3 = (0, _react.useState)(false),
|
|
230
227
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
package/esm/editor/value.js
CHANGED
|
@@ -93,6 +93,9 @@ export function ReValue(props) {
|
|
|
93
93
|
} else if (typeof text === 'string' && /^(null)$/gi.test(text)) {
|
|
94
94
|
text = null;
|
|
95
95
|
_typeStr = 'null';
|
|
96
|
+
} else if (typeof text === 'string' && /^(NaN)$/gi.test(text)) {
|
|
97
|
+
text = NaN;
|
|
98
|
+
_typeStr = 'NaN';
|
|
96
99
|
} else if (typeof text === 'string' && /^(undefined)$/gi.test(text)) {
|
|
97
100
|
text = undefined;
|
|
98
101
|
_typeStr = 'undefined';
|
|
@@ -149,7 +152,7 @@ export function ReValue(props) {
|
|
|
149
152
|
var typeView = /*#__PURE__*/_jsx(Type, {
|
|
150
153
|
type: typeStr
|
|
151
154
|
});
|
|
152
|
-
if (typeStr === 'null' || typeStr === 'undefined') {
|
|
155
|
+
if (typeStr === 'null' || typeStr === 'undefined' || type.toLocaleLowerCase() === 'nan') {
|
|
153
156
|
typeView = /*#__PURE__*/_jsx(Fragment, {});
|
|
154
157
|
}
|
|
155
158
|
var deleteHandle = function deleteHandle(_x) {
|
package/esm/index.js
CHANGED
|
@@ -19,7 +19,8 @@ var JsonView = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
19
19
|
lineHeight: 1.4,
|
|
20
20
|
fontFamily: 'var(--w-rjv-font-family, Menlo, monospace)',
|
|
21
21
|
color: 'var(--w-rjv-color, #002b36)',
|
|
22
|
-
backgroundColor: 'var(--w-rjv-background-color, #00000000)'
|
|
22
|
+
backgroundColor: 'var(--w-rjv-background-color, #00000000)',
|
|
23
|
+
fontSize: 13
|
|
23
24
|
}, style);
|
|
24
25
|
var cls = "w-json-view-container w-rjv " + (className || '');
|
|
25
26
|
var keyid = useId();
|
package/esm/value.js
CHANGED
|
@@ -201,13 +201,10 @@ export function ValueView(props) {
|
|
|
201
201
|
fontWeight: 'bold'
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
|
-
if (value === undefined || type === '
|
|
204
|
+
if (value === undefined || type.toLocaleLowerCase() === 'nan' || !displayDataTypes) {
|
|
205
205
|
typeView = /*#__PURE__*/_jsx(Fragment, {});
|
|
206
206
|
}
|
|
207
207
|
var isURL = value instanceof URL;
|
|
208
|
-
if (!displayDataTypes) {
|
|
209
|
-
typeView = /*#__PURE__*/_jsx(Fragment, {});
|
|
210
|
-
}
|
|
211
208
|
color = ((_typeMap$type = typeMap[type]) == null ? void 0 : _typeMap$type.color) || '';
|
|
212
209
|
var [showTools, setShowTools] = useState(false);
|
|
213
210
|
var tools = useMemo(() => enableClipboard && showTools && /*#__PURE__*/_jsx(Copied, {
|