@uiw/react-json-view 1.8.5 → 1.10.0
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 +33 -9
- package/cjs/editor/countInfoExtra.js +9 -14
- package/cjs/editor/index.d.ts +1 -1
- package/cjs/editor/objectKey.js +5 -7
- package/cjs/editor/value.js +9 -15
- package/cjs/index.d.ts +3 -0
- package/cjs/index.js +12 -0
- package/cjs/node.js +4 -1
- package/cjs/theme/dark.d.ts +2 -24
- package/cjs/theme/dark.js +1 -1
- package/cjs/theme/github.dark.d.ts +2 -0
- package/cjs/theme/github.dark.js +32 -0
- package/cjs/theme/github.light.d.ts +2 -0
- package/cjs/theme/github.light.js +32 -0
- package/cjs/theme/gruvbox.d.ts +2 -0
- package/cjs/theme/gruvbox.js +32 -0
- package/cjs/theme/light.d.ts +2 -24
- package/cjs/theme/light.js +1 -0
- package/cjs/theme/monokai.d.ts +2 -0
- package/cjs/theme/monokai.js +32 -0
- package/cjs/theme/nord.d.ts +2 -0
- package/cjs/theme/nord.js +32 -0
- package/cjs/theme/vscode.d.ts +2 -0
- package/cjs/theme/vscode.js +32 -0
- package/cjs/value.d.ts +1 -0
- package/cjs/value.js +88 -30
- package/dark.d.ts +1 -17
- package/esm/editor/countInfoExtra.js +9 -14
- package/esm/editor/index.d.ts +1 -1
- package/esm/editor/objectKey.js +5 -7
- package/esm/editor/value.js +9 -15
- package/esm/index.d.ts +3 -0
- package/esm/index.js +1 -0
- package/esm/node.js +3 -1
- package/esm/theme/dark.d.ts +2 -24
- package/esm/theme/dark.js +1 -1
- package/esm/theme/github.dark.d.ts +2 -0
- package/esm/theme/github.dark.js +25 -0
- package/esm/theme/github.light.d.ts +2 -0
- package/esm/theme/github.light.js +25 -0
- package/esm/theme/gruvbox.d.ts +2 -0
- package/esm/theme/gruvbox.js +25 -0
- package/esm/theme/light.d.ts +2 -24
- package/esm/theme/light.js +1 -0
- package/esm/theme/monokai.d.ts +2 -0
- package/esm/theme/monokai.js +25 -0
- package/esm/theme/nord.d.ts +2 -0
- package/esm/theme/nord.js +25 -0
- package/esm/theme/vscode.d.ts +2 -0
- package/esm/theme/vscode.js +25 -0
- package/esm/value.d.ts +1 -0
- package/esm/value.js +80 -21
- package/light.d.ts +1 -17
- package/package.json +31 -1
package/README.md
CHANGED
|
@@ -85,20 +85,38 @@ import React from 'react';
|
|
|
85
85
|
import JsonView from '@uiw/react-json-view';
|
|
86
86
|
import { lightTheme } from '@uiw/react-json-view/light';
|
|
87
87
|
import { darkTheme } from '@uiw/react-json-view/dark';
|
|
88
|
+
import { nordTheme } from '@uiw/react-json-view/nord';
|
|
89
|
+
import { githubLightTheme } from '@uiw/react-json-view/githubLight';
|
|
90
|
+
import { githubDarkTheme } from '@uiw/react-json-view/githubDark';
|
|
91
|
+
import { vscodeTheme } from '@uiw/react-json-view/vscode';
|
|
92
|
+
import { gruvboxTheme } from '@uiw/react-json-view/gruvbox';
|
|
93
|
+
import { monokaiTheme } from '@uiw/react-json-view/monokai';
|
|
88
94
|
|
|
89
95
|
const object = {
|
|
90
96
|
string: 'Lorem ipsum dolor sit amet',
|
|
91
97
|
integer: 42,
|
|
92
98
|
float: 114.514,
|
|
99
|
+
boolean: true,
|
|
100
|
+
null: null,
|
|
101
|
+
nan: NaN,
|
|
102
|
+
url: new URL('https://example.com'),
|
|
93
103
|
}
|
|
94
104
|
|
|
105
|
+
const style = { display: 'grid', gap: '1rem', gridTemplateColumns: 'repeat(auto-fill, minmax(250px, 1fr))' };
|
|
106
|
+
|
|
95
107
|
export default function Demo() {
|
|
96
108
|
return (
|
|
97
|
-
<
|
|
109
|
+
<div style={style}>
|
|
98
110
|
<JsonView value={object} style={darkTheme} />
|
|
99
111
|
<JsonView value={object} style={lightTheme} />
|
|
100
|
-
|
|
101
|
-
|
|
112
|
+
<JsonView value={object} style={nordTheme} />
|
|
113
|
+
<JsonView value={object} style={githubLightTheme} />
|
|
114
|
+
<JsonView value={object} style={githubDarkTheme} />
|
|
115
|
+
<JsonView value={object} style={gruvboxTheme} />
|
|
116
|
+
<JsonView value={object} style={vscodeTheme} />
|
|
117
|
+
<JsonView value={object} style={monokaiTheme} />
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
102
120
|
}
|
|
103
121
|
```
|
|
104
122
|
|
|
@@ -200,6 +218,7 @@ const customTheme = {
|
|
|
200
218
|
'--w-rjv-copied-success-color': '#28a745',
|
|
201
219
|
|
|
202
220
|
'--w-rjv-curlybraces-color': '#d4d4d4',
|
|
221
|
+
'--w-rjv-colon-color': '#f8f8f2',
|
|
203
222
|
'--w-rjv-brackets-color': '#d4d4d4',
|
|
204
223
|
|
|
205
224
|
'--w-rjv-type-string-color': '#ce9178',
|
|
@@ -452,8 +471,9 @@ export default function Demo() {
|
|
|
452
471
|
## Editor JSON
|
|
453
472
|
|
|
454
473
|
```tsx mdx:preview
|
|
455
|
-
import React from 'react';
|
|
474
|
+
import React, { useRef } from 'react';
|
|
456
475
|
import JsonViewEditor from '@uiw/react-json-view/editor';
|
|
476
|
+
import { type SemicolonProps, useHighlight } from '@uiw/react-json-view';
|
|
457
477
|
|
|
458
478
|
const object = {
|
|
459
479
|
string: 'Lorem ipsum dolor sit amet',
|
|
@@ -472,12 +492,14 @@ const object = {
|
|
|
472
492
|
nestedArray: [ [1, 2], [3, 4], { a: 1} ],
|
|
473
493
|
}
|
|
474
494
|
|
|
475
|
-
const ObjectKey = ({ value, keyName, parentName,
|
|
495
|
+
const ObjectKey: SemicolonProps['render'] = ({ value, keyName, parentName, ...props }) => {
|
|
496
|
+
const $edit = useRef<HTMLSpanElement & HTMLModElement>(null);
|
|
497
|
+
useHighlight({ value, highlightUpdates: true, highlightContainer: $edit });
|
|
476
498
|
if (keyName === 'integer' && typeof value === 'number' && value > 40) {
|
|
477
|
-
return <del {...
|
|
499
|
+
return <del {...props} ref={$edit} />;
|
|
478
500
|
}
|
|
479
|
-
return <span {...
|
|
480
|
-
}
|
|
501
|
+
return <span {...props} ref={$edit} />;
|
|
502
|
+
}
|
|
481
503
|
|
|
482
504
|
export default function Demo() {
|
|
483
505
|
return (
|
|
@@ -663,6 +685,8 @@ export interface JsonViewProps<T> extends React.DetailedHTMLProps<React.HTMLAttr
|
|
|
663
685
|
displayDataTypes?: boolean;
|
|
664
686
|
/** When set to `true`, `objects` and `arrays` are labeled with size @default true */
|
|
665
687
|
displayObjectSize?: boolean;
|
|
688
|
+
/** Shorten long JSON strings, Set to `0` to disable this feature @default 20 */
|
|
689
|
+
shortenTextAfterLength?: number;
|
|
666
690
|
/** Define the root node name. @default undefined */
|
|
667
691
|
keyName?: string | number;
|
|
668
692
|
/** The user can copy objects and arrays to clipboard by clicking on the clipboard icon. @default true */
|
|
@@ -721,7 +745,7 @@ export interface CountInfoProps {
|
|
|
721
745
|
```ts
|
|
722
746
|
import { JsonViewProps } from '@uiw/react-json-view';
|
|
723
747
|
import type { CountInfoExtraProps } from '@uiw/react-json-view/cjs/editor/countInfoExtra';
|
|
724
|
-
export interface JsonViewEditorProps<T extends object> extends JsonViewProps<T> {
|
|
748
|
+
export interface JsonViewEditorProps<T extends object> extends Omit<JsonViewProps<T>, 'shortenTextAfterLength'> {
|
|
725
749
|
/**
|
|
726
750
|
* When a callback function is passed in, edit functionality is enabled. The callback is invoked before edits are completed.
|
|
727
751
|
* @returns {boolean} Returning false from onEdit will prevent the change from being made.
|
|
@@ -15,6 +15,7 @@ var _add = require("./icon/add");
|
|
|
15
15
|
var _delete = require("./icon/delete");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
function CountInfoExtra(props) {
|
|
18
|
+
var _ref, _ref2;
|
|
18
19
|
var visible = props.visible,
|
|
19
20
|
showTools = props.showTools,
|
|
20
21
|
editable = props.editable,
|
|
@@ -27,8 +28,8 @@ function CountInfoExtra(props) {
|
|
|
27
28
|
onAdd = props.onAdd,
|
|
28
29
|
onDelete = props.onDelete;
|
|
29
30
|
if (!visible || !showTools) return null;
|
|
30
|
-
var click =
|
|
31
|
-
|
|
31
|
+
var click = function click(_x) {
|
|
32
|
+
return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee(event) {
|
|
32
33
|
var keyOrValue, isArray, isAdd, result, maybeAdd;
|
|
33
34
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
|
|
34
35
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -54,13 +55,10 @@ function CountInfoExtra(props) {
|
|
|
54
55
|
return _context.stop();
|
|
55
56
|
}
|
|
56
57
|
}, _callee);
|
|
57
|
-
}));
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}();
|
|
62
|
-
var deleteHandle = /*#__PURE__*/function () {
|
|
63
|
-
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2(event) {
|
|
58
|
+
}))).apply(this, arguments);
|
|
59
|
+
};
|
|
60
|
+
var deleteHandle = function deleteHandle(_x2) {
|
|
61
|
+
return (_ref2 = _ref2 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2(event) {
|
|
64
62
|
var maybeDelete;
|
|
65
63
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
|
|
66
64
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -90,11 +88,8 @@ function CountInfoExtra(props) {
|
|
|
90
88
|
return _context2.stop();
|
|
91
89
|
}
|
|
92
90
|
}, _callee2);
|
|
93
|
-
}));
|
|
94
|
-
|
|
95
|
-
return _ref2.apply(this, arguments);
|
|
96
|
-
};
|
|
97
|
-
}();
|
|
91
|
+
}))).apply(this, arguments);
|
|
92
|
+
};
|
|
98
93
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
99
94
|
children: [editable && onAdd && /*#__PURE__*/(0, _jsxRuntime.jsx)(_add.AddIcon, {
|
|
100
95
|
onClick: click
|
package/cjs/editor/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { JsonViewProps } from '../';
|
|
3
3
|
import type { CountInfoExtraProps } from './countInfoExtra';
|
|
4
|
-
export interface JsonViewEditorProps<T extends object> extends JsonViewProps<T> {
|
|
4
|
+
export interface JsonViewEditorProps<T extends object> extends Omit<JsonViewProps<T>, 'shortenTextAfterLength'> {
|
|
5
5
|
/**
|
|
6
6
|
* When a callback function is passed in, edit functionality is enabled. The callback is invoked before edits are completed.
|
|
7
7
|
* @returns {boolean} Returning false from onEdit will prevent the change from being made.
|
package/cjs/editor/objectKey.js
CHANGED
|
@@ -16,6 +16,7 @@ var _value = require("../value");
|
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
var _excluded = ["className", "value", "keyName", "parentName", "quotes", "label", "namespace", "editableValue", "onEdit", "highlightUpdates", "render"];
|
|
18
18
|
var ObjectKey = function ObjectKey(props) {
|
|
19
|
+
var _ref;
|
|
19
20
|
var className = props.className,
|
|
20
21
|
value = props.value,
|
|
21
22
|
keyName = props.keyName,
|
|
@@ -58,8 +59,8 @@ var ObjectKey = function ObjectKey(props) {
|
|
|
58
59
|
(_$edit$current = $edit.current) === null || _$edit$current === void 0 || _$edit$current.focus();
|
|
59
60
|
}
|
|
60
61
|
};
|
|
61
|
-
var blur =
|
|
62
|
-
|
|
62
|
+
var blur = function blur() {
|
|
63
|
+
return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
63
64
|
var _$edit$current2, result;
|
|
64
65
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
|
|
65
66
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -98,11 +99,8 @@ var ObjectKey = function ObjectKey(props) {
|
|
|
98
99
|
return _context.stop();
|
|
99
100
|
}
|
|
100
101
|
}, _callee);
|
|
101
|
-
}));
|
|
102
|
-
|
|
103
|
-
return _ref.apply(this, arguments);
|
|
104
|
-
};
|
|
105
|
-
}();
|
|
102
|
+
}))).apply(this, arguments);
|
|
103
|
+
};
|
|
106
104
|
var focus = function focus() {
|
|
107
105
|
if ($edit.current) {
|
|
108
106
|
var _$edit$current3;
|
package/cjs/editor/value.js
CHANGED
|
@@ -27,7 +27,7 @@ var Quotes = function Quotes(_ref) {
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
function ReValue(props) {
|
|
30
|
-
var _typeMap$typeStr;
|
|
30
|
+
var _ref2, _typeMap$typeStr, _ref3;
|
|
31
31
|
var type = props.type,
|
|
32
32
|
value = props.value,
|
|
33
33
|
setValue = props.setValue,
|
|
@@ -81,8 +81,8 @@ function ReValue(props) {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
|
-
var blur =
|
|
85
|
-
|
|
84
|
+
var blur = function blur() {
|
|
85
|
+
return (_ref2 = _ref2 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
86
86
|
var text, _typeStr, dt, result, _getValueString, oldChildStr;
|
|
87
87
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
|
|
88
88
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -158,11 +158,8 @@ function ReValue(props) {
|
|
|
158
158
|
return _context.stop();
|
|
159
159
|
}
|
|
160
160
|
}, _callee);
|
|
161
|
-
}));
|
|
162
|
-
|
|
163
|
-
return _ref2.apply(this, arguments);
|
|
164
|
-
};
|
|
165
|
-
}();
|
|
161
|
+
}))).apply(this, arguments);
|
|
162
|
+
};
|
|
166
163
|
var defaultStyle = {
|
|
167
164
|
minWidth: 34,
|
|
168
165
|
minHeight: 18,
|
|
@@ -189,8 +186,8 @@ function ReValue(props) {
|
|
|
189
186
|
if (typeStr === 'null' || typeStr === 'undefined') {
|
|
190
187
|
typeView = /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {});
|
|
191
188
|
}
|
|
192
|
-
var deleteHandle =
|
|
193
|
-
|
|
189
|
+
var deleteHandle = function deleteHandle(_x) {
|
|
190
|
+
return (_ref3 = _ref3 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2(evn) {
|
|
194
191
|
var maybeDelete;
|
|
195
192
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
|
|
196
193
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -215,11 +212,8 @@ function ReValue(props) {
|
|
|
215
212
|
return _context2.stop();
|
|
216
213
|
}
|
|
217
214
|
}, _callee2);
|
|
218
|
-
}));
|
|
219
|
-
|
|
220
|
-
return _ref3.apply(this, arguments);
|
|
221
|
-
};
|
|
222
|
-
}();
|
|
215
|
+
}))).apply(this, arguments);
|
|
216
|
+
};
|
|
223
217
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
224
218
|
children: [displayDataTypes && typeView, /*#__PURE__*/(0, _jsxRuntime.jsx)(Quotes, {
|
|
225
219
|
style: style,
|
package/cjs/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { MetaProps } from './comps/meta';
|
|
|
7
7
|
import type { CountInfoExtraProps } from './editor/countInfoExtra';
|
|
8
8
|
export * from './node';
|
|
9
9
|
export * from './value';
|
|
10
|
+
export * from './semicolon';
|
|
10
11
|
export interface CountInfoProps {
|
|
11
12
|
count: number;
|
|
12
13
|
level: number;
|
|
@@ -32,6 +33,8 @@ export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps
|
|
|
32
33
|
displayDataTypes?: boolean;
|
|
33
34
|
/** When set to `true`, `objects` and `arrays` are labeled with size @default true */
|
|
34
35
|
displayObjectSize?: boolean;
|
|
36
|
+
/** Shorten long JSON strings, Set to `0` to disable this feature @default 20 */
|
|
37
|
+
shortenTextAfterLength?: number;
|
|
35
38
|
/** Define the root node name. @default undefined */
|
|
36
39
|
keyName?: string | number;
|
|
37
40
|
/** The user can copy objects and arrays to clipboard by clicking on the clipboard icon. @default true */
|
package/cjs/index.js
CHANGED
|
@@ -35,6 +35,18 @@ Object.keys(_value).forEach(function (key) {
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
|
+
var _semicolon = require("./semicolon");
|
|
39
|
+
Object.keys(_semicolon).forEach(function (key) {
|
|
40
|
+
if (key === "default" || key === "__esModule") return;
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
42
|
+
if (key in exports && exports[key] === _semicolon[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function get() {
|
|
46
|
+
return _semicolon[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
38
50
|
var _excluded = ["value", "style", "className"];
|
|
39
51
|
var JsonView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
40
52
|
var value = props.value,
|
package/cjs/node.js
CHANGED
|
@@ -19,7 +19,7 @@ var _copied = require("./copied");
|
|
|
19
19
|
var _ellipsis = require("./comps/ellipsis");
|
|
20
20
|
var _meta = require("./comps/meta");
|
|
21
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
var _excluded = ["value", "keyName", "className", "displayDataTypes", "components", "displayObjectSize", "enableClipboard", "highlightUpdates", "objectSortKeys", "indentWidth", "collapsed", "level", "keyid", "quotes", "namespace", "onCopied", "onExpand", "parentValue", "setParentValue"];
|
|
22
|
+
var _excluded = ["value", "keyName", "className", "displayDataTypes", "components", "displayObjectSize", "enableClipboard", "highlightUpdates", "objectSortKeys", "indentWidth", "shortenTextAfterLength", "collapsed", "level", "keyid", "quotes", "namespace", "onCopied", "onExpand", "parentValue", "setParentValue"];
|
|
23
23
|
function getLength(obj) {
|
|
24
24
|
try {
|
|
25
25
|
return Object.keys(obj).length;
|
|
@@ -61,6 +61,8 @@ var RootNode = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
61
61
|
objectSortKeys = _props$objectSortKeys === void 0 ? false : _props$objectSortKeys,
|
|
62
62
|
_props$indentWidth = props.indentWidth,
|
|
63
63
|
indentWidth = _props$indentWidth === void 0 ? 15 : _props$indentWidth,
|
|
64
|
+
_props$shortenTextAft = props.shortenTextAfterLength,
|
|
65
|
+
shortenTextAfterLength = _props$shortenTextAft === void 0 ? 20 : _props$shortenTextAft,
|
|
64
66
|
collapsed = props.collapsed,
|
|
65
67
|
_props$level = props.level,
|
|
66
68
|
level = _props$level === void 0 ? 1 : _props$level,
|
|
@@ -114,6 +116,7 @@ var RootNode = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
114
116
|
displayDataTypes: displayDataTypes,
|
|
115
117
|
displayObjectSize: displayObjectSize,
|
|
116
118
|
enableClipboard: enableClipboard,
|
|
119
|
+
shortenTextAfterLength: shortenTextAfterLength,
|
|
117
120
|
level: level + 1,
|
|
118
121
|
parentValue: value,
|
|
119
122
|
indentWidth: indentWidth,
|
package/cjs/theme/dark.d.ts
CHANGED
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
'--w-rjv-color': string;
|
|
4
|
-
'--w-rjv-background-color': string;
|
|
5
|
-
'--w-rjv-line-color': string;
|
|
6
|
-
'--w-rjv-arrow-color': string;
|
|
7
|
-
'--w-rjv-edit-color': string;
|
|
8
|
-
'--w-rjv-info-color': string;
|
|
9
|
-
'--w-rjv-update-color': string;
|
|
10
|
-
'--w-rjv-copied-color': string;
|
|
11
|
-
'--w-rjv-copied-success-color': string;
|
|
12
|
-
'--w-rjv-curlybraces-color': string;
|
|
13
|
-
'--w-rjv-brackets-color': string;
|
|
14
|
-
'--w-rjv-type-string-color': string;
|
|
15
|
-
'--w-rjv-type-int-color': string;
|
|
16
|
-
'--w-rjv-type-float-color': string;
|
|
17
|
-
'--w-rjv-type-bigint-color': string;
|
|
18
|
-
'--w-rjv-type-boolean-color': string;
|
|
19
|
-
'--w-rjv-type-date-color': string;
|
|
20
|
-
'--w-rjv-type-url-color': string;
|
|
21
|
-
'--w-rjv-type-null-color': string;
|
|
22
|
-
'--w-rjv-type-nan-color': string;
|
|
23
|
-
'--w-rjv-type-undefined-color': string;
|
|
24
|
-
};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const darkTheme: import("react").CSSProperties;
|
package/cjs/theme/dark.js
CHANGED
|
@@ -25,7 +25,7 @@ var darkTheme = {
|
|
|
25
25
|
'--w-rjv-type-date-color': '#586e75',
|
|
26
26
|
'--w-rjv-type-url-color': '#649bd8',
|
|
27
27
|
'--w-rjv-type-null-color': '#d33682',
|
|
28
|
-
'--w-rjv-type-nan-color': '#
|
|
28
|
+
'--w-rjv-type-nan-color': '#076678',
|
|
29
29
|
'--w-rjv-type-undefined-color': '#586e75'
|
|
30
30
|
};
|
|
31
31
|
exports.darkTheme = darkTheme;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.githubDarkTheme = void 0;
|
|
7
|
+
var githubDarkTheme = {
|
|
8
|
+
'--w-rjv-font-family': 'monospace',
|
|
9
|
+
'--w-rjv-color': '#79c0ff',
|
|
10
|
+
'--w-rjv-background-color': '#0d1117',
|
|
11
|
+
'--w-rjv-line-color': '#94949480',
|
|
12
|
+
'--w-rjv-arrow-color': '#ccc',
|
|
13
|
+
'--w-rjv-edit-color': 'var(--w-rjv-color)',
|
|
14
|
+
'--w-rjv-info-color': '#7b7b7b',
|
|
15
|
+
'--w-rjv-update-color': '#ebcb8b',
|
|
16
|
+
'--w-rjv-copied-color': '#79c0ff',
|
|
17
|
+
'--w-rjv-copied-success-color': '#28a745',
|
|
18
|
+
'--w-rjv-curlybraces-color': '#8b949e',
|
|
19
|
+
'--w-rjv-colon-color': '#c9d1d9',
|
|
20
|
+
'--w-rjv-brackets-color': '#8b949e',
|
|
21
|
+
'--w-rjv-type-string-color': '#a5d6ff',
|
|
22
|
+
'--w-rjv-type-int-color': '#79c0ff',
|
|
23
|
+
'--w-rjv-type-float-color': '#79c0ff',
|
|
24
|
+
'--w-rjv-type-bigint-color': '#79c0ff',
|
|
25
|
+
'--w-rjv-type-boolean-color': '#ffab70',
|
|
26
|
+
'--w-rjv-type-date-color': '#79c0ff',
|
|
27
|
+
'--w-rjv-type-url-color': '#4facff',
|
|
28
|
+
'--w-rjv-type-null-color': '#ff7b72',
|
|
29
|
+
'--w-rjv-type-nan-color': '#859900',
|
|
30
|
+
'--w-rjv-type-undefined-color': '#79c0ff'
|
|
31
|
+
};
|
|
32
|
+
exports.githubDarkTheme = githubDarkTheme;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.githubLightTheme = void 0;
|
|
7
|
+
var githubLightTheme = {
|
|
8
|
+
'--w-rjv-font-family': 'monospace',
|
|
9
|
+
'--w-rjv-color': '#6f42c1',
|
|
10
|
+
'--w-rjv-background-color': '#ffffff',
|
|
11
|
+
'--w-rjv-line-color': '#ddd',
|
|
12
|
+
'--w-rjv-arrow-color': '#6e7781',
|
|
13
|
+
'--w-rjv-edit-color': 'var(--w-rjv-color)',
|
|
14
|
+
'--w-rjv-info-color': '#0000004d',
|
|
15
|
+
'--w-rjv-update-color': '#ebcb8b',
|
|
16
|
+
'--w-rjv-copied-color': '#002b36',
|
|
17
|
+
'--w-rjv-copied-success-color': '#28a745',
|
|
18
|
+
'--w-rjv-curlybraces-color': '#6a737d',
|
|
19
|
+
'--w-rjv-colon-color': '#24292e',
|
|
20
|
+
'--w-rjv-brackets-color': '#6a737d',
|
|
21
|
+
'--w-rjv-type-string-color': '#032f62',
|
|
22
|
+
'--w-rjv-type-int-color': '#005cc5',
|
|
23
|
+
'--w-rjv-type-float-color': '#005cc5',
|
|
24
|
+
'--w-rjv-type-bigint-color': '#005cc5',
|
|
25
|
+
'--w-rjv-type-boolean-color': '#d73a49',
|
|
26
|
+
'--w-rjv-type-date-color': '#005cc5',
|
|
27
|
+
'--w-rjv-type-url-color': '#0969da',
|
|
28
|
+
'--w-rjv-type-null-color': '#d73a49',
|
|
29
|
+
'--w-rjv-type-nan-color': '#859900',
|
|
30
|
+
'--w-rjv-type-undefined-color': '#005cc5'
|
|
31
|
+
};
|
|
32
|
+
exports.githubLightTheme = githubLightTheme;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.gruvboxTheme = void 0;
|
|
7
|
+
var gruvboxTheme = {
|
|
8
|
+
'--w-rjv-font-family': 'monospace',
|
|
9
|
+
'--w-rjv-color': '#3c3836',
|
|
10
|
+
'--w-rjv-background-color': '#fbf1c7',
|
|
11
|
+
'--w-rjv-line-color': '#ebdbb2',
|
|
12
|
+
'--w-rjv-arrow-color': 'var(--w-rjv-color)',
|
|
13
|
+
'--w-rjv-edit-color': 'var(--w-rjv-color)',
|
|
14
|
+
'--w-rjv-info-color': '#0000004d',
|
|
15
|
+
'--w-rjv-update-color': '#ebcb8b',
|
|
16
|
+
'--w-rjv-copied-color': '#002b36',
|
|
17
|
+
'--w-rjv-copied-success-color': '#28a745',
|
|
18
|
+
'--w-rjv-curlybraces-color': '#236a7c',
|
|
19
|
+
'--w-rjv-colon-color': '#002b36',
|
|
20
|
+
'--w-rjv-brackets-color': '#236a7c',
|
|
21
|
+
'--w-rjv-type-string-color': '#3c3836',
|
|
22
|
+
'--w-rjv-type-int-color': '#8f3f71',
|
|
23
|
+
'--w-rjv-type-float-color': '#8f3f71',
|
|
24
|
+
'--w-rjv-type-bigint-color': '#8f3f71',
|
|
25
|
+
'--w-rjv-type-boolean-color': '#8f3f71',
|
|
26
|
+
'--w-rjv-type-date-color': '#076678',
|
|
27
|
+
'--w-rjv-type-url-color': '#0969da',
|
|
28
|
+
'--w-rjv-type-null-color': '#076678',
|
|
29
|
+
'--w-rjv-type-nan-color': '#076678',
|
|
30
|
+
'--w-rjv-type-undefined-color': '#076678'
|
|
31
|
+
};
|
|
32
|
+
exports.gruvboxTheme = gruvboxTheme;
|
package/cjs/theme/light.d.ts
CHANGED
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
'--w-rjv-color': string;
|
|
4
|
-
'--w-rjv-background-color': string;
|
|
5
|
-
'--w-rjv-line-color': string;
|
|
6
|
-
'--w-rjv-arrow-color': string;
|
|
7
|
-
'--w-rjv-edit-color': string;
|
|
8
|
-
'--w-rjv-info-color': string;
|
|
9
|
-
'--w-rjv-update-color': string;
|
|
10
|
-
'--w-rjv-copied-color': string;
|
|
11
|
-
'--w-rjv-copied-success-color': string;
|
|
12
|
-
'--w-rjv-curlybraces-color': string;
|
|
13
|
-
'--w-rjv-brackets-color': string;
|
|
14
|
-
'--w-rjv-type-string-color': string;
|
|
15
|
-
'--w-rjv-type-int-color': string;
|
|
16
|
-
'--w-rjv-type-float-color': string;
|
|
17
|
-
'--w-rjv-type-bigint-color': string;
|
|
18
|
-
'--w-rjv-type-boolean-color': string;
|
|
19
|
-
'--w-rjv-type-date-color': string;
|
|
20
|
-
'--w-rjv-type-url-color': string;
|
|
21
|
-
'--w-rjv-type-null-color': string;
|
|
22
|
-
'--w-rjv-type-nan-color': string;
|
|
23
|
-
'--w-rjv-type-undefined-color': string;
|
|
24
|
-
};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const lightTheme: import("react").CSSProperties;
|
package/cjs/theme/light.js
CHANGED
|
@@ -16,6 +16,7 @@ var lightTheme = {
|
|
|
16
16
|
'--w-rjv-copied-color': '#002b36',
|
|
17
17
|
'--w-rjv-copied-success-color': '#28a745',
|
|
18
18
|
'--w-rjv-curlybraces-color': '#236a7c',
|
|
19
|
+
'--w-rjv-colon-color': '#002b36',
|
|
19
20
|
'--w-rjv-brackets-color': '#236a7c',
|
|
20
21
|
'--w-rjv-type-string-color': '#cb4b16',
|
|
21
22
|
'--w-rjv-type-int-color': '#268bd2',
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.monokaiTheme = void 0;
|
|
7
|
+
var monokaiTheme = {
|
|
8
|
+
'--w-rjv-font-family': 'monospace',
|
|
9
|
+
'--w-rjv-color': '#E6DB74',
|
|
10
|
+
'--w-rjv-background-color': '#272822',
|
|
11
|
+
'--w-rjv-line-color': '#3e3d32',
|
|
12
|
+
'--w-rjv-arrow-color': '#f8f8f2',
|
|
13
|
+
'--w-rjv-edit-color': 'var(--w-rjv-color)',
|
|
14
|
+
'--w-rjv-info-color': '#cecece4d',
|
|
15
|
+
'--w-rjv-update-color': '#5f5600',
|
|
16
|
+
'--w-rjv-copied-color': '#E6DB74',
|
|
17
|
+
'--w-rjv-copied-success-color': '#28a745',
|
|
18
|
+
'--w-rjv-curlybraces-color': '#f8f8f2',
|
|
19
|
+
'--w-rjv-colon-color': '#f8f8f2',
|
|
20
|
+
'--w-rjv-brackets-color': '#f8f8f2',
|
|
21
|
+
'--w-rjv-type-string-color': '#E6DB74',
|
|
22
|
+
'--w-rjv-type-int-color': '#AE81FF',
|
|
23
|
+
'--w-rjv-type-float-color': '#AE81FF',
|
|
24
|
+
'--w-rjv-type-bigint-color': '#AE81FF',
|
|
25
|
+
'--w-rjv-type-boolean-color': '#AE81FF',
|
|
26
|
+
'--w-rjv-type-date-color': '#fd9720c7',
|
|
27
|
+
'--w-rjv-type-url-color': '#55a3ff',
|
|
28
|
+
'--w-rjv-type-null-color': '#FA2672',
|
|
29
|
+
'--w-rjv-type-nan-color': '#FD971F',
|
|
30
|
+
'--w-rjv-type-undefined-color': '#FD971F'
|
|
31
|
+
};
|
|
32
|
+
exports.monokaiTheme = monokaiTheme;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.nordTheme = void 0;
|
|
7
|
+
var nordTheme = {
|
|
8
|
+
'--w-rjv-font-family': 'monospace',
|
|
9
|
+
'--w-rjv-color': '#88c0d0',
|
|
10
|
+
'--w-rjv-background-color': '#2e3440',
|
|
11
|
+
'--w-rjv-line-color': '#4c566a',
|
|
12
|
+
'--w-rjv-arrow-color': 'var(--w-rjv-color)',
|
|
13
|
+
'--w-rjv-edit-color': 'var(--w-rjv-color)',
|
|
14
|
+
'--w-rjv-info-color': '#c7c7c74d',
|
|
15
|
+
'--w-rjv-update-color': '#88c0cf75',
|
|
16
|
+
'--w-rjv-copied-color': '#119cc0',
|
|
17
|
+
'--w-rjv-copied-success-color': '#28a745',
|
|
18
|
+
'--w-rjv-curlybraces-color': '#8fbcbb',
|
|
19
|
+
'--w-rjv-colon-color': '#6d9fac',
|
|
20
|
+
'--w-rjv-brackets-color': '#8fbcbb',
|
|
21
|
+
'--w-rjv-type-string-color': '#a3be8c',
|
|
22
|
+
'--w-rjv-type-int-color': '#b48ead',
|
|
23
|
+
'--w-rjv-type-float-color': '#859900',
|
|
24
|
+
'--w-rjv-type-bigint-color': '#b48ead',
|
|
25
|
+
'--w-rjv-type-boolean-color': '#d08770',
|
|
26
|
+
'--w-rjv-type-date-color': '#41a2c2',
|
|
27
|
+
'--w-rjv-type-url-color': '#5e81ac',
|
|
28
|
+
'--w-rjv-type-null-color': '#5e81ac',
|
|
29
|
+
'--w-rjv-type-nan-color': '#859900',
|
|
30
|
+
'--w-rjv-type-undefined-color': '#586e75'
|
|
31
|
+
};
|
|
32
|
+
exports.nordTheme = nordTheme;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.vscodeTheme = void 0;
|
|
7
|
+
var vscodeTheme = {
|
|
8
|
+
'--w-rjv-font-family': 'monospace',
|
|
9
|
+
'--w-rjv-color': '#9cdcfe',
|
|
10
|
+
'--w-rjv-background-color': '#1e1e1e',
|
|
11
|
+
'--w-rjv-line-color': '#36334280',
|
|
12
|
+
'--w-rjv-arrow-color': '#838383',
|
|
13
|
+
'--w-rjv-edit-color': 'var(--w-rjv-color)',
|
|
14
|
+
'--w-rjv-info-color': '#9c9c9c7a',
|
|
15
|
+
'--w-rjv-update-color': '#9cdcfe',
|
|
16
|
+
'--w-rjv-copied-color': '#9cdcfe',
|
|
17
|
+
'--w-rjv-copied-success-color': '#28a745',
|
|
18
|
+
'--w-rjv-curlybraces-color': '#d4d4d4',
|
|
19
|
+
'--w-rjv-colon-color': '#d4d4d4',
|
|
20
|
+
'--w-rjv-brackets-color': '#d4d4d4',
|
|
21
|
+
'--w-rjv-type-string-color': '#ce9178',
|
|
22
|
+
'--w-rjv-type-int-color': '#b5cea8',
|
|
23
|
+
'--w-rjv-type-float-color': '#b5cea8',
|
|
24
|
+
'--w-rjv-type-bigint-color': '#b5cea8',
|
|
25
|
+
'--w-rjv-type-boolean-color': '#569cd6',
|
|
26
|
+
'--w-rjv-type-date-color': '#b5cea8',
|
|
27
|
+
'--w-rjv-type-url-color': '#3b89cf',
|
|
28
|
+
'--w-rjv-type-null-color': '#569cd6',
|
|
29
|
+
'--w-rjv-type-nan-color': '#859900',
|
|
30
|
+
'--w-rjv-type-undefined-color': '#569cd6'
|
|
31
|
+
};
|
|
32
|
+
exports.vscodeTheme = vscodeTheme;
|
package/cjs/value.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ export interface ValueViewProps<T extends object> extends React.DetailedHTMLProp
|
|
|
55
55
|
enableClipboard: boolean;
|
|
56
56
|
indentWidth: number;
|
|
57
57
|
level?: number;
|
|
58
|
+
shortenTextAfterLength?: JsonViewProps<T>['shortenTextAfterLength'];
|
|
58
59
|
namespace?: Array<string | number>;
|
|
59
60
|
quotes?: JsonViewProps<T>['quotes'];
|
|
60
61
|
components?: JsonViewProps<T>['components'];
|