@uiw/react-json-view 2.0.0-alpha.42 → 2.0.0-alpha.43
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 +48 -30
- package/esm/Container.js +11 -9
- package/esm/arrow/TriangleArrow.js +1 -3
- package/esm/arrow/TriangleSolidArrow.js +1 -3
- package/esm/comps/Copied.js +18 -20
- package/esm/comps/KeyValues.js +34 -35
- package/esm/comps/NestedClose.js +10 -12
- package/esm/comps/NestedOpen.js +12 -14
- package/esm/comps/Value.js +3 -5
- package/esm/editor/KeyName.js +12 -16
- package/esm/editor/index.js +9 -8
- package/esm/index.js +26 -19
- package/esm/section/Copied.js +3 -3
- package/esm/section/CountInfo.js +13 -17
- package/esm/section/CountInfoExtra.js +11 -14
- package/esm/section/Ellipsis.js +11 -15
- package/esm/section/KeyName.js +13 -17
- package/esm/section/Row.js +14 -17
- package/esm/store/Expands.js +3 -5
- package/esm/store/Section.js +3 -5
- package/esm/store/ShowTools.js +3 -5
- package/esm/store/Symbols.js +3 -5
- package/esm/store/Types.js +3 -5
- package/esm/store.js +21 -11
- package/esm/symbol/Arrow.js +3 -3
- package/esm/symbol/BraceLeft.js +3 -3
- package/esm/symbol/BraceRight.js +3 -3
- package/esm/symbol/BracketsLeft.js +3 -3
- package/esm/symbol/BracketsRight.js +3 -3
- package/esm/symbol/Colon.js +3 -3
- package/esm/symbol/Quote.js +3 -3
- package/esm/symbol/ValueQuote.js +3 -3
- package/esm/symbol/index.js +65 -89
- package/esm/types/Bigint.js +3 -3
- package/esm/types/Date.js +3 -3
- package/esm/types/False.js +3 -3
- package/esm/types/Float.js +3 -3
- package/esm/types/Int.js +3 -3
- package/esm/types/Map.js +3 -3
- package/esm/types/Nan.js +3 -3
- package/esm/types/Null.js +3 -3
- package/esm/types/Set.js +3 -3
- package/esm/types/String.js +3 -3
- package/esm/types/True.js +3 -3
- package/esm/types/Undefined.js +3 -3
- package/esm/types/Url.js +3 -3
- package/esm/types/index.js +124 -172
- package/esm/utils/useHighlight.js +3 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,38 +1,56 @@
|
|
|
1
|
+
<div align="center" markdown="1">
|
|
2
|
+
<sup>Special thanks to:</sup>
|
|
3
|
+
<br>
|
|
4
|
+
<br>
|
|
5
|
+
|
|
6
|
+
<a href="https://apps.apple.com/app/apple-store/id6757860829?pt=80185800&ct=jay&mt=8">
|
|
7
|
+
<img alt="SubList" width="400" src="https://jaywcjlove.github.io/sponsor/SubList.jpg">
|
|
8
|
+
</a>
|
|
9
|
+
<br>
|
|
10
|
+
<a href="https://apps.apple.com/app/apple-store/id6757860829?pt=80185800&ct=jay&mt=8">
|
|
11
|
+
SubList - Bill Reminder & Renewal Alerts
|
|
12
|
+
</a>
|
|
13
|
+
<br><br>
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
<hr>
|
|
17
|
+
|
|
1
18
|
<div markdown="1">
|
|
2
19
|
<sup>Using <a href="https://wangchujiang.com/#/app" target="_blank">my app</a> is also a way to <a href="https://wangchujiang.com/#/sponsor" target="_blank">support</a> me:</sup>
|
|
3
20
|
<br>
|
|
4
|
-
<a target="_blank" href="https://
|
|
5
|
-
<a target="_blank" href="https://
|
|
6
|
-
<a target="_blank" href="https://
|
|
7
|
-
<a target="_blank" href="https://
|
|
21
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6766860898" title="Zipora: Zip/RAR/7Z Unarchiver"><img alt="Zipora: Zip/RAR/7Z Unarchiver" height="52" src="https://wangchujiang.com/appicon/zipora.png"></a>
|
|
22
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6758053530" title="Scap: Screenshot & Markup Edit for macOS"><img alt="Scap: Screenshot & Markup Edit" height="52" src="https://wangchujiang.com/appicon/scap.png"></a>
|
|
23
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6757317079" title="Screen Test for macOS"><img alt="Screen Test" height="52" src="https://wangchujiang.com/appicon/screen-test.png"></a>
|
|
24
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6755948110" title="Deskmark for macOS"><img alt="Deskmark" height="52" src="https://wangchujiang.com/appicon/deskmark.png"></a>
|
|
25
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6500434773" title="Keyzer for macOS"><img alt="Keyzer" height="52" src="https://wangchujiang.com/appicon/keyzer.png"></a>
|
|
8
26
|
<a target="_blank" href="https://github.com/jaywcjlove/vidwall-hub" title="Vidwall Hub for macOS"><img alt="Vidwall Hub" height="52" src="https://wangchujiang.com/appicon/vidwall-hub.png"></a>
|
|
9
|
-
<a target="_blank" href="https://
|
|
10
|
-
<a target="_blank" href="https://
|
|
27
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6752624705" title="VidCrop for macOS"><img alt="VidCrop" height="52" src="https://wangchujiang.com/appicon/vidcrop.png"></a>
|
|
28
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6747587746" title="Vidwall for macOS"><img alt="Vidwall" height="52" src="https://wangchujiang.com/appicon/vidwall.png"></a>
|
|
11
29
|
<a target="_blank" href="https://wangchujiang.com/mousio-hint/" title="Mousio Hint for macOS"><img alt="Mousio Hint" height="52" src="https://wangchujiang.com/appicon/mousio-hint.png"></a>
|
|
12
|
-
<a target="_blank" href="https://
|
|
13
|
-
<a target="_blank" href="https://
|
|
14
|
-
<a target="_blank" href="https://
|
|
15
|
-
<a target="_blank" href="https://
|
|
16
|
-
<a target="_blank" href="https://
|
|
17
|
-
<a target="_blank" href="https://
|
|
18
|
-
<a target="_blank" href="https://
|
|
19
|
-
<a target="_blank" href="https://
|
|
20
|
-
<a target="_blank" href="https://
|
|
21
|
-
<a target="_blank" href="https://
|
|
22
|
-
<a target="_blank" href="https://
|
|
23
|
-
<a target="_blank" href="https://
|
|
24
|
-
<a target="_blank" href="https://
|
|
25
|
-
<a target="_blank" href="https://
|
|
26
|
-
<a target="_blank" href="https://
|
|
27
|
-
<a target="_blank" href="https://
|
|
28
|
-
<a target="_blank" href="https://
|
|
29
|
-
<a target="_blank" href="https://
|
|
30
|
-
<a target="_blank" href="https://
|
|
31
|
-
<a target="_blank" href="https://
|
|
32
|
-
<a target="_blank" href="https://
|
|
33
|
-
<a target="_blank" href="https://
|
|
34
|
-
<a target="_blank" href="https://
|
|
35
|
-
<a target="_blank" href="https://
|
|
30
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6746747327" title="Mousio for macOS"><img alt="Mousio" height="52" src="https://wangchujiang.com/appicon/mousio.png"></a>
|
|
31
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6745227444" title="Musicer for macOS"><img alt="Musicer" height="52" src="https://wangchujiang.com/appicon/musicer.png"></a>
|
|
32
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6743841447" title="Audioer for macOS"><img alt="Audioer" height="52" src="https://wangchujiang.com/appicon/audioer.png"></a>
|
|
33
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6744690194" title="FileSentinel for macOS"><img alt="FileSentinel" height="52" src="https://wangchujiang.com/appicon/file-sentinel.png"></a>
|
|
34
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6743495172" title="FocusCursor for macOS"><img alt="FocusCursor" height="52" src="https://wangchujiang.com/appicon/focus-cursor.png"></a>
|
|
35
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6742680573" title="Videoer for macOS"><img alt="Videoer" height="52" src="https://wangchujiang.com/appicon/videoer.png"></a>
|
|
36
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6740425504" title="KeyClicker for macOS"><img alt="KeyClicker" height="52" src="https://wangchujiang.com/appicon/key-clicker.png"></a>
|
|
37
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6739052447" title="DayBar for macOS"><img alt="DayBar" height="52" src="https://wangchujiang.com/appicon/daybar.png"></a>
|
|
38
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6739444407" title="Iconed for macOS"><img alt="Iconed" height="52" src="https://wangchujiang.com/appicon/iconed.png"></a>
|
|
39
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6737160756" title="Menuist for macOS"><img alt="Menuist" height="52" src="https://wangchujiang.com/appicon/rightmenu-master.png"></a>
|
|
40
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6723903021" title="Paste Quick for macOS"><img alt="Quick RSS" height="52" src="https://wangchujiang.com/appicon/paste-quick.png"></a>
|
|
41
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6670696072&platform=mac" title="Quick RSS for macOS/iOS"><img alt="Quick RSS" height="52" src="https://wangchujiang.com/appicon/quick-rss.png"></a>
|
|
42
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6670167443" title="Web Serve for macOS"><img alt="Web Serve" height="52" src="https://wangchujiang.com/appicon/web-serve.png"></a>
|
|
43
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6503953628&platform=mac" title="Copybook Generator for macOS/iOS"><img alt="Copybook Generator" height="52" src="https://wangchujiang.com/appicon/copybook-generator.png"></a>
|
|
44
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6471227008&platform=mac" title="DevTutor for macOS/iOS"><img alt="DevTutor for SwiftUI" height="52" src="https://wangchujiang.com/appicon/devtutor.png"></a>
|
|
45
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6479819388&platform=mac" title="RegexMate for macOS/iOS"><img alt="RegexMate" height="52" src="https://wangchujiang.com/appicon/regex-mate.png"></a>
|
|
46
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6479194014&platform=mac" title="Time Passage for macOS/iOS"><img alt="Time Passage" height="52" src="https://wangchujiang.com/appicon/time-passage.png"></a>
|
|
47
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6478772538" title="IconizeFolder for macOS"><img alt="Iconize Folder" height="52" src="https://wangchujiang.com/appicon/iconize-folder.png"></a>
|
|
48
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6478511402&platform=mac" title="Textsound Saver for macOS/iOS"><img alt="Textsound Saver" height="52" src="https://wangchujiang.com/appicon/textsound-saver.png"></a>
|
|
49
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6476924627" title="Create Custom Symbols for macOS"><img alt="Create Custom Symbols" height="52" src="https://wangchujiang.com/appicon/create-custom-symbols.png"></a>
|
|
50
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6476452351" title="DevHub for macOS"><img alt="DevHub" height="52" src="https://wangchujiang.com/appicon/devhub.png"></a>
|
|
51
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6476400184" title="Resume Revise for macOS"><img alt="Resume Revise" height="52" src="https://wangchujiang.com/appicon/resume-revise.png"></a>
|
|
52
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6472593276" title="Palette Genius for macOS"><img alt="Palette Genius" height="52" src="https://wangchujiang.com/appicon/palette-genius.png"></a>
|
|
53
|
+
<a target="_blank" href="https://jaywcjlove.github.io/maslink/?id=6470879005" title="Symbol Scribe for macOS"><img alt="Symbol Scribe" height="52" src="https://wangchujiang.com/appicon/symbol-scribe.png"></a>
|
|
36
54
|
</div>
|
|
37
55
|
<hr>
|
|
38
56
|
|
package/esm/Container.js
CHANGED
|
@@ -9,15 +9,17 @@ import { useIdCompat } from "./comps/useIdCompat.js";
|
|
|
9
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
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
var _props$className = props.className,
|
|
13
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
14
|
+
children = props.children,
|
|
15
|
+
parentValue = props.parentValue,
|
|
16
|
+
keyid = props.keyid,
|
|
17
|
+
_props$level = props.level,
|
|
18
|
+
level = _props$level === void 0 ? 1 : _props$level,
|
|
19
|
+
value = props.value,
|
|
20
|
+
initialValue = props.initialValue,
|
|
21
|
+
keys = props.keys,
|
|
22
|
+
keyName = props.keyName,
|
|
21
23
|
elmProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
22
24
|
var dispatch = useShowToolsDispatch();
|
|
23
25
|
var subkeyid = useIdCompat();
|
|
@@ -4,9 +4,7 @@ var _excluded = ["style"];
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
export function TriangleArrow(props) {
|
|
7
|
-
var
|
|
8
|
-
style
|
|
9
|
-
} = props,
|
|
7
|
+
var style = props.style,
|
|
10
8
|
reset = _objectWithoutPropertiesLoose(props, _excluded);
|
|
11
9
|
var defaultStyle = _extends({
|
|
12
10
|
cursor: 'pointer',
|
|
@@ -4,9 +4,7 @@ var _excluded = ["style"];
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
export function TriangleSolidArrow(props) {
|
|
7
|
-
var
|
|
8
|
-
style
|
|
9
|
-
} = props,
|
|
7
|
+
var style = props.style,
|
|
10
8
|
reset = _objectWithoutPropertiesLoose(props, _excluded);
|
|
11
9
|
var defaultStyle = _extends({
|
|
12
10
|
cursor: 'pointer',
|
package/esm/comps/Copied.js
CHANGED
|
@@ -9,26 +9,25 @@ import { useShowToolsStore } from "../store/ShowTools.js";
|
|
|
9
9
|
import { bigIntToString } from "../types/index.js";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
export var Copied = props => {
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
beforeCopy
|
|
19
|
-
} = props,
|
|
12
|
+
var keyName = props.keyName,
|
|
13
|
+
value = props.value,
|
|
14
|
+
parentValue = props.parentValue,
|
|
15
|
+
expandKey = props.expandKey,
|
|
16
|
+
keys = props.keys,
|
|
17
|
+
beforeCopy = props.beforeCopy,
|
|
20
18
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
21
|
-
var
|
|
22
|
-
onCopied,
|
|
23
|
-
enableClipboard,
|
|
24
|
-
beforeCopy
|
|
25
|
-
} = useStore();
|
|
19
|
+
var _useStore = useStore(),
|
|
20
|
+
onCopied = _useStore.onCopied,
|
|
21
|
+
enableClipboard = _useStore.enableClipboard,
|
|
22
|
+
globalBeforeCopy = _useStore.beforeCopy;
|
|
26
23
|
var showTools = useShowToolsStore();
|
|
27
24
|
var isShowTools = showTools[expandKey];
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
var _useState = useState(false),
|
|
26
|
+
copied = _useState[0],
|
|
27
|
+
setCopied = _useState[1];
|
|
28
|
+
var _useSectionStore = useSectionStore(),
|
|
29
|
+
_useSectionStore$Copi = _useSectionStore.Copied,
|
|
30
|
+
Comp = _useSectionStore$Copi === void 0 ? {} : _useSectionStore$Copi;
|
|
32
31
|
var sectionBeforeCopy = Comp == null ? void 0 : Comp.beforeCopy;
|
|
33
32
|
if (enableClipboard === false || !isShowTools) return null;
|
|
34
33
|
var click = event => {
|
|
@@ -87,9 +86,8 @@ export var Copied = props => {
|
|
|
87
86
|
fill: copied ? 'var(--w-rjv-copied-success-color, #28a745)' : 'var(--w-rjv-copied-color, currentColor)',
|
|
88
87
|
onClick: click
|
|
89
88
|
};
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
} = Comp,
|
|
89
|
+
var as = Comp.as,
|
|
90
|
+
render = Comp.render,
|
|
93
91
|
reset = _objectWithoutPropertiesLoose(Comp, _excluded2);
|
|
94
92
|
var elmProps = _extends({}, reset, other, svgProps, {
|
|
95
93
|
style: _extends({}, reset.style, other.style, svgProps.style)
|
package/esm/comps/KeyValues.js
CHANGED
|
@@ -14,21 +14,20 @@ 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;
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
expandKey = '',
|
|
21
|
-
level,
|
|
22
|
-
keys =
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
var keyName = props.keyName,
|
|
18
|
+
value = props.value,
|
|
19
|
+
_props$expandKey = props.expandKey,
|
|
20
|
+
expandKey = _props$expandKey === void 0 ? '' : _props$expandKey,
|
|
21
|
+
level = props.level,
|
|
22
|
+
_props$keys = props.keys,
|
|
23
|
+
keys = _props$keys === void 0 ? [] : _props$keys,
|
|
24
|
+
parentValue = props.parentValue;
|
|
25
25
|
var expands = useExpandsStore();
|
|
26
|
-
var
|
|
27
|
-
objectSortKeys,
|
|
28
|
-
indentWidth,
|
|
29
|
-
collapsed,
|
|
30
|
-
shouldExpandNodeInitially
|
|
31
|
-
} = useStore();
|
|
26
|
+
var _useStore = useStore(),
|
|
27
|
+
objectSortKeys = _useStore.objectSortKeys,
|
|
28
|
+
indentWidth = _useStore.indentWidth,
|
|
29
|
+
collapsed = _useStore.collapsed,
|
|
30
|
+
shouldExpandNodeInitially = _useStore.shouldExpandNodeInitially;
|
|
32
31
|
var defaultExpanded = typeof collapsed === 'boolean' ? collapsed : typeof collapsed === 'number' ? level > collapsed : false;
|
|
33
32
|
var isExpanded = (_expands$expandKey = expands[expandKey]) != null ? _expands$expandKey : shouldExpandNodeInitially ? false : defaultExpanded;
|
|
34
33
|
var shouldExpand = shouldExpandNodeInitially && shouldExpandNodeInitially(!isExpanded, {
|
|
@@ -55,12 +54,14 @@ export var KeyValues = props => {
|
|
|
55
54
|
var entries = isMyArray ? Object.entries(value).map(m => [Number(m[0]), m[1]]) : Object.entries(value);
|
|
56
55
|
if (objectSortKeys) {
|
|
57
56
|
entries = objectSortKeys === true ? entries.sort((_ref, _ref2) => {
|
|
58
|
-
var
|
|
59
|
-
var
|
|
57
|
+
var a = _ref[0];
|
|
58
|
+
var b = _ref2[0];
|
|
60
59
|
return typeof a === 'string' && typeof b === 'string' ? a.localeCompare(b) : 0;
|
|
61
60
|
}) : entries.sort((_ref3, _ref4) => {
|
|
62
|
-
var
|
|
63
|
-
|
|
61
|
+
var a = _ref3[0],
|
|
62
|
+
valA = _ref3[1];
|
|
63
|
+
var b = _ref4[0],
|
|
64
|
+
valB = _ref4[1];
|
|
64
65
|
return typeof a === 'string' && typeof b === 'string' ? objectSortKeys(a, b, valA, valB) : 0;
|
|
65
66
|
});
|
|
66
67
|
}
|
|
@@ -73,7 +74,8 @@ export var KeyValues = props => {
|
|
|
73
74
|
className: "w-rjv-wrap",
|
|
74
75
|
style: style,
|
|
75
76
|
children: entries.map((_ref5, idx) => {
|
|
76
|
-
var
|
|
77
|
+
var key = _ref5[0],
|
|
78
|
+
val = _ref5[1];
|
|
77
79
|
return /*#__PURE__*/_jsx(KeyValuesItem, {
|
|
78
80
|
parentValue: value,
|
|
79
81
|
keyName: key,
|
|
@@ -86,15 +88,12 @@ export var KeyValues = props => {
|
|
|
86
88
|
};
|
|
87
89
|
KeyValues.displayName = 'JVR.KeyValues';
|
|
88
90
|
export var KayName = props => {
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
var {
|
|
96
|
-
highlightUpdates
|
|
97
|
-
} = useStore();
|
|
91
|
+
var keyName = props.keyName,
|
|
92
|
+
parentValue = props.parentValue,
|
|
93
|
+
keys = props.keys,
|
|
94
|
+
value = props.value;
|
|
95
|
+
var _useStore2 = useStore(),
|
|
96
|
+
highlightUpdates = _useStore2.highlightUpdates;
|
|
98
97
|
var isNumber = typeof keyName === 'number';
|
|
99
98
|
var highlightContainer = useRef(null);
|
|
100
99
|
useHighlight({
|
|
@@ -125,13 +124,13 @@ export var KayName = props => {
|
|
|
125
124
|
};
|
|
126
125
|
KayName.displayName = 'JVR.KayName';
|
|
127
126
|
export var KeyValuesItem = props => {
|
|
128
|
-
var
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
level = 0,
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
var keyName = props.keyName,
|
|
128
|
+
value = props.value,
|
|
129
|
+
parentValue = props.parentValue,
|
|
130
|
+
_props$level = props.level,
|
|
131
|
+
level = _props$level === void 0 ? 0 : _props$level,
|
|
132
|
+
_props$keys2 = props.keys,
|
|
133
|
+
keys = _props$keys2 === void 0 ? [] : _props$keys2;
|
|
135
134
|
var dispatch = useShowToolsDispatch();
|
|
136
135
|
var subkeyid = useIdCompat();
|
|
137
136
|
var isMyArray = Array.isArray(value);
|
package/esm/comps/NestedClose.js
CHANGED
|
@@ -5,19 +5,17 @@ import { BracketsClose } from "../symbol/index.js";
|
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
export var NestedClose = props => {
|
|
7
7
|
var _expands$expandKey;
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
keys = []
|
|
15
|
-
} = props;
|
|
8
|
+
var keyName = props.keyName,
|
|
9
|
+
value = props.value,
|
|
10
|
+
expandKey = props.expandKey,
|
|
11
|
+
parentValue = props.parentValue,
|
|
12
|
+
level = props.level,
|
|
13
|
+
_props$keys = props.keys,
|
|
14
|
+
keys = _props$keys === void 0 ? [] : _props$keys;
|
|
16
15
|
var expands = useExpandsStore();
|
|
17
|
-
var
|
|
18
|
-
collapsed,
|
|
19
|
-
shouldExpandNodeInitially
|
|
20
|
-
} = useStore();
|
|
16
|
+
var _useStore = useStore(),
|
|
17
|
+
collapsed = _useStore.collapsed,
|
|
18
|
+
shouldExpandNodeInitially = _useStore.shouldExpandNodeInitially;
|
|
21
19
|
var defaultExpanded = typeof collapsed === 'boolean' ? collapsed : typeof collapsed === 'number' ? level > collapsed : false;
|
|
22
20
|
var isExpanded = (_expands$expandKey = expands[expandKey]) != null ? _expands$expandKey : shouldExpandNodeInitially ? false : defaultExpanded;
|
|
23
21
|
var shouldExpand = shouldExpandNodeInitially && shouldExpandNodeInitially(!isExpanded, {
|
package/esm/comps/NestedOpen.js
CHANGED
|
@@ -11,22 +11,20 @@ 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;
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
keys = [],
|
|
18
|
-
initialValue,
|
|
19
|
-
value,
|
|
20
|
-
parentValue,
|
|
21
|
-
level
|
|
22
|
-
} = props;
|
|
14
|
+
var keyName = props.keyName,
|
|
15
|
+
expandKey = props.expandKey,
|
|
16
|
+
_props$keys = props.keys,
|
|
17
|
+
keys = _props$keys === void 0 ? [] : _props$keys,
|
|
18
|
+
initialValue = props.initialValue,
|
|
19
|
+
value = props.value,
|
|
20
|
+
parentValue = props.parentValue,
|
|
21
|
+
level = props.level;
|
|
23
22
|
var expands = useExpandsStore();
|
|
24
23
|
var dispatchExpands = useExpandsDispatch();
|
|
25
|
-
var
|
|
26
|
-
onExpand,
|
|
27
|
-
collapsed,
|
|
28
|
-
shouldExpandNodeInitially
|
|
29
|
-
} = useStore();
|
|
24
|
+
var _useStore = useStore(),
|
|
25
|
+
onExpand = _useStore.onExpand,
|
|
26
|
+
collapsed = _useStore.collapsed,
|
|
27
|
+
shouldExpandNodeInitially = _useStore.shouldExpandNodeInitially;
|
|
30
28
|
var defaultExpanded = typeof collapsed === 'boolean' ? collapsed : typeof collapsed === 'number' ? level > collapsed : false;
|
|
31
29
|
var isExpanded = (_expands$expandKey = expands[expandKey]) != null ? _expands$expandKey : shouldExpandNodeInitially ? false : defaultExpanded;
|
|
32
30
|
var shouldExpand = shouldExpandNodeInitially && shouldExpandNodeInitially(!isExpanded, {
|
package/esm/comps/Value.js
CHANGED
|
@@ -3,11 +3,9 @@ import { TypeString, TypeTrue, TypeNull, TypeFalse, TypeFloat, TypeBigint, TypeI
|
|
|
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 => {
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
keys
|
|
10
|
-
} = props;
|
|
6
|
+
var value = props.value,
|
|
7
|
+
keyName = props.keyName,
|
|
8
|
+
keys = props.keys;
|
|
11
9
|
var reset = {
|
|
12
10
|
keyName,
|
|
13
11
|
keys
|
package/esm/editor/KeyName.js
CHANGED
|
@@ -6,15 +6,11 @@ import { useRef, useState } from 'react';
|
|
|
6
6
|
import { useStore } from "./store.js";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
export var KeyNameRender = (_ref, _ref2) => {
|
|
9
|
-
var
|
|
10
|
-
children
|
|
11
|
-
} = _ref,
|
|
9
|
+
var children = _ref.children,
|
|
12
10
|
reset = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
keyName
|
|
17
|
-
} = _ref2;
|
|
11
|
+
var value = _ref2.value,
|
|
12
|
+
parentValue = _ref2.parentValue,
|
|
13
|
+
keyName = _ref2.keyName;
|
|
18
14
|
if (typeof children === 'number') {
|
|
19
15
|
return /*#__PURE__*/_jsx("span", _extends({}, reset, {
|
|
20
16
|
children: children
|
|
@@ -28,16 +24,16 @@ export var KeyNameRender = (_ref, _ref2) => {
|
|
|
28
24
|
}));
|
|
29
25
|
};
|
|
30
26
|
var Child = props => {
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} = props,
|
|
27
|
+
var value = props.value,
|
|
28
|
+
parentValue = props.parentValue,
|
|
29
|
+
keyName = props.keyName,
|
|
35
30
|
reset = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
36
31
|
var $dom = useRef(null);
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
var _useState = useState(props.children),
|
|
33
|
+
currentValue = _useState[0],
|
|
34
|
+
setCurrentValue = _useState[1];
|
|
35
|
+
var _useStore = useStore(),
|
|
36
|
+
onEdit = _useStore.onEdit;
|
|
41
37
|
var onKeyDown = evn => {
|
|
42
38
|
if (evn.key === 'Enter') {
|
|
43
39
|
var _$dom$current;
|
package/esm/editor/index.js
CHANGED
|
@@ -7,15 +7,16 @@ import { KeyNameRender } from "./KeyName.js";
|
|
|
7
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
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} = props,
|
|
10
|
+
var children = props.children,
|
|
11
|
+
onEdit = props.onEdit,
|
|
12
|
+
_props$editable = props.editable,
|
|
13
|
+
editable = _props$editable === void 0 ? true : _props$editable,
|
|
15
14
|
reset = _objectWithoutPropertiesLoose(props, _excluded);
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
var _useStoreReducer = useStoreReducer({
|
|
16
|
+
onEdit
|
|
17
|
+
}),
|
|
18
|
+
state = _useStoreReducer[0],
|
|
19
|
+
dispatch = _useStoreReducer[1];
|
|
19
20
|
return /*#__PURE__*/_jsx(Context.Provider, {
|
|
20
21
|
value: state,
|
|
21
22
|
children: /*#__PURE__*/_jsx(Dispatch.Provider, {
|
package/esm/index.js
CHANGED
|
@@ -39,25 +39,32 @@ export * from "./store/Symbols.js";
|
|
|
39
39
|
export * from "./store/Types.js";
|
|
40
40
|
export * from "./symbol/index.js";
|
|
41
41
|
var JsonView = /*#__PURE__*/forwardRef((props, ref) => {
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
42
|
+
var _props$className = props.className,
|
|
43
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
44
|
+
style = props.style,
|
|
45
|
+
value = props.value,
|
|
46
|
+
children = props.children,
|
|
47
|
+
_props$collapsed = props.collapsed,
|
|
48
|
+
collapsed = _props$collapsed === void 0 ? false : _props$collapsed,
|
|
49
|
+
shouldExpandNodeInitially = props.shouldExpandNodeInitially,
|
|
50
|
+
_props$indentWidth = props.indentWidth,
|
|
51
|
+
indentWidth = _props$indentWidth === void 0 ? 15 : _props$indentWidth,
|
|
52
|
+
_props$displayObjectS = props.displayObjectSize,
|
|
53
|
+
displayObjectSize = _props$displayObjectS === void 0 ? true : _props$displayObjectS,
|
|
54
|
+
_props$shortenTextAft = props.shortenTextAfterLength,
|
|
55
|
+
shortenTextAfterLength = _props$shortenTextAft === void 0 ? 30 : _props$shortenTextAft,
|
|
56
|
+
stringEllipsis = props.stringEllipsis,
|
|
57
|
+
_props$highlightUpdat = props.highlightUpdates,
|
|
58
|
+
highlightUpdates = _props$highlightUpdat === void 0 ? true : _props$highlightUpdat,
|
|
59
|
+
_props$enableClipboar = props.enableClipboard,
|
|
60
|
+
enableClipboard = _props$enableClipboar === void 0 ? true : _props$enableClipboar,
|
|
61
|
+
_props$displayDataTyp = props.displayDataTypes,
|
|
62
|
+
displayDataTypes = _props$displayDataTyp === void 0 ? true : _props$displayDataTyp,
|
|
63
|
+
_props$objectSortKeys = props.objectSortKeys,
|
|
64
|
+
objectSortKeys = _props$objectSortKeys === void 0 ? false : _props$objectSortKeys,
|
|
65
|
+
onExpand = props.onExpand,
|
|
66
|
+
onCopied = props.onCopied,
|
|
67
|
+
beforeCopy = props.beforeCopy,
|
|
61
68
|
elmProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
62
69
|
var defaultStyle = _extends({
|
|
63
70
|
lineHeight: 1.4,
|
package/esm/section/Copied.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useSectionStore } from "../store/Section.js";
|
|
2
2
|
import { useSectionRender } from "../utils/useRender.js";
|
|
3
3
|
export var Copied = props => {
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
var _useSectionStore = useSectionStore(),
|
|
5
|
+
_useSectionStore$Copi = _useSectionStore.Copied,
|
|
6
|
+
Comp = _useSectionStore$Copi === void 0 ? {} : _useSectionStore$Copi;
|
|
7
7
|
useSectionRender(Comp, props, 'Copied');
|
|
8
8
|
return null;
|
|
9
9
|
};
|
package/esm/section/CountInfo.js
CHANGED
|
@@ -7,30 +7,26 @@ import { useSectionRender } from "../utils/useRender.js";
|
|
|
7
7
|
import { useStore } from "../store.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
export var CountInfo = props => {
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
var _useSectionStore = useSectionStore(),
|
|
11
|
+
_useSectionStore$Coun = _useSectionStore.CountInfo,
|
|
12
|
+
Comp = _useSectionStore$Coun === void 0 ? {} : _useSectionStore$Coun;
|
|
13
13
|
useSectionRender(Comp, props, 'CountInfo');
|
|
14
14
|
return null;
|
|
15
15
|
};
|
|
16
16
|
CountInfo.displayName = 'JVR.CountInfo';
|
|
17
17
|
export var CountInfoComp = props => {
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} = props,
|
|
18
|
+
var _props$value = props.value,
|
|
19
|
+
value = _props$value === void 0 ? {} : _props$value,
|
|
20
|
+
keyName = props.keyName,
|
|
22
21
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
23
|
-
var
|
|
24
|
-
displayObjectSize
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} = useSectionStore();
|
|
22
|
+
var _useStore = useStore(),
|
|
23
|
+
displayObjectSize = _useStore.displayObjectSize;
|
|
24
|
+
var _useSectionStore2 = useSectionStore(),
|
|
25
|
+
_useSectionStore2$Cou = _useSectionStore2.CountInfo,
|
|
26
|
+
Comp = _useSectionStore2$Cou === void 0 ? {} : _useSectionStore2$Cou;
|
|
29
27
|
if (!displayObjectSize) return null;
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
render
|
|
33
|
-
} = Comp,
|
|
28
|
+
var as = Comp.as,
|
|
29
|
+
render = Comp.render,
|
|
34
30
|
reset = _objectWithoutPropertiesLoose(Comp, _excluded2);
|
|
35
31
|
var Elm = as || 'span';
|
|
36
32
|
reset.style = _extends({}, reset.style, props.style);
|
|
@@ -6,26 +6,23 @@ import { useSectionStore } from "../store/Section.js";
|
|
|
6
6
|
import { useSectionRender } from "../utils/useRender.js";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
export var CountInfoExtra = props => {
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
var _useSectionStore = useSectionStore(),
|
|
10
|
+
_useSectionStore$Coun = _useSectionStore.CountInfoExtra,
|
|
11
|
+
Comp = _useSectionStore$Coun === void 0 ? {} : _useSectionStore$Coun;
|
|
12
12
|
useSectionRender(Comp, props, 'CountInfoExtra');
|
|
13
13
|
return null;
|
|
14
14
|
};
|
|
15
15
|
CountInfoExtra.displayName = 'JVR.CountInfoExtra';
|
|
16
16
|
export var CountInfoExtraComps = props => {
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = props,
|
|
17
|
+
var _props$value = props.value,
|
|
18
|
+
value = _props$value === void 0 ? {} : _props$value,
|
|
19
|
+
keyName = props.keyName,
|
|
21
20
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
render
|
|
28
|
-
} = Comp,
|
|
21
|
+
var _useSectionStore2 = useSectionStore(),
|
|
22
|
+
_useSectionStore2$Cou = _useSectionStore2.CountInfoExtra,
|
|
23
|
+
Comp = _useSectionStore2$Cou === void 0 ? {} : _useSectionStore2$Cou;
|
|
24
|
+
var as = Comp.as,
|
|
25
|
+
render = Comp.render,
|
|
29
26
|
reset = _objectWithoutPropertiesLoose(Comp, _excluded2);
|
|
30
27
|
if (!render && !reset.children) return null;
|
|
31
28
|
var Elm = as || 'span';
|