@uiw/react-json-view 2.0.0-alpha.30 → 2.0.0-alpha.32
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 +13 -12
- package/cjs/comps/Copied.js +1 -1
- package/cjs/comps/KeyValues.js +4 -4
- package/cjs/comps/NestedClose.js +1 -1
- package/cjs/comps/NestedOpen.js +2 -2
- package/cjs/comps/Value.js +1 -1
- package/cjs/index.d.ts +3 -1
- package/cjs/index.js +4 -2
- package/cjs/store.d.ts +1 -0
- package/cjs/types/index.js +43 -40
- package/esm/Container.js +5 -5
- package/esm/comps/Copied.js +4 -4
- package/esm/comps/KeyValues.js +11 -11
- package/esm/comps/NestedClose.js +3 -3
- package/esm/comps/NestedOpen.js +9 -9
- package/esm/comps/Value.js +1 -1
- package/esm/editor/KeyName.js +1 -1
- package/esm/editor/index.js +3 -3
- package/esm/index.d.ts +3 -1
- package/esm/index.js +38 -36
- package/esm/section/Copied.js +2 -2
- package/esm/section/CountInfo.js +3 -3
- package/esm/section/CountInfoExtra.js +2 -2
- package/esm/section/Ellipsis.js +2 -2
- package/esm/section/KeyName.js +2 -2
- package/esm/section/Row.js +2 -2
- package/esm/store/Symbols.js +1 -1
- package/esm/store.d.ts +1 -0
- package/esm/store.js +5 -5
- package/esm/symbol/Arrow.js +2 -2
- package/esm/symbol/BraceLeft.js +2 -2
- package/esm/symbol/BraceRight.js +2 -2
- package/esm/symbol/BracketsLeft.js +2 -2
- package/esm/symbol/BracketsRight.js +2 -2
- package/esm/symbol/Colon.js +2 -2
- package/esm/symbol/Quote.js +2 -2
- package/esm/symbol/ValueQuote.js +2 -2
- package/esm/symbol/index.js +2 -2
- package/esm/types/Bigint.js +2 -2
- package/esm/types/Date.js +2 -2
- package/esm/types/False.js +2 -2
- package/esm/types/Float.js +2 -2
- package/esm/types/Int.js +2 -2
- package/esm/types/Map.js +2 -2
- package/esm/types/Nan.js +2 -2
- package/esm/types/Null.js +2 -2
- package/esm/types/Set.js +2 -2
- package/esm/types/String.js +2 -2
- package/esm/types/True.js +2 -2
- package/esm/types/Undefined.js +2 -2
- package/esm/types/Url.js +2 -2
- package/esm/types/index.js +24 -22
- package/esm/utils/useRender.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,20 +19,19 @@ A React component for displaying and editing javascript arrays and JSON objects.
|
|
|
19
19
|
|
|
20
20
|
## Features
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
🎨
|
|
24
|
-
🌒
|
|
25
|
-
📦 Zero
|
|
26
|
-
📋
|
|
27
|
-
✏️
|
|
28
|
-
♻️
|
|
22
|
+
🚀 **Improved with TypeScript** – Better code hints for a smoother development experience.
|
|
23
|
+
🎨 **Customizable Themes** – Supports theme customization & [`online editing`](https://uiwjs.github.io/react-json-view/#online-editing-theme).
|
|
24
|
+
🌒 **Dark/Light Mode** – Seamless switching between themes.
|
|
25
|
+
📦 **Zero Dependencies** – Lightweight and efficient.
|
|
26
|
+
📋 **Clipboard Support** – Easily copy JSON data.
|
|
27
|
+
✏️ **Editable & Extendable** – Supports editing and adding new properties.
|
|
28
|
+
♻️ **Update Highlighting** – Option to highlight changes.
|
|
29
29
|
|
|
30
|
-
The
|
|
31
|
-
|
|
32
|
-
- [x] Complete all features of displaying JSON in v1.
|
|
33
|
-
- [ ] Add editing functionality to v2.
|
|
34
|
-
- [x] Add test cases to v2.
|
|
30
|
+
The latest version [**v2**](https://uiwjs.github.io/react-json-view/) features a redesigned API for better maintainability, a more flexible component customization system, and fully customizable rendering, making it more aligned with React’s component model. 📖 Check out the [v2 documentation](https://uiwjs.github.io/react-json-view/) and [examples](https://uiwjs.github.io/react-json-view/).
|
|
35
31
|
|
|
32
|
+
- [x] Fully implemented all v1 JSON display features.
|
|
33
|
+
- [ ] Adding editing functionality to v2.
|
|
34
|
+
- [x] Added comprehensive test cases for v2.
|
|
36
35
|
|
|
37
36
|
## Quick Start
|
|
38
37
|
|
|
@@ -888,6 +887,8 @@ export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps
|
|
|
888
887
|
highlightUpdates?: boolean;
|
|
889
888
|
/** Shorten long JSON strings, Set to `0` to disable this feature @default 30 */
|
|
890
889
|
shortenTextAfterLength?: number;
|
|
890
|
+
/** When the text exceeds the length, `...` will be displayed. Currently, this `...` can be customized. @default "..." */
|
|
891
|
+
stringEllipsis?: number;
|
|
891
892
|
/** Callback function for when a treeNode is expanded or collapsed */
|
|
892
893
|
onExpand?: (props: { expand: boolean; value?: T; keyid: string; keyName?: string | number }) => void;
|
|
893
894
|
/** Fires event when you copy */
|
package/cjs/comps/Copied.js
CHANGED
|
@@ -12,7 +12,7 @@ var _react = require("react");
|
|
|
12
12
|
var _store = require("../store");
|
|
13
13
|
var _Section = require("../store/Section");
|
|
14
14
|
var _ShowTools = require("../store/ShowTools");
|
|
15
|
-
var _types = require("../types");
|
|
15
|
+
var _types = require("../types/");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
var _excluded = ["keyName", "value", "parentValue", "expandKey", "keys"],
|
|
18
18
|
_excluded2 = ["as", "render"];
|
package/cjs/comps/KeyValues.js
CHANGED
|
@@ -18,7 +18,7 @@ var _Value = require("./Value");
|
|
|
18
18
|
var _KeyName = require("../section/KeyName");
|
|
19
19
|
var _Row = require("../section/Row");
|
|
20
20
|
var _Container = require("../Container");
|
|
21
|
-
var _symbol = require("../symbol");
|
|
21
|
+
var _symbol = require("../symbol/");
|
|
22
22
|
var _useHighlight = require("../utils/useHighlight");
|
|
23
23
|
var _Copied = require("../comps/Copied");
|
|
24
24
|
var _useIdCompat = require("../comps/useIdCompat");
|
|
@@ -80,9 +80,9 @@ var KeyValues = exports.KeyValues = function KeyValues(props) {
|
|
|
80
80
|
className: "w-rjv-wrap",
|
|
81
81
|
style: style,
|
|
82
82
|
children: entries.map(function (_ref9, idx) {
|
|
83
|
-
var
|
|
84
|
-
key =
|
|
85
|
-
val =
|
|
83
|
+
var _ref0 = (0, _slicedToArray2["default"])(_ref9, 2),
|
|
84
|
+
key = _ref0[0],
|
|
85
|
+
val = _ref0[1];
|
|
86
86
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(KeyValuesItem, {
|
|
87
87
|
parentValue: value,
|
|
88
88
|
keyName: key,
|
package/cjs/comps/NestedClose.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.NestedClose = void 0;
|
|
7
7
|
var _store = require("../store");
|
|
8
8
|
var _Expands = require("../store/Expands");
|
|
9
|
-
var _symbol = require("../symbol");
|
|
9
|
+
var _symbol = require("../symbol/");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
var NestedClose = exports.NestedClose = function NestedClose(props) {
|
|
12
12
|
var _expands$expandKey;
|
package/cjs/comps/NestedOpen.js
CHANGED
|
@@ -14,9 +14,9 @@ var _store = require("../store");
|
|
|
14
14
|
var _Copied = require("./Copied");
|
|
15
15
|
var _CountInfoExtra = require("../section/CountInfoExtra");
|
|
16
16
|
var _CountInfo = require("../section/CountInfo");
|
|
17
|
-
var _symbol = require("../symbol");
|
|
17
|
+
var _symbol = require("../symbol/");
|
|
18
18
|
var _Ellipsis = require("../section/Ellipsis");
|
|
19
|
-
var _types = require("../types");
|
|
19
|
+
var _types = require("../types/");
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
21
|
var NestedOpen = exports.NestedOpen = function NestedOpen(props) {
|
|
22
22
|
var _expands$expandKey;
|
package/cjs/comps/Value.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.isFloat = exports.Value = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _types = require("../types");
|
|
9
|
+
var _types = require("../types/");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
var isFloat = exports.isFloat = function isFloat(n) {
|
|
12
12
|
return Number(n) === n && n % 1 !== 0 || isNaN(n);
|
package/cjs/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export * from './store/Expands';
|
|
|
30
30
|
export * from './store/ShowTools';
|
|
31
31
|
export * from './store/Symbols';
|
|
32
32
|
export * from './store/Types';
|
|
33
|
-
export * from './symbol';
|
|
33
|
+
export * from './symbol/';
|
|
34
34
|
export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
35
35
|
/** This property contains your input JSON */
|
|
36
36
|
value?: T;
|
|
@@ -58,6 +58,8 @@ export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps
|
|
|
58
58
|
highlightUpdates?: boolean;
|
|
59
59
|
/** Shorten long JSON strings, Set to `0` to disable this feature @default 30 */
|
|
60
60
|
shortenTextAfterLength?: number;
|
|
61
|
+
/** When the text exceeds the length, `...` will be displayed. Currently, this `...` can be customized. @default "..." */
|
|
62
|
+
stringEllipsis?: number;
|
|
61
63
|
/** Callback function for when a treeNode is expanded or collapsed */
|
|
62
64
|
onExpand?: (props: {
|
|
63
65
|
expand: boolean;
|
package/cjs/index.js
CHANGED
|
@@ -98,7 +98,7 @@ Object.keys(_Types).forEach(function (key) {
|
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
});
|
|
101
|
-
var _symbol = require("./symbol");
|
|
101
|
+
var _symbol = require("./symbol/");
|
|
102
102
|
Object.keys(_symbol).forEach(function (key) {
|
|
103
103
|
if (key === "default" || key === "__esModule") return;
|
|
104
104
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -110,7 +110,7 @@ Object.keys(_symbol).forEach(function (key) {
|
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
});
|
|
113
|
-
var _excluded = ["className", "style", "value", "children", "collapsed", "shouldExpandNodeInitially", "indentWidth", "displayObjectSize", "shortenTextAfterLength", "highlightUpdates", "enableClipboard", "displayDataTypes", "objectSortKeys", "onExpand", "onCopied"];
|
|
113
|
+
var _excluded = ["className", "style", "value", "children", "collapsed", "shouldExpandNodeInitially", "indentWidth", "displayObjectSize", "shortenTextAfterLength", "stringEllipsis", "highlightUpdates", "enableClipboard", "displayDataTypes", "objectSortKeys", "onExpand", "onCopied"];
|
|
114
114
|
var JsonView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
115
115
|
var _props$className = props.className,
|
|
116
116
|
className = _props$className === void 0 ? '' : _props$className,
|
|
@@ -125,6 +125,7 @@ var JsonView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
125
125
|
displayObjectSize = _props$displayObjectS === void 0 ? true : _props$displayObjectS,
|
|
126
126
|
_props$shortenTextAft = props.shortenTextAfterLength,
|
|
127
127
|
shortenTextAfterLength = _props$shortenTextAft === void 0 ? 30 : _props$shortenTextAft,
|
|
128
|
+
stringEllipsis = props.stringEllipsis,
|
|
128
129
|
_props$highlightUpdat = props.highlightUpdates,
|
|
129
130
|
highlightUpdates = _props$highlightUpdat === void 0 ? true : _props$highlightUpdat,
|
|
130
131
|
_props$enableClipboar = props.enableClipboard,
|
|
@@ -154,6 +155,7 @@ var JsonView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
154
155
|
collapsed: collapsed,
|
|
155
156
|
enableClipboard: enableClipboard,
|
|
156
157
|
shortenTextAfterLength: shortenTextAfterLength,
|
|
158
|
+
stringEllipsis: stringEllipsis,
|
|
157
159
|
highlightUpdates: highlightUpdates,
|
|
158
160
|
onCopied: onCopied,
|
|
159
161
|
onExpand: onExpand
|
package/cjs/store.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface InitialState<T extends object> {
|
|
|
9
9
|
objectSortKeys?: JsonViewProps<T>['objectSortKeys'];
|
|
10
10
|
displayObjectSize?: JsonViewProps<T>['displayObjectSize'];
|
|
11
11
|
shortenTextAfterLength?: JsonViewProps<T>['shortenTextAfterLength'];
|
|
12
|
+
stringEllipsis?: JsonViewProps<T>['stringEllipsis'];
|
|
12
13
|
enableClipboard?: JsonViewProps<T>['enableClipboard'];
|
|
13
14
|
highlightUpdates?: JsonViewProps<T>['highlightUpdates'];
|
|
14
15
|
collapsed?: JsonViewProps<T>['collapsed'];
|
package/cjs/types/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _store = require("../store");
|
|
13
13
|
var _Types = require("../store/Types");
|
|
14
|
-
var _symbol = require("../symbol");
|
|
14
|
+
var _symbol = require("../symbol/");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
var _excluded = ["as", "render"],
|
|
17
17
|
_excluded2 = ["as", "render"],
|
|
@@ -22,10 +22,10 @@ var _excluded = ["as", "render"],
|
|
|
22
22
|
_excluded7 = ["as", "render"],
|
|
23
23
|
_excluded8 = ["as", "render"],
|
|
24
24
|
_excluded9 = ["as", "render"],
|
|
25
|
+
_excluded0 = ["as", "render"],
|
|
26
|
+
_excluded1 = ["as", "render"],
|
|
25
27
|
_excluded10 = ["as", "render"],
|
|
26
|
-
_excluded11 = ["as", "render"]
|
|
27
|
-
_excluded12 = ["as", "render"],
|
|
28
|
-
_excluded13 = ["as", "render"];
|
|
28
|
+
_excluded11 = ["as", "render"];
|
|
29
29
|
var bigIntToString = exports.bigIntToString = function bigIntToString(bi) {
|
|
30
30
|
if (bi === undefined) {
|
|
31
31
|
return '0n';
|
|
@@ -98,7 +98,9 @@ var TypeString = exports.TypeString = function TypeString(_ref3) {
|
|
|
98
98
|
displayDataTypes = _useTypesStore3.displayDataTypes;
|
|
99
99
|
var _useStore = (0, _store.useStore)(),
|
|
100
100
|
_useStore$shortenText = _useStore.shortenTextAfterLength,
|
|
101
|
-
length = _useStore$shortenText === void 0 ? 30 : _useStore$shortenText
|
|
101
|
+
length = _useStore$shortenText === void 0 ? 30 : _useStore$shortenText,
|
|
102
|
+
_useStore$stringEllip = _useStore.stringEllipsis,
|
|
103
|
+
stringEllipsis = _useStore$stringEllip === void 0 ? '...' : _useStore$stringEllip;
|
|
102
104
|
var as = Str.as,
|
|
103
105
|
render = Str.render,
|
|
104
106
|
reset = (0, _objectWithoutProperties2["default"])(Str, _excluded3);
|
|
@@ -122,7 +124,7 @@ var TypeString = exports.TypeString = function TypeString(_ref3) {
|
|
|
122
124
|
};
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
|
-
var text = shorten ? "".concat(childrenStr.slice(0, length)
|
|
127
|
+
var text = shorten ? "".concat(childrenStr.slice(0, length)).concat(stringEllipsis) : childrenStr;
|
|
126
128
|
var isRender = render && typeof render === 'function';
|
|
127
129
|
var type = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
128
130
|
style: style
|
|
@@ -131,9 +133,10 @@ var TypeString = exports.TypeString = function TypeString(_ref3) {
|
|
|
131
133
|
value: children,
|
|
132
134
|
keyName: keyName
|
|
133
135
|
});
|
|
136
|
+
var cls = shorten ? 'w-rjv-value w-rjv-value-short' : 'w-rjv-value';
|
|
134
137
|
var child = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
135
138
|
children: text,
|
|
136
|
-
className:
|
|
139
|
+
className: cls
|
|
137
140
|
}), {
|
|
138
141
|
type: 'value',
|
|
139
142
|
value: children,
|
|
@@ -144,7 +147,7 @@ var TypeString = exports.TypeString = function TypeString(_ref3) {
|
|
|
144
147
|
style: style
|
|
145
148
|
}))), child || /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
146
149
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_symbol.ValueQuote, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
147
|
-
className:
|
|
150
|
+
className: cls,
|
|
148
151
|
children: text
|
|
149
152
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_symbol.ValueQuote, {})]
|
|
150
153
|
})]
|
|
@@ -382,16 +385,16 @@ var TypeUrl = exports.TypeUrl = function TypeUrl(_ref9) {
|
|
|
382
385
|
});
|
|
383
386
|
};
|
|
384
387
|
TypeUrl.displayName = 'JVR.TypeUrl';
|
|
385
|
-
var TypeDate = exports.TypeDate = function TypeDate(
|
|
386
|
-
var children =
|
|
387
|
-
keyName =
|
|
388
|
-
var
|
|
389
|
-
|
|
390
|
-
CompData =
|
|
391
|
-
displayDataTypes =
|
|
388
|
+
var TypeDate = exports.TypeDate = function TypeDate(_ref0) {
|
|
389
|
+
var children = _ref0.children,
|
|
390
|
+
keyName = _ref0.keyName;
|
|
391
|
+
var _useTypesStore0 = (0, _Types.useTypesStore)(),
|
|
392
|
+
_useTypesStore0$Date = _useTypesStore0.Date,
|
|
393
|
+
CompData = _useTypesStore0$Date === void 0 ? {} : _useTypesStore0$Date,
|
|
394
|
+
displayDataTypes = _useTypesStore0.displayDataTypes;
|
|
392
395
|
var as = CompData.as,
|
|
393
396
|
render = CompData.render,
|
|
394
|
-
reset = (0, _objectWithoutProperties2["default"])(CompData,
|
|
397
|
+
reset = (0, _objectWithoutProperties2["default"])(CompData, _excluded0);
|
|
395
398
|
var Comp = as || 'span';
|
|
396
399
|
var style = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, defalutStyle), CompData.style || {});
|
|
397
400
|
var isRender = render && typeof render === 'function';
|
|
@@ -421,16 +424,16 @@ var TypeDate = exports.TypeDate = function TypeDate(_ref10) {
|
|
|
421
424
|
});
|
|
422
425
|
};
|
|
423
426
|
TypeDate.displayName = 'JVR.TypeDate';
|
|
424
|
-
var TypeUndefined = exports.TypeUndefined = function TypeUndefined(
|
|
425
|
-
var children =
|
|
426
|
-
keyName =
|
|
427
|
-
var
|
|
428
|
-
|
|
429
|
-
Undefined =
|
|
430
|
-
displayDataTypes =
|
|
427
|
+
var TypeUndefined = exports.TypeUndefined = function TypeUndefined(_ref1) {
|
|
428
|
+
var children = _ref1.children,
|
|
429
|
+
keyName = _ref1.keyName;
|
|
430
|
+
var _useTypesStore1 = (0, _Types.useTypesStore)(),
|
|
431
|
+
_useTypesStore1$Undef = _useTypesStore1.Undefined,
|
|
432
|
+
Undefined = _useTypesStore1$Undef === void 0 ? {} : _useTypesStore1$Undef,
|
|
433
|
+
displayDataTypes = _useTypesStore1.displayDataTypes;
|
|
431
434
|
var as = Undefined.as,
|
|
432
435
|
render = Undefined.render,
|
|
433
|
-
reset = (0, _objectWithoutProperties2["default"])(Undefined,
|
|
436
|
+
reset = (0, _objectWithoutProperties2["default"])(Undefined, _excluded1);
|
|
434
437
|
var Comp = as || 'span';
|
|
435
438
|
var style = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, defalutStyle), Undefined.style || {});
|
|
436
439
|
var isRender = render && typeof render === 'function';
|
|
@@ -456,16 +459,16 @@ var TypeUndefined = exports.TypeUndefined = function TypeUndefined(_ref11) {
|
|
|
456
459
|
});
|
|
457
460
|
};
|
|
458
461
|
TypeUndefined.displayName = 'JVR.TypeUndefined';
|
|
459
|
-
var TypeNull = exports.TypeNull = function TypeNull(
|
|
460
|
-
var children =
|
|
461
|
-
keyName =
|
|
462
|
-
var
|
|
463
|
-
|
|
464
|
-
Null =
|
|
465
|
-
displayDataTypes =
|
|
462
|
+
var TypeNull = exports.TypeNull = function TypeNull(_ref10) {
|
|
463
|
+
var children = _ref10.children,
|
|
464
|
+
keyName = _ref10.keyName;
|
|
465
|
+
var _useTypesStore10 = (0, _Types.useTypesStore)(),
|
|
466
|
+
_useTypesStore10$Null = _useTypesStore10.Null,
|
|
467
|
+
Null = _useTypesStore10$Null === void 0 ? {} : _useTypesStore10$Null,
|
|
468
|
+
displayDataTypes = _useTypesStore10.displayDataTypes;
|
|
466
469
|
var as = Null.as,
|
|
467
470
|
render = Null.render,
|
|
468
|
-
reset = (0, _objectWithoutProperties2["default"])(Null,
|
|
471
|
+
reset = (0, _objectWithoutProperties2["default"])(Null, _excluded10);
|
|
469
472
|
var Comp = as || 'span';
|
|
470
473
|
var style = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, defalutStyle), Null.style || {});
|
|
471
474
|
var isRender = render && typeof render === 'function';
|
|
@@ -491,16 +494,16 @@ var TypeNull = exports.TypeNull = function TypeNull(_ref12) {
|
|
|
491
494
|
});
|
|
492
495
|
};
|
|
493
496
|
TypeNull.displayName = 'JVR.TypeNull';
|
|
494
|
-
var TypeNan = exports.TypeNan = function TypeNan(
|
|
495
|
-
var children =
|
|
496
|
-
keyName =
|
|
497
|
-
var
|
|
498
|
-
|
|
499
|
-
Nan =
|
|
500
|
-
displayDataTypes =
|
|
497
|
+
var TypeNan = exports.TypeNan = function TypeNan(_ref11) {
|
|
498
|
+
var children = _ref11.children,
|
|
499
|
+
keyName = _ref11.keyName;
|
|
500
|
+
var _useTypesStore11 = (0, _Types.useTypesStore)(),
|
|
501
|
+
_useTypesStore11$Nan = _useTypesStore11.Nan,
|
|
502
|
+
Nan = _useTypesStore11$Nan === void 0 ? {} : _useTypesStore11$Nan,
|
|
503
|
+
displayDataTypes = _useTypesStore11.displayDataTypes;
|
|
501
504
|
var as = Nan.as,
|
|
502
505
|
render = Nan.render,
|
|
503
|
-
reset = (0, _objectWithoutProperties2["default"])(Nan,
|
|
506
|
+
reset = (0, _objectWithoutProperties2["default"])(Nan, _excluded11);
|
|
504
507
|
var Comp = as || 'span';
|
|
505
508
|
var style = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, defalutStyle), Nan.style || {});
|
|
506
509
|
var isRender = render && typeof render === 'function';
|
package/esm/Container.js
CHANGED
|
@@ -2,11 +2,11 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["className", "children", "parentValue", "keyid", "level", "value", "initialValue", "keys", "keyName"];
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
|
-
import { NestedClose } from
|
|
6
|
-
import { NestedOpen } from
|
|
7
|
-
import { KeyValues } from
|
|
8
|
-
import { useIdCompat } from
|
|
9
|
-
import { useShowToolsDispatch } from
|
|
5
|
+
import { NestedClose } from "./comps/NestedClose.js";
|
|
6
|
+
import { NestedOpen } from "./comps/NestedOpen.js";
|
|
7
|
+
import { KeyValues } from "./comps/KeyValues.js";
|
|
8
|
+
import { useIdCompat } from "./comps/useIdCompat.js";
|
|
9
|
+
import { useShowToolsDispatch } from "./store/ShowTools.js";
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
export var Container = /*#__PURE__*/forwardRef((props, ref) => {
|
|
12
12
|
var {
|
package/esm/comps/Copied.js
CHANGED
|
@@ -3,10 +3,10 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutP
|
|
|
3
3
|
var _excluded = ["keyName", "value", "parentValue", "expandKey", "keys"],
|
|
4
4
|
_excluded2 = ["as", "render"];
|
|
5
5
|
import { useState } from 'react';
|
|
6
|
-
import { useStore } from
|
|
7
|
-
import { useSectionStore } from
|
|
8
|
-
import { useShowToolsStore } from
|
|
9
|
-
import { bigIntToString } from
|
|
6
|
+
import { useStore } from "../store.js";
|
|
7
|
+
import { useSectionStore } from "../store/Section.js";
|
|
8
|
+
import { useShowToolsStore } from "../store/ShowTools.js";
|
|
9
|
+
import { bigIntToString } from "../types/index.js";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
export var Copied = props => {
|
|
12
12
|
var {
|
package/esm/comps/KeyValues.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import { Fragment, useRef } from 'react';
|
|
3
|
-
import { useStore } from
|
|
4
|
-
import { useExpandsStore } from
|
|
5
|
-
import { useShowToolsDispatch } from
|
|
6
|
-
import { Value } from
|
|
7
|
-
import { KeyNameComp } from
|
|
8
|
-
import { RowComp } from
|
|
9
|
-
import { Container } from
|
|
10
|
-
import { Quote, Colon } from
|
|
11
|
-
import { useHighlight } from
|
|
12
|
-
import { Copied } from
|
|
13
|
-
import { useIdCompat } from
|
|
3
|
+
import { useStore } from "../store.js";
|
|
4
|
+
import { useExpandsStore } from "../store/Expands.js";
|
|
5
|
+
import { useShowToolsDispatch } from "../store/ShowTools.js";
|
|
6
|
+
import { Value } from "./Value.js";
|
|
7
|
+
import { KeyNameComp } from "../section/KeyName.js";
|
|
8
|
+
import { RowComp } from "../section/Row.js";
|
|
9
|
+
import { Container } from "../Container.js";
|
|
10
|
+
import { Quote, Colon } from "../symbol/index.js";
|
|
11
|
+
import { useHighlight } from "../utils/useHighlight.js";
|
|
12
|
+
import { Copied } from "../comps/Copied.js";
|
|
13
|
+
import { useIdCompat } from "../comps/useIdCompat.js";
|
|
14
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
export var KeyValues = props => {
|
|
16
16
|
var _expands$expandKey;
|
package/esm/comps/NestedClose.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useStore } from
|
|
2
|
-
import { useExpandsStore } from
|
|
3
|
-
import { BracketsClose } from
|
|
1
|
+
import { useStore } from "../store.js";
|
|
2
|
+
import { useExpandsStore } from "../store/Expands.js";
|
|
3
|
+
import { BracketsClose } from "../symbol/index.js";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
export var NestedClose = props => {
|
|
6
6
|
var _expands$expandKey;
|
package/esm/comps/NestedOpen.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import { KayName } from
|
|
3
|
-
import { useExpandsStore, useExpandsDispatch } from
|
|
4
|
-
import { useStore } from
|
|
5
|
-
import { Copied } from
|
|
6
|
-
import { CountInfoExtraComps } from
|
|
7
|
-
import { CountInfoComp } from
|
|
8
|
-
import { Arrow, BracketsOpen, BracketsClose } from
|
|
9
|
-
import { EllipsisComp } from
|
|
10
|
-
import { SetComp, MapComp } from
|
|
2
|
+
import { KayName } from "./KeyValues.js";
|
|
3
|
+
import { useExpandsStore, useExpandsDispatch } from "../store/Expands.js";
|
|
4
|
+
import { useStore } from "../store.js";
|
|
5
|
+
import { Copied } from "./Copied.js";
|
|
6
|
+
import { CountInfoExtraComps } from "../section/CountInfoExtra.js";
|
|
7
|
+
import { CountInfoComp } from "../section/CountInfo.js";
|
|
8
|
+
import { Arrow, BracketsOpen, BracketsClose } from "../symbol/index.js";
|
|
9
|
+
import { EllipsisComp } from "../section/Ellipsis.js";
|
|
10
|
+
import { SetComp, MapComp } from "../types/index.js";
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
export var NestedOpen = props => {
|
|
13
13
|
var _expands$expandKey;
|
package/esm/comps/Value.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import { TypeString, TypeTrue, TypeNull, TypeFalse, TypeFloat, TypeBigint, TypeInt, TypeDate, TypeUndefined, TypeNan, TypeUrl } from
|
|
2
|
+
import { TypeString, TypeTrue, TypeNull, TypeFalse, TypeFloat, TypeBigint, TypeInt, TypeDate, TypeUndefined, TypeNan, TypeUrl } from "../types/index.js";
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
4
|
export var isFloat = n => Number(n) === n && n % 1 !== 0 || isNaN(n);
|
|
5
5
|
export var Value = props => {
|
package/esm/editor/KeyName.js
CHANGED
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutP
|
|
|
3
3
|
var _excluded = ["children"],
|
|
4
4
|
_excluded2 = ["value", "parentValue", "keyName"];
|
|
5
5
|
import { useRef, useState } from 'react';
|
|
6
|
-
import { useStore } from
|
|
6
|
+
import { useStore } from "./store.js";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
export var KeyNameRender = (_ref, _ref2) => {
|
|
9
9
|
var {
|
package/esm/editor/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["children", "onEdit", "editable"];
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
|
-
import JsonView from
|
|
6
|
-
import { KeyNameRender } from
|
|
7
|
-
import { Context, Dispatch, useStoreReducer } from
|
|
5
|
+
import JsonView from "../index.js";
|
|
6
|
+
import { KeyNameRender } from "./KeyName.js";
|
|
7
|
+
import { Context, Dispatch, useStoreReducer } from "./store.js";
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
9
|
var JsonViewEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
10
10
|
var {
|
package/esm/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export * from './store/Expands';
|
|
|
30
30
|
export * from './store/ShowTools';
|
|
31
31
|
export * from './store/Symbols';
|
|
32
32
|
export * from './store/Types';
|
|
33
|
-
export * from './symbol';
|
|
33
|
+
export * from './symbol/';
|
|
34
34
|
export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
35
35
|
/** This property contains your input JSON */
|
|
36
36
|
value?: T;
|
|
@@ -58,6 +58,8 @@ export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps
|
|
|
58
58
|
highlightUpdates?: boolean;
|
|
59
59
|
/** Shorten long JSON strings, Set to `0` to disable this feature @default 30 */
|
|
60
60
|
shortenTextAfterLength?: number;
|
|
61
|
+
/** When the text exceeds the length, `...` will be displayed. Currently, this `...` can be customized. @default "..." */
|
|
62
|
+
stringEllipsis?: number;
|
|
61
63
|
/** Callback function for when a treeNode is expanded or collapsed */
|
|
62
64
|
onExpand?: (props: {
|
|
63
65
|
expand: boolean;
|
package/esm/index.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["className", "style", "value", "children", "collapsed", "shouldExpandNodeInitially", "indentWidth", "displayObjectSize", "shortenTextAfterLength", "highlightUpdates", "enableClipboard", "displayDataTypes", "objectSortKeys", "onExpand", "onCopied"];
|
|
3
|
+
var _excluded = ["className", "style", "value", "children", "collapsed", "shouldExpandNodeInitially", "indentWidth", "displayObjectSize", "shortenTextAfterLength", "stringEllipsis", "highlightUpdates", "enableClipboard", "displayDataTypes", "objectSortKeys", "onExpand", "onCopied"];
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
|
-
import { Provider } from
|
|
6
|
-
import { Container } from
|
|
7
|
-
import { BraceLeft } from
|
|
8
|
-
import { BraceRight } from
|
|
9
|
-
import { BracketsLeft } from
|
|
10
|
-
import { BracketsRight } from
|
|
11
|
-
import { Arrow } from
|
|
12
|
-
import { Colon } from
|
|
13
|
-
import { Quote } from
|
|
14
|
-
import { ValueQuote } from
|
|
15
|
-
import { Bigint } from
|
|
16
|
-
import { Date } from
|
|
17
|
-
import { False } from
|
|
18
|
-
import { Float } from
|
|
19
|
-
import { Int } from
|
|
20
|
-
import { Map } from
|
|
21
|
-
import { Nan } from
|
|
22
|
-
import { Null } from
|
|
23
|
-
import { Set } from
|
|
24
|
-
import { StringText } from
|
|
25
|
-
import { True } from
|
|
26
|
-
import { Undefined } from
|
|
27
|
-
import { Url } from
|
|
28
|
-
import { Copied } from
|
|
29
|
-
import { CountInfo } from
|
|
30
|
-
import { CountInfoExtra } from
|
|
31
|
-
import { Ellipsis } from
|
|
32
|
-
import { KeyName } from
|
|
33
|
-
import { Row } from
|
|
5
|
+
import { Provider } from "./store.js";
|
|
6
|
+
import { Container } from "./Container.js";
|
|
7
|
+
import { BraceLeft } from "./symbol/BraceLeft.js";
|
|
8
|
+
import { BraceRight } from "./symbol/BraceRight.js";
|
|
9
|
+
import { BracketsLeft } from "./symbol/BracketsLeft.js";
|
|
10
|
+
import { BracketsRight } from "./symbol/BracketsRight.js";
|
|
11
|
+
import { Arrow } from "./symbol/Arrow.js";
|
|
12
|
+
import { Colon } from "./symbol/Colon.js";
|
|
13
|
+
import { Quote } from "./symbol/Quote.js";
|
|
14
|
+
import { ValueQuote } from "./symbol/ValueQuote.js";
|
|
15
|
+
import { Bigint } from "./types/Bigint.js";
|
|
16
|
+
import { Date } from "./types/Date.js";
|
|
17
|
+
import { False } from "./types/False.js";
|
|
18
|
+
import { Float } from "./types/Float.js";
|
|
19
|
+
import { Int } from "./types/Int.js";
|
|
20
|
+
import { Map } from "./types/Map.js";
|
|
21
|
+
import { Nan } from "./types/Nan.js";
|
|
22
|
+
import { Null } from "./types/Null.js";
|
|
23
|
+
import { Set } from "./types/Set.js";
|
|
24
|
+
import { StringText } from "./types/String.js";
|
|
25
|
+
import { True } from "./types/True.js";
|
|
26
|
+
import { Undefined } from "./types/Undefined.js";
|
|
27
|
+
import { Url } from "./types/Url.js";
|
|
28
|
+
import { Copied } from "./section/Copied.js";
|
|
29
|
+
import { CountInfo } from "./section/CountInfo.js";
|
|
30
|
+
import { CountInfoExtra } from "./section/CountInfoExtra.js";
|
|
31
|
+
import { Ellipsis } from "./section/Ellipsis.js";
|
|
32
|
+
import { KeyName } from "./section/KeyName.js";
|
|
33
|
+
import { Row } from "./section/Row.js";
|
|
34
34
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
35
|
-
export * from
|
|
36
|
-
export * from
|
|
37
|
-
export * from
|
|
38
|
-
export * from
|
|
39
|
-
export * from
|
|
40
|
-
export * from
|
|
35
|
+
export * from "./store.js";
|
|
36
|
+
export * from "./store/Expands.js";
|
|
37
|
+
export * from "./store/ShowTools.js";
|
|
38
|
+
export * from "./store/Symbols.js";
|
|
39
|
+
export * from "./store/Types.js";
|
|
40
|
+
export * from "./symbol/index.js";
|
|
41
41
|
var JsonView = /*#__PURE__*/forwardRef((props, ref) => {
|
|
42
42
|
var {
|
|
43
43
|
className = '',
|
|
@@ -49,6 +49,7 @@ var JsonView = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
49
49
|
indentWidth = 15,
|
|
50
50
|
displayObjectSize = true,
|
|
51
51
|
shortenTextAfterLength = 30,
|
|
52
|
+
stringEllipsis,
|
|
52
53
|
highlightUpdates = true,
|
|
53
54
|
enableClipboard = true,
|
|
54
55
|
displayDataTypes = true,
|
|
@@ -75,6 +76,7 @@ var JsonView = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
75
76
|
collapsed,
|
|
76
77
|
enableClipboard,
|
|
77
78
|
shortenTextAfterLength,
|
|
79
|
+
stringEllipsis,
|
|
78
80
|
highlightUpdates,
|
|
79
81
|
onCopied,
|
|
80
82
|
onExpand
|
package/esm/section/Copied.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useSectionStore } from
|
|
2
|
-
import { useSectionRender } from
|
|
1
|
+
import { useSectionStore } from "../store/Section.js";
|
|
2
|
+
import { useSectionRender } from "../utils/useRender.js";
|
|
3
3
|
export var Copied = props => {
|
|
4
4
|
var {
|
|
5
5
|
Copied: Comp = {}
|
package/esm/section/CountInfo.js
CHANGED
|
@@ -2,9 +2,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["value", "keyName"],
|
|
4
4
|
_excluded2 = ["as", "render"];
|
|
5
|
-
import { useSectionStore } from
|
|
6
|
-
import { useSectionRender } from
|
|
7
|
-
import { useStore } from
|
|
5
|
+
import { useSectionStore } from "../store/Section.js";
|
|
6
|
+
import { useSectionRender } from "../utils/useRender.js";
|
|
7
|
+
import { useStore } from "../store.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
export var CountInfo = props => {
|
|
10
10
|
var {
|
|
@@ -2,8 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["value", "keyName"],
|
|
4
4
|
_excluded2 = ["as", "render"];
|
|
5
|
-
import { useSectionStore } from
|
|
6
|
-
import { useSectionRender } from
|
|
5
|
+
import { useSectionStore } from "../store/Section.js";
|
|
6
|
+
import { useSectionRender } from "../utils/useRender.js";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
export var CountInfoExtra = props => {
|
|
9
9
|
var {
|
package/esm/section/Ellipsis.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["as", "render"];
|
|
4
|
-
import { useSectionStore } from
|
|
5
|
-
import { useSectionRender } from
|
|
4
|
+
import { useSectionStore } from "../store/Section.js";
|
|
5
|
+
import { useSectionRender } from "../utils/useRender.js";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
export var Ellipsis = props => {
|
|
8
8
|
var {
|
package/esm/section/KeyName.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["as", "render"];
|
|
4
|
-
import { useSectionStore } from
|
|
5
|
-
import { useSectionRender } from
|
|
4
|
+
import { useSectionStore } from "../store/Section.js";
|
|
5
|
+
import { useSectionRender } from "../utils/useRender.js";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
export var KeyName = props => {
|
|
8
8
|
var {
|
package/esm/section/Row.js
CHANGED
|
@@ -2,8 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["children", "value", "parentValue", "keyName", "keys"],
|
|
4
4
|
_excluded2 = ["as", "render", "children"];
|
|
5
|
-
import { useSectionStore } from
|
|
6
|
-
import { useSectionRender } from
|
|
5
|
+
import { useSectionStore } from "../store/Section.js";
|
|
6
|
+
import { useSectionRender } from "../utils/useRender.js";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
export var Row = props => {
|
|
9
9
|
var {
|
package/esm/store/Symbols.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import { createContext, useContext, useReducer } from 'react';
|
|
3
|
-
import { TriangleArrow } from
|
|
3
|
+
import { TriangleArrow } from "../arrow/TriangleArrow.js";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
var initialState = {
|
|
6
6
|
Arrow: {
|
package/esm/store.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface InitialState<T extends object> {
|
|
|
9
9
|
objectSortKeys?: JsonViewProps<T>['objectSortKeys'];
|
|
10
10
|
displayObjectSize?: JsonViewProps<T>['displayObjectSize'];
|
|
11
11
|
shortenTextAfterLength?: JsonViewProps<T>['shortenTextAfterLength'];
|
|
12
|
+
stringEllipsis?: JsonViewProps<T>['stringEllipsis'];
|
|
12
13
|
enableClipboard?: JsonViewProps<T>['enableClipboard'];
|
|
13
14
|
highlightUpdates?: JsonViewProps<T>['highlightUpdates'];
|
|
14
15
|
collapsed?: JsonViewProps<T>['collapsed'];
|
package/esm/store.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { createContext, useContext, useEffect, useReducer } from 'react';
|
|
3
|
-
import { useShowTools, ShowTools } from
|
|
4
|
-
import { useExpands, Expands } from
|
|
5
|
-
import { useTypes, Types } from
|
|
6
|
-
import { useSymbols, Symbols } from
|
|
7
|
-
import { useSection, Section } from
|
|
3
|
+
import { useShowTools, ShowTools } from "./store/ShowTools.js";
|
|
4
|
+
import { useExpands, Expands } from "./store/Expands.js";
|
|
5
|
+
import { useTypes, Types } from "./store/Types.js";
|
|
6
|
+
import { useSymbols, Symbols } from "./store/Symbols.js";
|
|
7
|
+
import { useSection, Section } from "./store/Section.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
export var initialState = {
|
|
10
10
|
objectSortKeys: false,
|
package/esm/symbol/Arrow.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useSymbolsStore } from
|
|
2
|
-
import { useSymbolsRender } from
|
|
1
|
+
import { useSymbolsStore } from "../store/Symbols.js";
|
|
2
|
+
import { useSymbolsRender } from "../utils/useRender.js";
|
|
3
3
|
export var Arrow = props => {
|
|
4
4
|
var {
|
|
5
5
|
Arrow: Comp = {}
|
package/esm/symbol/BraceLeft.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useSymbolsStore } from
|
|
2
|
-
import { useSymbolsRender } from
|
|
1
|
+
import { useSymbolsStore } from "../store/Symbols.js";
|
|
2
|
+
import { useSymbolsRender } from "../utils/useRender.js";
|
|
3
3
|
export var BraceLeft = props => {
|
|
4
4
|
var {
|
|
5
5
|
BraceLeft: Comp = {}
|
package/esm/symbol/BraceRight.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useSymbolsStore } from
|
|
2
|
-
import { useSymbolsRender } from
|
|
1
|
+
import { useSymbolsStore } from "../store/Symbols.js";
|
|
2
|
+
import { useSymbolsRender } from "../utils/useRender.js";
|
|
3
3
|
export var BraceRight = props => {
|
|
4
4
|
var {
|
|
5
5
|
BraceRight: Comp = {}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useSymbolsStore } from
|
|
2
|
-
import { useSymbolsRender } from
|
|
1
|
+
import { useSymbolsStore } from "../store/Symbols.js";
|
|
2
|
+
import { useSymbolsRender } from "../utils/useRender.js";
|
|
3
3
|
export var BracketsLeft = props => {
|
|
4
4
|
var {
|
|
5
5
|
BracketsLeft: Comp = {}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useSymbolsStore } from
|
|
2
|
-
import { useSymbolsRender } from
|
|
1
|
+
import { useSymbolsStore } from "../store/Symbols.js";
|
|
2
|
+
import { useSymbolsRender } from "../utils/useRender.js";
|
|
3
3
|
export var BracketsRight = props => {
|
|
4
4
|
var {
|
|
5
5
|
BracketsRight: Comp = {}
|
package/esm/symbol/Colon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useSymbolsStore } from
|
|
2
|
-
import { useSymbolsRender } from
|
|
1
|
+
import { useSymbolsStore } from "../store/Symbols.js";
|
|
2
|
+
import { useSymbolsRender } from "../utils/useRender.js";
|
|
3
3
|
export var Colon = props => {
|
|
4
4
|
var {
|
|
5
5
|
Colon: Comp = {}
|
package/esm/symbol/Quote.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useSymbolsStore } from
|
|
2
|
-
import { useSymbolsRender } from
|
|
1
|
+
import { useSymbolsStore } from "../store/Symbols.js";
|
|
2
|
+
import { useSymbolsRender } from "../utils/useRender.js";
|
|
3
3
|
export var Quote = props => {
|
|
4
4
|
var {
|
|
5
5
|
Quote: Comp = {}
|
package/esm/symbol/ValueQuote.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useSymbolsStore } from
|
|
2
|
-
import { useSymbolsRender } from
|
|
1
|
+
import { useSymbolsStore } from "../store/Symbols.js";
|
|
2
|
+
import { useSymbolsRender } from "../utils/useRender.js";
|
|
3
3
|
export var ValueQuote = props => {
|
|
4
4
|
var {
|
|
5
5
|
ValueQuote: Comp = {}
|
package/esm/symbol/index.js
CHANGED
|
@@ -10,8 +10,8 @@ var _excluded = ["isNumber", "value", "parentValue", "keyName", "keys"],
|
|
|
10
10
|
_excluded7 = ["as", "render"],
|
|
11
11
|
_excluded8 = ["as", "render"],
|
|
12
12
|
_excluded9 = ["as", "render"];
|
|
13
|
-
import { useSymbolsStore } from
|
|
14
|
-
import { useExpandsStore } from
|
|
13
|
+
import { useSymbolsStore } from "../store/Symbols.js";
|
|
14
|
+
import { useExpandsStore } from "../store/Expands.js";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
export var Quote = props => {
|
|
17
17
|
var {
|
package/esm/types/Bigint.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTypesStore } from
|
|
2
|
-
import { useTypesRender } from
|
|
1
|
+
import { useTypesStore } from "../store/Types.js";
|
|
2
|
+
import { useTypesRender } from "../utils/useRender.js";
|
|
3
3
|
export var Bigint = props => {
|
|
4
4
|
var {
|
|
5
5
|
Bigint: Comp = {}
|
package/esm/types/Date.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTypesStore } from
|
|
2
|
-
import { useTypesRender } from
|
|
1
|
+
import { useTypesStore } from "../store/Types.js";
|
|
2
|
+
import { useTypesRender } from "../utils/useRender.js";
|
|
3
3
|
export var Date = props => {
|
|
4
4
|
var {
|
|
5
5
|
Date: Comp = {}
|
package/esm/types/False.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTypesStore } from
|
|
2
|
-
import { useTypesRender } from
|
|
1
|
+
import { useTypesStore } from "../store/Types.js";
|
|
2
|
+
import { useTypesRender } from "../utils/useRender.js";
|
|
3
3
|
export var False = props => {
|
|
4
4
|
var {
|
|
5
5
|
False: Comp = {}
|
package/esm/types/Float.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTypesStore } from
|
|
2
|
-
import { useTypesRender } from
|
|
1
|
+
import { useTypesStore } from "../store/Types.js";
|
|
2
|
+
import { useTypesRender } from "../utils/useRender.js";
|
|
3
3
|
export var Float = props => {
|
|
4
4
|
var {
|
|
5
5
|
Float: Comp = {}
|
package/esm/types/Int.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTypesStore } from
|
|
2
|
-
import { useTypesRender } from
|
|
1
|
+
import { useTypesStore } from "../store/Types.js";
|
|
2
|
+
import { useTypesRender } from "../utils/useRender.js";
|
|
3
3
|
export var Int = props => {
|
|
4
4
|
var {
|
|
5
5
|
Int: Comp = {}
|
package/esm/types/Map.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTypesStore } from
|
|
2
|
-
import { useTypesRender } from
|
|
1
|
+
import { useTypesStore } from "../store/Types.js";
|
|
2
|
+
import { useTypesRender } from "../utils/useRender.js";
|
|
3
3
|
export var Map = props => {
|
|
4
4
|
var {
|
|
5
5
|
Map: Comp = {}
|
package/esm/types/Nan.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTypesStore } from
|
|
2
|
-
import { useTypesRender } from
|
|
1
|
+
import { useTypesStore } from "../store/Types.js";
|
|
2
|
+
import { useTypesRender } from "../utils/useRender.js";
|
|
3
3
|
export var Nan = props => {
|
|
4
4
|
var {
|
|
5
5
|
Nan: Comp = {}
|
package/esm/types/Null.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTypesStore } from
|
|
2
|
-
import { useTypesRender } from
|
|
1
|
+
import { useTypesStore } from "../store/Types.js";
|
|
2
|
+
import { useTypesRender } from "../utils/useRender.js";
|
|
3
3
|
export var Null = props => {
|
|
4
4
|
var {
|
|
5
5
|
Null: Comp = {}
|
package/esm/types/Set.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTypesStore } from
|
|
2
|
-
import { useTypesRender } from
|
|
1
|
+
import { useTypesStore } from "../store/Types.js";
|
|
2
|
+
import { useTypesRender } from "../utils/useRender.js";
|
|
3
3
|
export var Set = props => {
|
|
4
4
|
var {
|
|
5
5
|
Set: Comp = {}
|
package/esm/types/String.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTypesStore } from
|
|
2
|
-
import { useTypesRender } from
|
|
1
|
+
import { useTypesStore } from "../store/Types.js";
|
|
2
|
+
import { useTypesRender } from "../utils/useRender.js";
|
|
3
3
|
export var StringText = props => {
|
|
4
4
|
var {
|
|
5
5
|
Str: Comp = {}
|
package/esm/types/True.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTypesStore } from
|
|
2
|
-
import { useTypesRender } from
|
|
1
|
+
import { useTypesStore } from "../store/Types.js";
|
|
2
|
+
import { useTypesRender } from "../utils/useRender.js";
|
|
3
3
|
export var True = props => {
|
|
4
4
|
var {
|
|
5
5
|
True: Comp = {}
|
package/esm/types/Undefined.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTypesStore } from
|
|
2
|
-
import { useTypesRender } from
|
|
1
|
+
import { useTypesStore } from "../store/Types.js";
|
|
2
|
+
import { useTypesRender } from "../utils/useRender.js";
|
|
3
3
|
export var Undefined = props => {
|
|
4
4
|
var {
|
|
5
5
|
Undefined: Comp = {}
|
package/esm/types/Url.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useTypesStore } from
|
|
2
|
-
import { useTypesRender } from
|
|
1
|
+
import { useTypesStore } from "../store/Types.js";
|
|
2
|
+
import { useTypesRender } from "../utils/useRender.js";
|
|
3
3
|
export var Url = props => {
|
|
4
4
|
var {
|
|
5
5
|
Url: Comp = {}
|
package/esm/types/index.js
CHANGED
|
@@ -9,14 +9,14 @@ var _excluded = ["as", "render"],
|
|
|
9
9
|
_excluded7 = ["as", "render"],
|
|
10
10
|
_excluded8 = ["as", "render"],
|
|
11
11
|
_excluded9 = ["as", "render"],
|
|
12
|
+
_excluded0 = ["as", "render"],
|
|
13
|
+
_excluded1 = ["as", "render"],
|
|
12
14
|
_excluded10 = ["as", "render"],
|
|
13
|
-
_excluded11 = ["as", "render"]
|
|
14
|
-
_excluded12 = ["as", "render"],
|
|
15
|
-
_excluded13 = ["as", "render"];
|
|
15
|
+
_excluded11 = ["as", "render"];
|
|
16
16
|
import { Fragment, useEffect, useState } from 'react';
|
|
17
|
-
import { useStore } from
|
|
18
|
-
import { useTypesStore } from
|
|
19
|
-
import { ValueQuote } from
|
|
17
|
+
import { useStore } from "../store.js";
|
|
18
|
+
import { useTypesStore } from "../store/Types.js";
|
|
19
|
+
import { ValueQuote } from "../symbol/index.js";
|
|
20
20
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
21
|
export var bigIntToString = bi => {
|
|
22
22
|
if (bi === undefined) {
|
|
@@ -98,7 +98,8 @@ export var TypeString = _ref3 => {
|
|
|
98
98
|
displayDataTypes
|
|
99
99
|
} = useTypesStore();
|
|
100
100
|
var {
|
|
101
|
-
shortenTextAfterLength: length = 30
|
|
101
|
+
shortenTextAfterLength: length = 30,
|
|
102
|
+
stringEllipsis = '...'
|
|
102
103
|
} = useStore();
|
|
103
104
|
var {
|
|
104
105
|
as,
|
|
@@ -120,7 +121,7 @@ export var TypeString = _ref3 => {
|
|
|
120
121
|
};
|
|
121
122
|
}
|
|
122
123
|
}
|
|
123
|
-
var text = shorten ? childrenStr.slice(0, length) +
|
|
124
|
+
var text = shorten ? "" + childrenStr.slice(0, length) + stringEllipsis : childrenStr;
|
|
124
125
|
var isRender = render && typeof render === 'function';
|
|
125
126
|
var type = isRender && render(_extends({}, reset, {
|
|
126
127
|
style
|
|
@@ -129,9 +130,10 @@ export var TypeString = _ref3 => {
|
|
|
129
130
|
value: children,
|
|
130
131
|
keyName
|
|
131
132
|
});
|
|
133
|
+
var cls = shorten ? 'w-rjv-value w-rjv-value-short' : 'w-rjv-value';
|
|
132
134
|
var child = isRender && render(_extends({}, reset, {
|
|
133
135
|
children: text,
|
|
134
|
-
className:
|
|
136
|
+
className: cls
|
|
135
137
|
}), {
|
|
136
138
|
type: 'value',
|
|
137
139
|
value: children,
|
|
@@ -142,7 +144,7 @@ export var TypeString = _ref3 => {
|
|
|
142
144
|
style: style
|
|
143
145
|
}))), child || /*#__PURE__*/_jsxs(Fragment, {
|
|
144
146
|
children: [/*#__PURE__*/_jsx(ValueQuote, {}), /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
145
|
-
className:
|
|
147
|
+
className: cls,
|
|
146
148
|
children: text
|
|
147
149
|
})), /*#__PURE__*/_jsx(ValueQuote, {})]
|
|
148
150
|
})]
|
|
@@ -404,11 +406,11 @@ export var TypeUrl = _ref9 => {
|
|
|
404
406
|
});
|
|
405
407
|
};
|
|
406
408
|
TypeUrl.displayName = 'JVR.TypeUrl';
|
|
407
|
-
export var TypeDate =
|
|
409
|
+
export var TypeDate = _ref0 => {
|
|
408
410
|
var {
|
|
409
411
|
children,
|
|
410
412
|
keyName
|
|
411
|
-
} =
|
|
413
|
+
} = _ref0;
|
|
412
414
|
var {
|
|
413
415
|
Date: CompData = {},
|
|
414
416
|
displayDataTypes
|
|
@@ -417,7 +419,7 @@ export var TypeDate = _ref10 => {
|
|
|
417
419
|
as,
|
|
418
420
|
render
|
|
419
421
|
} = CompData,
|
|
420
|
-
reset = _objectWithoutPropertiesLoose(CompData,
|
|
422
|
+
reset = _objectWithoutPropertiesLoose(CompData, _excluded0);
|
|
421
423
|
var Comp = as || 'span';
|
|
422
424
|
var style = _extends({}, defalutStyle, CompData.style || {});
|
|
423
425
|
var isRender = render && typeof render === 'function';
|
|
@@ -447,11 +449,11 @@ export var TypeDate = _ref10 => {
|
|
|
447
449
|
});
|
|
448
450
|
};
|
|
449
451
|
TypeDate.displayName = 'JVR.TypeDate';
|
|
450
|
-
export var TypeUndefined =
|
|
452
|
+
export var TypeUndefined = _ref1 => {
|
|
451
453
|
var {
|
|
452
454
|
children,
|
|
453
455
|
keyName
|
|
454
|
-
} =
|
|
456
|
+
} = _ref1;
|
|
455
457
|
var {
|
|
456
458
|
Undefined = {},
|
|
457
459
|
displayDataTypes
|
|
@@ -460,7 +462,7 @@ export var TypeUndefined = _ref11 => {
|
|
|
460
462
|
as,
|
|
461
463
|
render
|
|
462
464
|
} = Undefined,
|
|
463
|
-
reset = _objectWithoutPropertiesLoose(Undefined,
|
|
465
|
+
reset = _objectWithoutPropertiesLoose(Undefined, _excluded1);
|
|
464
466
|
var Comp = as || 'span';
|
|
465
467
|
var style = _extends({}, defalutStyle, Undefined.style || {});
|
|
466
468
|
var isRender = render && typeof render === 'function';
|
|
@@ -486,11 +488,11 @@ export var TypeUndefined = _ref11 => {
|
|
|
486
488
|
});
|
|
487
489
|
};
|
|
488
490
|
TypeUndefined.displayName = 'JVR.TypeUndefined';
|
|
489
|
-
export var TypeNull =
|
|
491
|
+
export var TypeNull = _ref10 => {
|
|
490
492
|
var {
|
|
491
493
|
children,
|
|
492
494
|
keyName
|
|
493
|
-
} =
|
|
495
|
+
} = _ref10;
|
|
494
496
|
var {
|
|
495
497
|
Null = {},
|
|
496
498
|
displayDataTypes
|
|
@@ -499,7 +501,7 @@ export var TypeNull = _ref12 => {
|
|
|
499
501
|
as,
|
|
500
502
|
render
|
|
501
503
|
} = Null,
|
|
502
|
-
reset = _objectWithoutPropertiesLoose(Null,
|
|
504
|
+
reset = _objectWithoutPropertiesLoose(Null, _excluded10);
|
|
503
505
|
var Comp = as || 'span';
|
|
504
506
|
var style = _extends({}, defalutStyle, Null.style || {});
|
|
505
507
|
var isRender = render && typeof render === 'function';
|
|
@@ -525,11 +527,11 @@ export var TypeNull = _ref12 => {
|
|
|
525
527
|
});
|
|
526
528
|
};
|
|
527
529
|
TypeNull.displayName = 'JVR.TypeNull';
|
|
528
|
-
export var TypeNan =
|
|
530
|
+
export var TypeNan = _ref11 => {
|
|
529
531
|
var {
|
|
530
532
|
children,
|
|
531
533
|
keyName
|
|
532
|
-
} =
|
|
534
|
+
} = _ref11;
|
|
533
535
|
var {
|
|
534
536
|
Nan = {},
|
|
535
537
|
displayDataTypes
|
|
@@ -538,7 +540,7 @@ export var TypeNan = _ref13 => {
|
|
|
538
540
|
as,
|
|
539
541
|
render
|
|
540
542
|
} = Nan,
|
|
541
|
-
reset = _objectWithoutPropertiesLoose(Nan,
|
|
543
|
+
reset = _objectWithoutPropertiesLoose(Nan, _excluded11);
|
|
542
544
|
var Comp = as || 'span';
|
|
543
545
|
var style = _extends({}, defalutStyle, Nan.style || {});
|
|
544
546
|
var isRender = render && typeof render === 'function';
|
package/esm/utils/useRender.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import { useEffect } from 'react';
|
|
3
|
-
import { useSymbolsDispatch } from
|
|
4
|
-
import { useTypesDispatch } from
|
|
5
|
-
import { useSectionDispatch } from
|
|
3
|
+
import { useSymbolsDispatch } from "../store/Symbols.js";
|
|
4
|
+
import { useTypesDispatch } from "../store/Types.js";
|
|
5
|
+
import { useSectionDispatch } from "../store/Section.js";
|
|
6
6
|
export function useSymbolsRender(currentProps, props, key) {
|
|
7
7
|
var dispatch = useSymbolsDispatch();
|
|
8
8
|
var cls = [currentProps.className, props.className].filter(Boolean).join(' ');
|