@uiw/react-json-view 1.8.3 → 1.8.5
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/cjs/arrow/TriangleArrow.d.ts +3 -0
- package/cjs/arrow/TriangleArrow.js +2 -1
- package/cjs/arrow/TriangleSolidArrow.d.ts +3 -0
- package/cjs/arrow/TriangleSolidArrow.js +2 -1
- package/cjs/comps/ellipsis.js +2 -1
- package/cjs/comps/meta.d.ts +3 -0
- package/cjs/comps/meta.js +2 -1
- package/cjs/copied.d.ts +3 -0
- package/cjs/copied.js +2 -1
- package/cjs/editor/countInfoExtra.d.ts +3 -0
- package/cjs/editor/countInfoExtra.js +2 -1
- package/cjs/editor/index.js +1 -0
- package/cjs/editor/objectKey.js +5 -4
- package/cjs/editor/value.d.ts +3 -0
- package/cjs/editor/value.js +3 -2
- package/cjs/index.js +2 -1
- package/cjs/node.d.ts +2 -2
- package/cjs/node.js +11 -27
- package/cjs/semicolon.js +2 -1
- package/cjs/value.d.ts +3 -0
- package/cjs/value.js +6 -1
- package/esm/arrow/TriangleArrow.d.ts +3 -0
- package/esm/arrow/TriangleArrow.js +2 -1
- package/esm/arrow/TriangleSolidArrow.d.ts +3 -0
- package/esm/arrow/TriangleSolidArrow.js +2 -1
- package/esm/comps/ellipsis.js +2 -1
- package/esm/comps/meta.d.ts +3 -0
- package/esm/comps/meta.js +2 -1
- package/esm/copied.d.ts +3 -0
- package/esm/copied.js +2 -1
- package/esm/editor/countInfoExtra.d.ts +3 -0
- package/esm/editor/countInfoExtra.js +2 -1
- package/esm/editor/index.js +1 -0
- package/esm/editor/objectKey.js +5 -4
- package/esm/editor/value.d.ts +3 -0
- package/esm/editor/value.js +3 -2
- package/esm/index.js +3 -2
- package/esm/node.d.ts +2 -2
- package/esm/node.js +10 -26
- package/esm/semicolon.js +2 -1
- package/esm/value.d.ts +3 -0
- package/esm/value.js +6 -1
- package/package.json +1 -1
|
@@ -2,3 +2,6 @@ import React from 'react';
|
|
|
2
2
|
export interface TriangleArrowProps extends React.SVGProps<SVGSVGElement> {
|
|
3
3
|
}
|
|
4
4
|
export declare function TriangleArrow(props: TriangleArrowProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare namespace TriangleArrow {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
@@ -2,3 +2,6 @@ import React from 'react';
|
|
|
2
2
|
export interface TriangleSolidArrowProps extends React.SVGProps<SVGSVGElement> {
|
|
3
3
|
}
|
|
4
4
|
export declare function TriangleSolidArrow(props: TriangleSolidArrowProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare namespace TriangleSolidArrow {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
package/cjs/comps/ellipsis.js
CHANGED
package/cjs/comps/meta.d.ts
CHANGED
|
@@ -7,3 +7,6 @@ export interface MetaProps extends LabelProps {
|
|
|
7
7
|
render?: (props: Pick<MetaProps, 'start' | 'level' | 'isArray' | 'className' | 'children'>) => JSX.Element;
|
|
8
8
|
}
|
|
9
9
|
export declare function Meta(props: MetaProps): JSX.Element;
|
|
10
|
+
export declare namespace Meta {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
package/cjs/comps/meta.js
CHANGED
package/cjs/copied.d.ts
CHANGED
|
@@ -6,3 +6,6 @@ export interface CopiedProps<T = object> extends React.SVGProps<SVGSVGElement> {
|
|
|
6
6
|
render?: (props: Omit<CopiedProps<T>, 'render'>) => JSX.Element;
|
|
7
7
|
}
|
|
8
8
|
export declare function Copied<T>(props: CopiedProps<T>): JSX.Element | null;
|
|
9
|
+
export declare namespace Copied {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
package/cjs/copied.js
CHANGED
|
@@ -74,4 +74,5 @@ function Copied(props) {
|
|
|
74
74
|
d: "M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"
|
|
75
75
|
})
|
|
76
76
|
}));
|
|
77
|
-
}
|
|
77
|
+
}
|
|
78
|
+
Copied.displayName = 'JVR.Copied';
|
|
@@ -23,3 +23,6 @@ export interface CountInfoExtraProps<T> extends Partial<CountInfoProps> {
|
|
|
23
23
|
}) => boolean;
|
|
24
24
|
}
|
|
25
25
|
export declare function CountInfoExtra<T extends object>(props: CountInfoExtraProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
export declare namespace CountInfoExtra {
|
|
27
|
+
var displayName: string;
|
|
28
|
+
}
|
package/cjs/editor/index.js
CHANGED
|
@@ -54,6 +54,7 @@ var JsonViewEditor = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
54
54
|
ref: ref
|
|
55
55
|
}));
|
|
56
56
|
});
|
|
57
|
+
JsonViewEditor.displayName = 'JVR.JsonViewEditor';
|
|
57
58
|
var _default = JsonViewEditor;
|
|
58
59
|
exports["default"] = _default;
|
|
59
60
|
module.exports = exports.default;
|
package/cjs/editor/objectKey.js
CHANGED
|
@@ -55,7 +55,7 @@ var ObjectKey = function ObjectKey(props) {
|
|
|
55
55
|
if ($edit.current) {
|
|
56
56
|
var _$edit$current;
|
|
57
57
|
$edit.current.contentEditable = 'true';
|
|
58
|
-
(_$edit$current = $edit.current) === null || _$edit$current === void 0
|
|
58
|
+
(_$edit$current = $edit.current) === null || _$edit$current === void 0 || _$edit$current.focus();
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
var blur = /*#__PURE__*/function () {
|
|
@@ -90,7 +90,7 @@ var ObjectKey = function ObjectKey(props) {
|
|
|
90
90
|
}
|
|
91
91
|
case 6:
|
|
92
92
|
$edit.current.contentEditable = 'false';
|
|
93
|
-
(_$edit$current2 = $edit.current) === null || _$edit$current2 === void 0
|
|
93
|
+
(_$edit$current2 = $edit.current) === null || _$edit$current2 === void 0 || _$edit$current2.focus();
|
|
94
94
|
case 8:
|
|
95
95
|
setEditable(false);
|
|
96
96
|
case 9:
|
|
@@ -107,7 +107,7 @@ var ObjectKey = function ObjectKey(props) {
|
|
|
107
107
|
if ($edit.current) {
|
|
108
108
|
var _$edit$current3;
|
|
109
109
|
$edit.current.contentEditable = 'true';
|
|
110
|
-
(_$edit$current3 = $edit.current) === null || _$edit$current3 === void 0
|
|
110
|
+
(_$edit$current3 = $edit.current) === null || _$edit$current3 === void 0 || _$edit$current3.focus();
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
var keyDown = function keyDown(evn) {
|
|
@@ -167,4 +167,5 @@ var ObjectKey = function ObjectKey(props) {
|
|
|
167
167
|
ref: $edit
|
|
168
168
|
}));
|
|
169
169
|
};
|
|
170
|
-
exports.ObjectKey = ObjectKey;
|
|
170
|
+
exports.ObjectKey = ObjectKey;
|
|
171
|
+
ObjectKey.displayName = 'JVR.ObjectKey';
|
package/cjs/editor/value.d.ts
CHANGED
|
@@ -17,3 +17,6 @@ export interface ReValueProps<T extends object> extends React.HTMLAttributes<HTM
|
|
|
17
17
|
onDelete?: JsonViewEditorProps<T>['onDelete'];
|
|
18
18
|
}
|
|
19
19
|
export declare function ReValue<T extends object>(props: ReValueProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare namespace ReValue {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
package/cjs/editor/value.js
CHANGED
|
@@ -67,7 +67,7 @@ function ReValue(props) {
|
|
|
67
67
|
var _$edit$current;
|
|
68
68
|
setEditable(true);
|
|
69
69
|
$edit.current.setAttribute('contentEditable', 'true');
|
|
70
|
-
(_$edit$current = $edit.current) === null || _$edit$current === void 0
|
|
70
|
+
(_$edit$current = $edit.current) === null || _$edit$current === void 0 || _$edit$current.focus();
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
var keyDown = function keyDown(evn) {
|
|
@@ -239,4 +239,5 @@ function ReValue(props) {
|
|
|
239
239
|
onClick: deleteHandle
|
|
240
240
|
})]
|
|
241
241
|
});
|
|
242
|
-
}
|
|
242
|
+
}
|
|
243
|
+
ReValue.displayName = 'JVR.ReValue';
|
package/cjs/index.js
CHANGED
|
@@ -49,7 +49,7 @@ var JsonView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
49
49
|
}, style);
|
|
50
50
|
var cls = "w-json-view-container w-rjv ".concat(className || '');
|
|
51
51
|
var keyid = (0, _react.useId)();
|
|
52
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_node.
|
|
52
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_node.RootNode, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
53
53
|
className: cls,
|
|
54
54
|
value: value
|
|
55
55
|
}, reset), {}, {
|
|
@@ -58,5 +58,6 @@ var JsonView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
58
58
|
style: defaultStyle
|
|
59
59
|
}));
|
|
60
60
|
});
|
|
61
|
+
JsonView.displayName = 'JVR.JsonView';
|
|
61
62
|
var _default = JsonView;
|
|
62
63
|
exports["default"] = _default;
|
package/cjs/node.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { FC, PropsWithChildren } from 'react';
|
|
|
2
2
|
import { LabelProps } from './value';
|
|
3
3
|
import { JsonViewProps } from './';
|
|
4
4
|
export declare const CountInfo: FC<PropsWithChildren<LabelProps>>;
|
|
5
|
-
export interface
|
|
5
|
+
export interface RootNodeProps<T extends object> extends JsonViewProps<T> {
|
|
6
6
|
keyName?: string | number;
|
|
7
7
|
keyid?: string;
|
|
8
8
|
level?: number;
|
|
@@ -10,4 +10,4 @@ export interface RooNodeProps<T extends object> extends JsonViewProps<T> {
|
|
|
10
10
|
namespace?: Array<string | number>;
|
|
11
11
|
setParentValue?: React.Dispatch<React.SetStateAction<T>>;
|
|
12
12
|
}
|
|
13
|
-
export declare
|
|
13
|
+
export declare const RootNode: import("react").ForwardRefExoticComponent<Omit<RootNodeProps<object>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
package/cjs/node.js
CHANGED
|
@@ -4,8 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.CountInfo = void 0;
|
|
8
|
-
exports.RooNode = RooNode;
|
|
7
|
+
exports.RootNode = exports.CountInfo = void 0;
|
|
9
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
@@ -41,7 +40,8 @@ var CountInfo = function CountInfo(_ref) {
|
|
|
41
40
|
});
|
|
42
41
|
};
|
|
43
42
|
exports.CountInfo = CountInfo;
|
|
44
|
-
|
|
43
|
+
CountInfo.displayName = 'JVR.CountInfo';
|
|
44
|
+
var RootNode = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
45
45
|
var _expands$keyid;
|
|
46
46
|
var _props$value = props.value,
|
|
47
47
|
value = _props$value === void 0 ? {} : _props$value,
|
|
@@ -195,7 +195,9 @@ function RooNode(props) {
|
|
|
195
195
|
setParentValue: setParentValue,
|
|
196
196
|
setValue: setValueData
|
|
197
197
|
});
|
|
198
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
198
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
199
|
+
ref: ref
|
|
200
|
+
}, reset), {}, {
|
|
199
201
|
className: "".concat(className, " w-rjv-inner")
|
|
200
202
|
}, eventProps), {}, {
|
|
201
203
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_value.Line, {
|
|
@@ -250,7 +252,7 @@ function RooNode(props) {
|
|
|
250
252
|
var label = isArray ? idx : key;
|
|
251
253
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_value.Line, {
|
|
252
254
|
className: "w-rjv-wrap",
|
|
253
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
255
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(RootNode, (0, _objectSpread2["default"])({
|
|
254
256
|
value: item,
|
|
255
257
|
namespace: [].concat((0, _toConsumableArray2["default"])(namespace), [label]),
|
|
256
258
|
keyName: label,
|
|
@@ -261,7 +263,7 @@ function RooNode(props) {
|
|
|
261
263
|
if ((0, _typeof2["default"])(item) === 'object' && item && !(item instanceof Date) && !isEmpty) {
|
|
262
264
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_value.Line, {
|
|
263
265
|
className: "w-rjv-wrap",
|
|
264
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
266
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(RootNode, (0, _objectSpread2["default"])({
|
|
265
267
|
value: item,
|
|
266
268
|
namespace: [].concat((0, _toConsumableArray2["default"])(namespace), [key]),
|
|
267
269
|
keyName: key,
|
|
@@ -294,26 +296,6 @@ function RooNode(props) {
|
|
|
294
296
|
visible: expand
|
|
295
297
|
}) || countInfo;
|
|
296
298
|
}
|
|
297
|
-
// if (length > -1) {
|
|
298
|
-
// countInfo = (
|
|
299
|
-
// <Fragment>
|
|
300
|
-
// {countInfo}
|
|
301
|
-
// {components.countInfoExtra &&
|
|
302
|
-
// components.countInfoExtra({
|
|
303
|
-
// count: length,
|
|
304
|
-
// level,
|
|
305
|
-
// showTools,
|
|
306
|
-
// keyName,
|
|
307
|
-
// visible: expand,
|
|
308
|
-
// value: valueData,
|
|
309
|
-
// namespace: [...namespace],
|
|
310
|
-
// parentValue,
|
|
311
|
-
// setParentValue,
|
|
312
|
-
// setValue: setValueData,
|
|
313
|
-
// })}
|
|
314
|
-
// </Fragment>
|
|
315
|
-
// )
|
|
316
|
-
// }
|
|
317
299
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_value.ValueView, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
318
300
|
components: components,
|
|
319
301
|
namespace: [].concat((0, _toConsumableArray2["default"])(namespace), [key])
|
|
@@ -339,4 +321,6 @@ function RooNode(props) {
|
|
|
339
321
|
})
|
|
340
322
|
})]
|
|
341
323
|
}));
|
|
342
|
-
}
|
|
324
|
+
});
|
|
325
|
+
exports.RootNode = RootNode;
|
|
326
|
+
RootNode.displayName = 'JVR.RootNode';
|
package/cjs/semicolon.js
CHANGED
package/cjs/value.d.ts
CHANGED
|
@@ -67,6 +67,9 @@ export declare function getValueString<T>(value: T): {
|
|
|
67
67
|
content: string;
|
|
68
68
|
};
|
|
69
69
|
export declare function ValueView<T extends object>(props: ValueViewProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
export declare namespace ValueView {
|
|
71
|
+
var displayName: string;
|
|
72
|
+
}
|
|
70
73
|
export interface LabelProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
71
74
|
color?: string;
|
|
72
75
|
fontSize?: number;
|
package/cjs/value.js
CHANGED
|
@@ -23,6 +23,7 @@ var Line = function Line(props) {
|
|
|
23
23
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", (0, _objectSpread2["default"])({}, props));
|
|
24
24
|
};
|
|
25
25
|
exports.Line = Line;
|
|
26
|
+
Line.displayName = 'JVR.Line';
|
|
26
27
|
var isFloat = function isFloat(n) {
|
|
27
28
|
return Number(n) === n && n % 1 !== 0 || isNaN(n);
|
|
28
29
|
};
|
|
@@ -85,6 +86,7 @@ var Colon = function Colon(_ref) {
|
|
|
85
86
|
}));
|
|
86
87
|
};
|
|
87
88
|
exports.Colon = Colon;
|
|
89
|
+
Colon.displayName = 'JVR.Colon';
|
|
88
90
|
function getValueString(value) {
|
|
89
91
|
var type = (0, _typeof2["default"])(value);
|
|
90
92
|
var content = '';
|
|
@@ -247,6 +249,7 @@ function ValueView(props) {
|
|
|
247
249
|
}))
|
|
248
250
|
}));
|
|
249
251
|
}
|
|
252
|
+
ValueView.displayName = 'JVR.ValueView';
|
|
250
253
|
var Label = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
251
254
|
var children = _ref2.children,
|
|
252
255
|
color = _ref2.color,
|
|
@@ -268,6 +271,7 @@ var Label = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
268
271
|
}));
|
|
269
272
|
});
|
|
270
273
|
exports.Label = Label;
|
|
274
|
+
Label.displayName = 'JVR.Label';
|
|
271
275
|
var Type = function Type(props) {
|
|
272
276
|
var _typeMap$type2, _typeMap$type3;
|
|
273
277
|
var type = props.type;
|
|
@@ -285,4 +289,5 @@ var Type = function Type(props) {
|
|
|
285
289
|
});
|
|
286
290
|
}
|
|
287
291
|
};
|
|
288
|
-
exports.Type = Type;
|
|
292
|
+
exports.Type = Type;
|
|
293
|
+
Type.displayName = 'JVR.Type';
|
|
@@ -2,3 +2,6 @@ import React from 'react';
|
|
|
2
2
|
export interface TriangleArrowProps extends React.SVGProps<SVGSVGElement> {
|
|
3
3
|
}
|
|
4
4
|
export declare function TriangleArrow(props: TriangleArrowProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare namespace TriangleArrow {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
@@ -2,3 +2,6 @@ import React from 'react';
|
|
|
2
2
|
export interface TriangleSolidArrowProps extends React.SVGProps<SVGSVGElement> {
|
|
3
3
|
}
|
|
4
4
|
export declare function TriangleSolidArrow(props: TriangleSolidArrowProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare namespace TriangleSolidArrow {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
package/esm/comps/ellipsis.js
CHANGED
package/esm/comps/meta.d.ts
CHANGED
|
@@ -7,3 +7,6 @@ export interface MetaProps extends LabelProps {
|
|
|
7
7
|
render?: (props: Pick<MetaProps, 'start' | 'level' | 'isArray' | 'className' | 'children'>) => JSX.Element;
|
|
8
8
|
}
|
|
9
9
|
export declare function Meta(props: MetaProps): JSX.Element;
|
|
10
|
+
export declare namespace Meta {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
package/esm/comps/meta.js
CHANGED
package/esm/copied.d.ts
CHANGED
|
@@ -6,3 +6,6 @@ export interface CopiedProps<T = object> extends React.SVGProps<SVGSVGElement> {
|
|
|
6
6
|
render?: (props: Omit<CopiedProps<T>, 'render'>) => JSX.Element;
|
|
7
7
|
}
|
|
8
8
|
export declare function Copied<T>(props: CopiedProps<T>): JSX.Element | null;
|
|
9
|
+
export declare namespace Copied {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
package/esm/copied.js
CHANGED
|
@@ -63,4 +63,5 @@ export function Copied(props) {
|
|
|
63
63
|
d: "M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"
|
|
64
64
|
})
|
|
65
65
|
}));
|
|
66
|
-
}
|
|
66
|
+
}
|
|
67
|
+
Copied.displayName = 'JVR.Copied';
|
|
@@ -23,3 +23,6 @@ export interface CountInfoExtraProps<T> extends Partial<CountInfoProps> {
|
|
|
23
23
|
}) => boolean;
|
|
24
24
|
}
|
|
25
25
|
export declare function CountInfoExtra<T extends object>(props: CountInfoExtraProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
export declare namespace CountInfoExtra {
|
|
27
|
+
var displayName: string;
|
|
28
|
+
}
|
package/esm/editor/index.js
CHANGED
package/esm/editor/objectKey.js
CHANGED
|
@@ -39,7 +39,7 @@ export var ObjectKey = props => {
|
|
|
39
39
|
if ($edit.current) {
|
|
40
40
|
var _$edit$current;
|
|
41
41
|
$edit.current.contentEditable = 'true';
|
|
42
|
-
(_$edit$current = $edit.current) == null
|
|
42
|
+
(_$edit$current = $edit.current) == null || _$edit$current.focus();
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
var blur = /*#__PURE__*/function () {
|
|
@@ -62,7 +62,7 @@ export var ObjectKey = props => {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
$edit.current.contentEditable = 'false';
|
|
65
|
-
(_$edit$current2 = $edit.current) == null
|
|
65
|
+
(_$edit$current2 = $edit.current) == null || _$edit$current2.focus();
|
|
66
66
|
}
|
|
67
67
|
setEditable(false);
|
|
68
68
|
});
|
|
@@ -74,7 +74,7 @@ export var ObjectKey = props => {
|
|
|
74
74
|
if ($edit.current) {
|
|
75
75
|
var _$edit$current3;
|
|
76
76
|
$edit.current.contentEditable = 'true';
|
|
77
|
-
(_$edit$current3 = $edit.current) == null
|
|
77
|
+
(_$edit$current3 = $edit.current) == null || _$edit$current3.focus();
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
var keyDown = evn => {
|
|
@@ -133,4 +133,5 @@ export var ObjectKey = props => {
|
|
|
133
133
|
}, spanProps, {
|
|
134
134
|
ref: $edit
|
|
135
135
|
}));
|
|
136
|
-
};
|
|
136
|
+
};
|
|
137
|
+
ObjectKey.displayName = 'JVR.ObjectKey';
|
package/esm/editor/value.d.ts
CHANGED
|
@@ -17,3 +17,6 @@ export interface ReValueProps<T extends object> extends React.HTMLAttributes<HTM
|
|
|
17
17
|
onDelete?: JsonViewEditorProps<T>['onDelete'];
|
|
18
18
|
}
|
|
19
19
|
export declare function ReValue<T extends object>(props: ReValueProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare namespace ReValue {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
package/esm/editor/value.js
CHANGED
|
@@ -51,7 +51,7 @@ export function ReValue(props) {
|
|
|
51
51
|
var _$edit$current;
|
|
52
52
|
setEditable(true);
|
|
53
53
|
$edit.current.setAttribute('contentEditable', 'true');
|
|
54
|
-
(_$edit$current = $edit.current) == null
|
|
54
|
+
(_$edit$current = $edit.current) == null || _$edit$current.focus();
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
var keyDown = evn => {
|
|
@@ -191,4 +191,5 @@ export function ReValue(props) {
|
|
|
191
191
|
onClick: deleteHandle
|
|
192
192
|
})]
|
|
193
193
|
});
|
|
194
|
-
}
|
|
194
|
+
}
|
|
195
|
+
ReValue.displayName = 'JVR.ReValue';
|
package/esm/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutP
|
|
|
3
3
|
var _excluded = ["value", "style", "className"];
|
|
4
4
|
import React, { useId } from 'react';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import { RootNode } from './node';
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
export * from './node';
|
|
9
9
|
export * from './value';
|
|
@@ -22,7 +22,7 @@ var JsonView = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22
22
|
}, style);
|
|
23
23
|
var cls = "w-json-view-container w-rjv " + (className || '');
|
|
24
24
|
var keyid = useId();
|
|
25
|
-
return /*#__PURE__*/_jsx(
|
|
25
|
+
return /*#__PURE__*/_jsx(RootNode, _extends({
|
|
26
26
|
className: cls,
|
|
27
27
|
value: value
|
|
28
28
|
}, reset, {
|
|
@@ -31,4 +31,5 @@ var JsonView = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
31
31
|
style: defaultStyle
|
|
32
32
|
}));
|
|
33
33
|
});
|
|
34
|
+
JsonView.displayName = 'JVR.JsonView';
|
|
34
35
|
export default JsonView;
|
package/esm/node.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { FC, PropsWithChildren } from 'react';
|
|
|
2
2
|
import { LabelProps } from './value';
|
|
3
3
|
import { JsonViewProps } from './';
|
|
4
4
|
export declare const CountInfo: FC<PropsWithChildren<LabelProps>>;
|
|
5
|
-
export interface
|
|
5
|
+
export interface RootNodeProps<T extends object> extends JsonViewProps<T> {
|
|
6
6
|
keyName?: string | number;
|
|
7
7
|
keyid?: string;
|
|
8
8
|
level?: number;
|
|
@@ -10,4 +10,4 @@ export interface RooNodeProps<T extends object> extends JsonViewProps<T> {
|
|
|
10
10
|
namespace?: Array<string | number>;
|
|
11
11
|
setParentValue?: React.Dispatch<React.SetStateAction<T>>;
|
|
12
12
|
}
|
|
13
|
-
export declare
|
|
13
|
+
export declare const RootNode: import("react").ForwardRefExoticComponent<Omit<RootNodeProps<object>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
package/esm/node.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["value", "keyName", "className", "displayDataTypes", "components", "displayObjectSize", "enableClipboard", "highlightUpdates", "objectSortKeys", "indentWidth", "collapsed", "level", "keyid", "quotes", "namespace", "onCopied", "onExpand", "parentValue", "setParentValue"];
|
|
4
|
-
import { Fragment, useId, cloneElement, useState, useEffect } from 'react';
|
|
4
|
+
import { Fragment, useId, cloneElement, useState, useEffect, forwardRef } from 'react';
|
|
5
5
|
import { ValueView, Colon, Label, Line, typeMap } from './value';
|
|
6
6
|
import { TriangleArrow } from './arrow/TriangleArrow';
|
|
7
7
|
import { useExpandsStatus, store } from './store';
|
|
@@ -32,7 +32,8 @@ export var CountInfo = _ref => {
|
|
|
32
32
|
children: [children, " items"]
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
CountInfo.displayName = 'JVR.CountInfo';
|
|
36
|
+
export var RootNode = /*#__PURE__*/forwardRef((props, ref) => {
|
|
36
37
|
var _expands$keyid;
|
|
37
38
|
var {
|
|
38
39
|
value = {},
|
|
@@ -156,7 +157,9 @@ export function RooNode(props) {
|
|
|
156
157
|
setParentValue,
|
|
157
158
|
setValue: setValueData
|
|
158
159
|
});
|
|
159
|
-
return /*#__PURE__*/_jsxs("div", _extends({
|
|
160
|
+
return /*#__PURE__*/_jsxs("div", _extends({
|
|
161
|
+
ref: ref
|
|
162
|
+
}, reset, {
|
|
160
163
|
className: className + " w-rjv-inner"
|
|
161
164
|
}, eventProps, {
|
|
162
165
|
children: [/*#__PURE__*/_jsxs(Line, {
|
|
@@ -209,7 +212,7 @@ export function RooNode(props) {
|
|
|
209
212
|
var label = isArray ? idx : key;
|
|
210
213
|
return /*#__PURE__*/_jsx(Line, {
|
|
211
214
|
className: "w-rjv-wrap",
|
|
212
|
-
children: /*#__PURE__*/_jsx(
|
|
215
|
+
children: /*#__PURE__*/_jsx(RootNode, _extends({
|
|
213
216
|
value: item,
|
|
214
217
|
namespace: [...namespace, label],
|
|
215
218
|
keyName: label,
|
|
@@ -220,7 +223,7 @@ export function RooNode(props) {
|
|
|
220
223
|
if (typeof item === 'object' && item && !(item instanceof Date) && !isEmpty) {
|
|
221
224
|
return /*#__PURE__*/_jsx(Line, {
|
|
222
225
|
className: "w-rjv-wrap",
|
|
223
|
-
children: /*#__PURE__*/_jsx(
|
|
226
|
+
children: /*#__PURE__*/_jsx(RootNode, _extends({
|
|
224
227
|
value: item,
|
|
225
228
|
namespace: [...namespace, key],
|
|
226
229
|
keyName: key,
|
|
@@ -253,26 +256,6 @@ export function RooNode(props) {
|
|
|
253
256
|
visible: expand
|
|
254
257
|
}) || countInfo;
|
|
255
258
|
}
|
|
256
|
-
// if (length > -1) {
|
|
257
|
-
// countInfo = (
|
|
258
|
-
// <Fragment>
|
|
259
|
-
// {countInfo}
|
|
260
|
-
// {components.countInfoExtra &&
|
|
261
|
-
// components.countInfoExtra({
|
|
262
|
-
// count: length,
|
|
263
|
-
// level,
|
|
264
|
-
// showTools,
|
|
265
|
-
// keyName,
|
|
266
|
-
// visible: expand,
|
|
267
|
-
// value: valueData,
|
|
268
|
-
// namespace: [...namespace],
|
|
269
|
-
// parentValue,
|
|
270
|
-
// setParentValue,
|
|
271
|
-
// setValue: setValueData,
|
|
272
|
-
// })}
|
|
273
|
-
// </Fragment>
|
|
274
|
-
// )
|
|
275
|
-
// }
|
|
276
259
|
return /*#__PURE__*/_jsx(ValueView, _extends({
|
|
277
260
|
components: components,
|
|
278
261
|
namespace: [...namespace, key]
|
|
@@ -298,4 +281,5 @@ export function RooNode(props) {
|
|
|
298
281
|
})
|
|
299
282
|
})]
|
|
300
283
|
}));
|
|
301
|
-
}
|
|
284
|
+
});
|
|
285
|
+
RootNode.displayName = 'JVR.RootNode';
|
package/esm/semicolon.js
CHANGED
package/esm/value.d.ts
CHANGED
|
@@ -67,6 +67,9 @@ export declare function getValueString<T>(value: T): {
|
|
|
67
67
|
content: string;
|
|
68
68
|
};
|
|
69
69
|
export declare function ValueView<T extends object>(props: ValueViewProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
export declare namespace ValueView {
|
|
71
|
+
var displayName: string;
|
|
72
|
+
}
|
|
70
73
|
export interface LabelProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
71
74
|
color?: string;
|
|
72
75
|
fontSize?: number;
|
package/esm/value.js
CHANGED
|
@@ -9,6 +9,7 @@ import { Copied } from './copied';
|
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
export var Line = props => /*#__PURE__*/_jsx("div", _extends({}, props));
|
|
12
|
+
Line.displayName = 'JVR.Line';
|
|
12
13
|
export var isFloat = n => Number(n) === n && n % 1 !== 0 || isNaN(n);
|
|
13
14
|
export var typeMap = {
|
|
14
15
|
string: {
|
|
@@ -67,6 +68,7 @@ export var Colon = _ref => {
|
|
|
67
68
|
children: children
|
|
68
69
|
}));
|
|
69
70
|
};
|
|
71
|
+
Colon.displayName = 'JVR.Colon';
|
|
70
72
|
export function getValueString(value) {
|
|
71
73
|
var type = typeof value;
|
|
72
74
|
var content = '';
|
|
@@ -220,6 +222,7 @@ export function ValueView(props) {
|
|
|
220
222
|
}))
|
|
221
223
|
}));
|
|
222
224
|
}
|
|
225
|
+
ValueView.displayName = 'JVR.ValueView';
|
|
223
226
|
export var Label = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
224
227
|
var {
|
|
225
228
|
children,
|
|
@@ -242,6 +245,7 @@ export var Label = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
242
245
|
children: children
|
|
243
246
|
}));
|
|
244
247
|
});
|
|
248
|
+
Label.displayName = 'JVR.Label';
|
|
245
249
|
export var Type = props => {
|
|
246
250
|
var _typeMap$type2, _typeMap$type3;
|
|
247
251
|
var {
|
|
@@ -260,4 +264,5 @@ export var Type = props => {
|
|
|
260
264
|
children: label
|
|
261
265
|
});
|
|
262
266
|
}
|
|
263
|
-
};
|
|
267
|
+
};
|
|
268
|
+
Type.displayName = 'JVR.Type';
|