@uiw/react-json-view 2.0.0-alpha.4 → 2.0.0-alpha.40
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 +279 -39
- package/basic.d.ts +4 -0
- package/cjs/Container.d.ts +2 -0
- package/cjs/Container.js +15 -6
- package/cjs/arrow/TriangleArrow.js +1 -1
- package/cjs/comps/Copied.d.ts +3 -4
- package/cjs/comps/Copied.js +61 -18
- package/cjs/comps/KeyValues.d.ts +2 -4
- package/cjs/comps/KeyValues.js +73 -28
- package/cjs/comps/NestedClose.d.ts +2 -2
- package/cjs/comps/NestedClose.js +42 -12
- package/cjs/comps/NestedOpen.d.ts +2 -3
- package/cjs/comps/NestedOpen.js +42 -20
- package/cjs/comps/Value.d.ts +2 -2
- package/cjs/comps/Value.js +5 -7
- package/cjs/comps/useIdCompat.d.ts +1 -0
- package/cjs/comps/useIdCompat.js +14 -0
- package/cjs/editor/KeyName.d.ts +2 -0
- package/cjs/editor/KeyName.js +82 -0
- package/cjs/editor/index.d.ts +18 -0
- package/cjs/editor/index.js +44 -0
- package/cjs/editor/store.d.ts +27 -0
- package/cjs/editor/store.js +23 -0
- package/cjs/index.d.ts +26 -4
- package/cjs/index.js +17 -7
- package/cjs/section/Copied.d.ts +4 -1
- package/cjs/section/Copied.js +1 -2
- package/cjs/section/CountInfo.d.ts +1 -2
- package/cjs/section/CountInfo.js +3 -5
- package/cjs/section/CountInfoExtra.d.ts +1 -2
- package/cjs/section/CountInfoExtra.js +2 -4
- package/cjs/section/Ellipsis.d.ts +0 -1
- package/cjs/section/Ellipsis.js +4 -5
- package/cjs/section/KeyName.d.ts +7 -6
- package/cjs/section/KeyName.js +8 -6
- package/cjs/section/Row.d.ts +13 -0
- package/cjs/section/Row.js +51 -0
- package/cjs/store/Expands.js +2 -4
- package/cjs/store/Section.d.ts +12 -6
- package/cjs/store/Section.js +6 -4
- package/cjs/store/ShowTools.js +2 -4
- package/cjs/store/Symbols.d.ts +10 -3
- package/cjs/store/Symbols.js +2 -4
- package/cjs/store/Types.d.ts +30 -25
- package/cjs/store/Types.js +8 -8
- package/cjs/store.d.ts +12 -6
- package/cjs/store.js +5 -10
- package/cjs/symbol/Arrow.d.ts +1 -1
- package/cjs/symbol/Arrow.js +1 -2
- package/cjs/symbol/BraceLeft.d.ts +1 -1
- package/cjs/symbol/BraceLeft.js +1 -2
- package/cjs/symbol/BraceRight.d.ts +1 -1
- package/cjs/symbol/BraceRight.js +1 -2
- package/cjs/symbol/BracketsLeft.d.ts +1 -1
- package/cjs/symbol/BracketsLeft.js +1 -2
- package/cjs/symbol/BracketsRight.d.ts +1 -1
- package/cjs/symbol/BracketsRight.js +1 -2
- package/cjs/symbol/Colon.d.ts +1 -1
- package/cjs/symbol/Colon.js +1 -2
- package/cjs/symbol/Quote.d.ts +1 -1
- package/cjs/symbol/Quote.js +1 -2
- package/cjs/symbol/ValueQuote.d.ts +1 -1
- package/cjs/symbol/ValueQuote.js +1 -2
- package/cjs/symbol/index.d.ts +12 -17
- package/cjs/symbol/index.js +75 -30
- package/cjs/theme/basic.d.ts +2 -2
- package/cjs/theme/basic.js +4 -3
- package/cjs/theme/dark.d.ts +2 -2
- package/cjs/theme/dark.js +2 -3
- package/cjs/theme/github.dark.d.ts +2 -2
- package/cjs/theme/github.dark.js +2 -3
- package/cjs/theme/github.light.d.ts +2 -2
- package/cjs/theme/github.light.js +2 -3
- package/cjs/theme/gruvbox.d.ts +2 -2
- package/cjs/theme/gruvbox.js +2 -3
- package/cjs/theme/light.d.ts +2 -2
- package/cjs/theme/light.js +2 -3
- package/cjs/theme/monokai.d.ts +2 -2
- package/cjs/theme/monokai.js +2 -3
- package/cjs/theme/nord.d.ts +2 -2
- package/cjs/theme/nord.js +2 -3
- package/cjs/theme/vscode.d.ts +2 -2
- package/cjs/theme/vscode.js +2 -3
- package/cjs/types/Bigint.d.ts +1 -1
- package/cjs/types/Bigint.js +1 -2
- package/cjs/types/Date.d.ts +1 -1
- package/cjs/types/Date.js +1 -2
- package/cjs/types/False.d.ts +1 -1
- package/cjs/types/False.js +1 -2
- package/cjs/types/Float.d.ts +1 -1
- package/cjs/types/Float.js +1 -2
- package/cjs/types/Int.d.ts +1 -1
- package/cjs/types/Int.js +1 -2
- package/cjs/types/Map.d.ts +1 -1
- package/cjs/types/Map.js +1 -2
- package/cjs/types/Nan.d.ts +1 -1
- package/cjs/types/Nan.js +1 -2
- package/cjs/types/Null.d.ts +1 -1
- package/cjs/types/Null.js +1 -2
- package/cjs/types/Set.d.ts +1 -1
- package/cjs/types/Set.js +1 -2
- package/cjs/types/String.d.ts +1 -1
- package/cjs/types/String.js +1 -2
- package/cjs/types/True.d.ts +1 -1
- package/cjs/types/True.js +1 -2
- package/cjs/types/Undefined.d.ts +1 -1
- package/cjs/types/Undefined.js +1 -2
- package/cjs/types/Url.d.ts +1 -1
- package/cjs/types/Url.js +1 -2
- package/cjs/types/index.d.ts +5 -2
- package/cjs/types/index.js +174 -166
- package/cjs/utils/useHighlight.d.ts +0 -1
- package/cjs/utils/useRender.d.ts +1 -1
- package/dark.d.ts +2 -1
- package/editor.d.ts +22 -20
- package/esm/Container.d.ts +2 -0
- package/esm/Container.js +21 -11
- package/esm/arrow/TriangleArrow.js +1 -1
- package/esm/comps/Copied.d.ts +3 -4
- package/esm/comps/Copied.js +61 -19
- package/esm/comps/KeyValues.d.ts +2 -4
- package/esm/comps/KeyValues.js +71 -27
- package/esm/comps/NestedClose.d.ts +2 -2
- package/esm/comps/NestedClose.js +40 -11
- package/esm/comps/NestedOpen.d.ts +2 -3
- package/esm/comps/NestedOpen.js +47 -26
- package/esm/comps/Value.d.ts +2 -2
- package/esm/comps/Value.js +3 -3
- package/esm/comps/useIdCompat.d.ts +1 -0
- package/esm/comps/useIdCompat.js +8 -0
- package/esm/editor/KeyName.d.ts +2 -0
- package/esm/editor/KeyName.js +77 -0
- package/esm/editor/index.d.ts +18 -0
- package/esm/editor/index.js +33 -0
- package/esm/editor/store.d.ts +27 -0
- package/esm/editor/store.js +13 -0
- package/esm/index.d.ts +26 -4
- package/esm/index.js +50 -41
- package/esm/section/Copied.d.ts +4 -1
- package/esm/section/Copied.js +2 -2
- package/esm/section/CountInfo.d.ts +1 -2
- package/esm/section/CountInfo.js +4 -4
- package/esm/section/CountInfoExtra.d.ts +1 -2
- package/esm/section/CountInfoExtra.js +2 -2
- package/esm/section/Ellipsis.d.ts +0 -1
- package/esm/section/Ellipsis.js +3 -3
- package/esm/section/KeyName.d.ts +7 -6
- package/esm/section/KeyName.js +8 -4
- package/esm/section/Row.d.ts +13 -0
- package/esm/section/Row.js +47 -0
- package/esm/store/Section.d.ts +12 -6
- package/esm/store/Section.js +4 -0
- package/esm/store/Symbols.d.ts +10 -3
- package/esm/store/Symbols.js +1 -1
- package/esm/store/Types.d.ts +30 -25
- package/esm/store/Types.js +6 -4
- package/esm/store.d.ts +12 -6
- package/esm/store.js +5 -5
- package/esm/symbol/Arrow.d.ts +1 -1
- package/esm/symbol/Arrow.js +2 -2
- package/esm/symbol/BraceLeft.d.ts +1 -1
- package/esm/symbol/BraceLeft.js +2 -2
- package/esm/symbol/BraceRight.d.ts +1 -1
- package/esm/symbol/BraceRight.js +2 -2
- package/esm/symbol/BracketsLeft.d.ts +1 -1
- package/esm/symbol/BracketsLeft.js +2 -2
- package/esm/symbol/BracketsRight.d.ts +1 -1
- package/esm/symbol/BracketsRight.js +2 -2
- package/esm/symbol/Colon.d.ts +1 -1
- package/esm/symbol/Colon.js +2 -2
- package/esm/symbol/Quote.d.ts +1 -1
- package/esm/symbol/Quote.js +2 -2
- package/esm/symbol/ValueQuote.d.ts +1 -1
- package/esm/symbol/ValueQuote.js +2 -2
- package/esm/symbol/index.d.ts +12 -17
- package/esm/symbol/index.js +78 -25
- package/esm/theme/basic.d.ts +2 -2
- package/esm/theme/basic.js +2 -0
- package/esm/theme/dark.d.ts +2 -2
- package/esm/theme/github.dark.d.ts +2 -2
- package/esm/theme/github.light.d.ts +2 -2
- package/esm/theme/gruvbox.d.ts +2 -2
- package/esm/theme/light.d.ts +2 -2
- package/esm/theme/monokai.d.ts +2 -2
- package/esm/theme/nord.d.ts +2 -2
- package/esm/theme/vscode.d.ts +2 -2
- package/esm/types/Bigint.d.ts +1 -1
- package/esm/types/Bigint.js +2 -2
- package/esm/types/Date.d.ts +1 -1
- package/esm/types/Date.js +2 -2
- package/esm/types/False.d.ts +1 -1
- package/esm/types/False.js +2 -2
- package/esm/types/Float.d.ts +1 -1
- package/esm/types/Float.js +2 -2
- package/esm/types/Int.d.ts +1 -1
- package/esm/types/Int.js +2 -2
- package/esm/types/Map.d.ts +1 -1
- package/esm/types/Map.js +2 -2
- package/esm/types/Nan.d.ts +1 -1
- package/esm/types/Nan.js +2 -2
- package/esm/types/Null.d.ts +1 -1
- package/esm/types/Null.js +2 -2
- package/esm/types/Set.d.ts +1 -1
- package/esm/types/Set.js +2 -2
- package/esm/types/String.d.ts +1 -1
- package/esm/types/String.js +2 -2
- package/esm/types/True.d.ts +1 -1
- package/esm/types/True.js +2 -2
- package/esm/types/Undefined.d.ts +1 -1
- package/esm/types/Undefined.js +2 -2
- package/esm/types/Url.d.ts +1 -1
- package/esm/types/Url.js +2 -2
- package/esm/types/index.d.ts +5 -2
- package/esm/types/index.js +148 -131
- package/esm/utils/useHighlight.d.ts +0 -1
- package/esm/utils/useRender.d.ts +1 -1
- package/esm/utils/useRender.js +3 -3
- package/githubDark.d.ts +4 -0
- package/githubLight.d.ts +4 -0
- package/gruvbox.d.ts +4 -0
- package/light.d.ts +2 -1
- package/monokai.d.ts +4 -0
- package/nord.d.ts +4 -0
- package/package.json +11 -5
- package/triangle-arrow.d.ts +2 -2
- package/triangle-solid-arrow.d.ts +2 -2
- package/vscode.d.ts +4 -0
package/esm/types/index.js
CHANGED
|
@@ -9,20 +9,31 @@ 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
|
-
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
_excluded11 = ["as", "render"];
|
|
16
|
+
import { Fragment, useEffect, useState } from 'react';
|
|
17
|
+
import { useStore } from "../store.js";
|
|
18
|
+
import { useTypesStore } from "../store/Types.js";
|
|
19
|
+
import { ValueQuote } from "../symbol/index.js";
|
|
20
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
export var bigIntToString = bi => {
|
|
22
|
+
if (bi === undefined) {
|
|
23
|
+
return '0n';
|
|
24
|
+
} else if (typeof bi === 'string') {
|
|
25
|
+
try {
|
|
26
|
+
bi = BigInt(bi);
|
|
27
|
+
} catch (e) {
|
|
28
|
+
return '0n';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return bi ? bi.toString() + 'n' : '0n';
|
|
32
|
+
};
|
|
23
33
|
export var SetComp = _ref => {
|
|
24
34
|
var {
|
|
25
|
-
value
|
|
35
|
+
value,
|
|
36
|
+
keyName
|
|
26
37
|
} = _ref;
|
|
27
38
|
var {
|
|
28
39
|
Set: Comp = {},
|
|
@@ -38,7 +49,8 @@ export var SetComp = _ref => {
|
|
|
38
49
|
var isRender = render && typeof render === 'function';
|
|
39
50
|
var type = isRender && render(reset, {
|
|
40
51
|
type: 'type',
|
|
41
|
-
value
|
|
52
|
+
value,
|
|
53
|
+
keyName
|
|
42
54
|
});
|
|
43
55
|
if (type) return type;
|
|
44
56
|
var Elm = as || 'span';
|
|
@@ -47,7 +59,8 @@ export var SetComp = _ref => {
|
|
|
47
59
|
SetComp.displayName = 'JVR.SetComp';
|
|
48
60
|
export var MapComp = _ref2 => {
|
|
49
61
|
var {
|
|
50
|
-
value
|
|
62
|
+
value,
|
|
63
|
+
keyName
|
|
51
64
|
} = _ref2;
|
|
52
65
|
var {
|
|
53
66
|
Map: Comp = {},
|
|
@@ -63,7 +76,8 @@ export var MapComp = _ref2 => {
|
|
|
63
76
|
var isRender = render && typeof render === 'function';
|
|
64
77
|
var type = isRender && render(reset, {
|
|
65
78
|
type: 'type',
|
|
66
|
-
value
|
|
79
|
+
value,
|
|
80
|
+
keyName
|
|
67
81
|
});
|
|
68
82
|
if (type) return type;
|
|
69
83
|
var Elm = as || 'span';
|
|
@@ -77,15 +91,16 @@ var defalutStyle = {
|
|
|
77
91
|
export var TypeString = _ref3 => {
|
|
78
92
|
var {
|
|
79
93
|
children = '',
|
|
80
|
-
|
|
81
|
-
|
|
94
|
+
keyName,
|
|
95
|
+
keys
|
|
82
96
|
} = _ref3;
|
|
83
97
|
var {
|
|
84
98
|
Str = {},
|
|
85
99
|
displayDataTypes
|
|
86
100
|
} = useTypesStore();
|
|
87
101
|
var {
|
|
88
|
-
shortenTextAfterLength: length =
|
|
102
|
+
shortenTextAfterLength: length = 30,
|
|
103
|
+
stringEllipsis = '...'
|
|
89
104
|
} = useStore();
|
|
90
105
|
var {
|
|
91
106
|
as,
|
|
@@ -93,7 +108,8 @@ export var TypeString = _ref3 => {
|
|
|
93
108
|
} = Str,
|
|
94
109
|
reset = _objectWithoutPropertiesLoose(Str, _excluded3);
|
|
95
110
|
var childrenStr = children;
|
|
96
|
-
var [shorten, setShorten] = useState(length && childrenStr.length
|
|
111
|
+
var [shorten, setShorten] = useState(length && childrenStr.length > length);
|
|
112
|
+
useEffect(() => setShorten(length && childrenStr.length > length), [length]);
|
|
97
113
|
var Comp = as || 'span';
|
|
98
114
|
var style = _extends({}, defalutStyle, Str.style || {});
|
|
99
115
|
if (length > 0) {
|
|
@@ -106,33 +122,34 @@ export var TypeString = _ref3 => {
|
|
|
106
122
|
};
|
|
107
123
|
}
|
|
108
124
|
}
|
|
109
|
-
var text = shorten ? childrenStr.slice(0, length) +
|
|
125
|
+
var text = shorten ? "" + childrenStr.slice(0, length) + stringEllipsis : childrenStr;
|
|
110
126
|
var isRender = render && typeof render === 'function';
|
|
111
127
|
var type = isRender && render(_extends({}, reset, {
|
|
112
128
|
style
|
|
113
129
|
}), {
|
|
114
130
|
type: 'type',
|
|
115
|
-
value: children
|
|
131
|
+
value: children,
|
|
132
|
+
keyName,
|
|
133
|
+
keys
|
|
116
134
|
});
|
|
135
|
+
var cls = shorten ? 'w-rjv-value w-rjv-value-short' : 'w-rjv-value';
|
|
117
136
|
var child = isRender && render(_extends({}, reset, {
|
|
118
137
|
children: text,
|
|
119
|
-
className:
|
|
138
|
+
className: cls
|
|
120
139
|
}), {
|
|
121
140
|
type: 'value',
|
|
122
|
-
value: children
|
|
141
|
+
value: children,
|
|
142
|
+
keyName,
|
|
143
|
+
keys
|
|
123
144
|
});
|
|
124
145
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
125
146
|
children: [displayDataTypes && (type || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
126
147
|
style: style
|
|
127
148
|
}))), child || /*#__PURE__*/_jsxs(Fragment, {
|
|
128
149
|
children: [/*#__PURE__*/_jsx(ValueQuote, {}), /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
129
|
-
className:
|
|
150
|
+
className: cls,
|
|
130
151
|
children: text
|
|
131
152
|
})), /*#__PURE__*/_jsx(ValueQuote, {})]
|
|
132
|
-
}), /*#__PURE__*/_jsx(Copied, {
|
|
133
|
-
keyName: keyName,
|
|
134
|
-
value: children,
|
|
135
|
-
expandKey: expandKey
|
|
136
153
|
})]
|
|
137
154
|
});
|
|
138
155
|
};
|
|
@@ -140,8 +157,8 @@ TypeString.displayName = 'JVR.TypeString';
|
|
|
140
157
|
export var TypeTrue = _ref4 => {
|
|
141
158
|
var {
|
|
142
159
|
children,
|
|
143
|
-
|
|
144
|
-
|
|
160
|
+
keyName,
|
|
161
|
+
keys
|
|
145
162
|
} = _ref4;
|
|
146
163
|
var {
|
|
147
164
|
True = {},
|
|
@@ -159,14 +176,18 @@ export var TypeTrue = _ref4 => {
|
|
|
159
176
|
style
|
|
160
177
|
}), {
|
|
161
178
|
type: 'type',
|
|
162
|
-
value: children
|
|
179
|
+
value: children,
|
|
180
|
+
keyName,
|
|
181
|
+
keys
|
|
163
182
|
});
|
|
164
183
|
var child = isRender && render(_extends({}, reset, {
|
|
165
184
|
children,
|
|
166
185
|
className: 'w-rjv-value'
|
|
167
186
|
}), {
|
|
168
187
|
type: 'value',
|
|
169
|
-
value: children
|
|
188
|
+
value: children,
|
|
189
|
+
keyName,
|
|
190
|
+
keys
|
|
170
191
|
});
|
|
171
192
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
172
193
|
children: [displayDataTypes && (type || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
@@ -174,19 +195,15 @@ export var TypeTrue = _ref4 => {
|
|
|
174
195
|
}))), child || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
175
196
|
className: "w-rjv-value",
|
|
176
197
|
children: children == null ? void 0 : children.toString()
|
|
177
|
-
}))
|
|
178
|
-
keyName: keyName,
|
|
179
|
-
value: children,
|
|
180
|
-
expandKey: expandKey
|
|
181
|
-
})]
|
|
198
|
+
}))]
|
|
182
199
|
});
|
|
183
200
|
};
|
|
184
201
|
TypeTrue.displayName = 'JVR.TypeTrue';
|
|
185
202
|
export var TypeFalse = _ref5 => {
|
|
186
203
|
var {
|
|
187
204
|
children,
|
|
188
|
-
|
|
189
|
-
|
|
205
|
+
keyName,
|
|
206
|
+
keys
|
|
190
207
|
} = _ref5;
|
|
191
208
|
var {
|
|
192
209
|
False = {},
|
|
@@ -204,14 +221,18 @@ export var TypeFalse = _ref5 => {
|
|
|
204
221
|
style
|
|
205
222
|
}), {
|
|
206
223
|
type: 'type',
|
|
207
|
-
value: children
|
|
224
|
+
value: children,
|
|
225
|
+
keyName,
|
|
226
|
+
keys
|
|
208
227
|
});
|
|
209
228
|
var child = isRender && render(_extends({}, reset, {
|
|
210
229
|
children,
|
|
211
230
|
className: 'w-rjv-value'
|
|
212
231
|
}), {
|
|
213
232
|
type: 'value',
|
|
214
|
-
value: children
|
|
233
|
+
value: children,
|
|
234
|
+
keyName,
|
|
235
|
+
keys
|
|
215
236
|
});
|
|
216
237
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
217
238
|
children: [displayDataTypes && (type || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
@@ -219,19 +240,15 @@ export var TypeFalse = _ref5 => {
|
|
|
219
240
|
}))), child || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
220
241
|
className: "w-rjv-value",
|
|
221
242
|
children: children == null ? void 0 : children.toString()
|
|
222
|
-
}))
|
|
223
|
-
keyName: keyName,
|
|
224
|
-
value: children,
|
|
225
|
-
expandKey: expandKey
|
|
226
|
-
})]
|
|
243
|
+
}))]
|
|
227
244
|
});
|
|
228
245
|
};
|
|
229
246
|
TypeFalse.displayName = 'JVR.TypeFalse';
|
|
230
247
|
export var TypeFloat = _ref6 => {
|
|
231
248
|
var {
|
|
232
249
|
children,
|
|
233
|
-
|
|
234
|
-
|
|
250
|
+
keyName,
|
|
251
|
+
keys
|
|
235
252
|
} = _ref6;
|
|
236
253
|
var {
|
|
237
254
|
Float = {},
|
|
@@ -249,14 +266,18 @@ export var TypeFloat = _ref6 => {
|
|
|
249
266
|
style
|
|
250
267
|
}), {
|
|
251
268
|
type: 'type',
|
|
252
|
-
value: children
|
|
269
|
+
value: children,
|
|
270
|
+
keyName,
|
|
271
|
+
keys
|
|
253
272
|
});
|
|
254
273
|
var child = isRender && render(_extends({}, reset, {
|
|
255
274
|
children,
|
|
256
275
|
className: 'w-rjv-value'
|
|
257
276
|
}), {
|
|
258
277
|
type: 'value',
|
|
259
|
-
value: children
|
|
278
|
+
value: children,
|
|
279
|
+
keyName,
|
|
280
|
+
keys
|
|
260
281
|
});
|
|
261
282
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
262
283
|
children: [displayDataTypes && (type || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
@@ -264,19 +285,15 @@ export var TypeFloat = _ref6 => {
|
|
|
264
285
|
}))), child || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
265
286
|
className: "w-rjv-value",
|
|
266
287
|
children: children == null ? void 0 : children.toString()
|
|
267
|
-
}))
|
|
268
|
-
keyName: keyName,
|
|
269
|
-
value: children,
|
|
270
|
-
expandKey: expandKey
|
|
271
|
-
})]
|
|
288
|
+
}))]
|
|
272
289
|
});
|
|
273
290
|
};
|
|
274
291
|
TypeFloat.displayName = 'JVR.TypeFloat';
|
|
275
292
|
export var TypeInt = _ref7 => {
|
|
276
293
|
var {
|
|
277
294
|
children,
|
|
278
|
-
|
|
279
|
-
|
|
295
|
+
keyName,
|
|
296
|
+
keys
|
|
280
297
|
} = _ref7;
|
|
281
298
|
var {
|
|
282
299
|
Int = {},
|
|
@@ -294,14 +311,18 @@ export var TypeInt = _ref7 => {
|
|
|
294
311
|
style
|
|
295
312
|
}), {
|
|
296
313
|
type: 'type',
|
|
297
|
-
value: children
|
|
314
|
+
value: children,
|
|
315
|
+
keyName,
|
|
316
|
+
keys
|
|
298
317
|
});
|
|
299
318
|
var child = isRender && render(_extends({}, reset, {
|
|
300
319
|
children,
|
|
301
320
|
className: 'w-rjv-value'
|
|
302
321
|
}), {
|
|
303
322
|
type: 'value',
|
|
304
|
-
value: children
|
|
323
|
+
value: children,
|
|
324
|
+
keyName,
|
|
325
|
+
keys
|
|
305
326
|
});
|
|
306
327
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
307
328
|
children: [displayDataTypes && (type || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
@@ -309,19 +330,15 @@ export var TypeInt = _ref7 => {
|
|
|
309
330
|
}))), child || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
310
331
|
className: "w-rjv-value",
|
|
311
332
|
children: children == null ? void 0 : children.toString()
|
|
312
|
-
}))
|
|
313
|
-
keyName: keyName,
|
|
314
|
-
value: children,
|
|
315
|
-
expandKey: expandKey
|
|
316
|
-
})]
|
|
333
|
+
}))]
|
|
317
334
|
});
|
|
318
335
|
};
|
|
319
336
|
TypeInt.displayName = 'JVR.TypeInt';
|
|
320
337
|
export var TypeBigint = _ref8 => {
|
|
321
338
|
var {
|
|
322
339
|
children,
|
|
323
|
-
|
|
324
|
-
|
|
340
|
+
keyName,
|
|
341
|
+
keys
|
|
325
342
|
} = _ref8;
|
|
326
343
|
var {
|
|
327
344
|
Bigint: CompBigint = {},
|
|
@@ -339,34 +356,34 @@ export var TypeBigint = _ref8 => {
|
|
|
339
356
|
style
|
|
340
357
|
}), {
|
|
341
358
|
type: 'type',
|
|
342
|
-
value: children
|
|
359
|
+
value: children,
|
|
360
|
+
keyName,
|
|
361
|
+
keys
|
|
343
362
|
});
|
|
344
363
|
var child = isRender && render(_extends({}, reset, {
|
|
345
364
|
children,
|
|
346
365
|
className: 'w-rjv-value'
|
|
347
366
|
}), {
|
|
348
367
|
type: 'value',
|
|
349
|
-
value: children
|
|
368
|
+
value: children,
|
|
369
|
+
keyName,
|
|
370
|
+
keys
|
|
350
371
|
});
|
|
351
372
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
352
373
|
children: [displayDataTypes && (type || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
353
374
|
style: style
|
|
354
375
|
}))), child || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
355
376
|
className: "w-rjv-value",
|
|
356
|
-
children: (children == null ? void 0 : children.toString())
|
|
357
|
-
}))
|
|
358
|
-
keyName: keyName,
|
|
359
|
-
value: children,
|
|
360
|
-
expandKey: expandKey
|
|
361
|
-
})]
|
|
377
|
+
children: bigIntToString(children == null ? void 0 : children.toString())
|
|
378
|
+
}))]
|
|
362
379
|
});
|
|
363
380
|
};
|
|
364
381
|
TypeBigint.displayName = 'JVR.TypeFloat';
|
|
365
382
|
export var TypeUrl = _ref9 => {
|
|
366
383
|
var {
|
|
367
384
|
children,
|
|
368
|
-
|
|
369
|
-
|
|
385
|
+
keyName,
|
|
386
|
+
keys
|
|
370
387
|
} = _ref9;
|
|
371
388
|
var {
|
|
372
389
|
Url = {},
|
|
@@ -384,14 +401,18 @@ export var TypeUrl = _ref9 => {
|
|
|
384
401
|
style
|
|
385
402
|
}), {
|
|
386
403
|
type: 'type',
|
|
387
|
-
value: children
|
|
404
|
+
value: children,
|
|
405
|
+
keyName,
|
|
406
|
+
keys
|
|
388
407
|
});
|
|
389
408
|
var child = isRender && render(_extends({}, reset, {
|
|
390
409
|
children: children == null ? void 0 : children.href,
|
|
391
410
|
className: 'w-rjv-value'
|
|
392
411
|
}), {
|
|
393
412
|
type: 'value',
|
|
394
|
-
value: children
|
|
413
|
+
value: children,
|
|
414
|
+
keyName,
|
|
415
|
+
keys
|
|
395
416
|
});
|
|
396
417
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
397
418
|
children: [displayDataTypes && (type || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
@@ -402,20 +423,16 @@ export var TypeUrl = _ref9 => {
|
|
|
402
423
|
}, reset, {
|
|
403
424
|
className: "w-rjv-value",
|
|
404
425
|
children: [/*#__PURE__*/_jsx(ValueQuote, {}), children == null ? void 0 : children.href, /*#__PURE__*/_jsx(ValueQuote, {})]
|
|
405
|
-
}))
|
|
406
|
-
keyName: keyName,
|
|
407
|
-
value: children,
|
|
408
|
-
expandKey: expandKey
|
|
409
|
-
})]
|
|
426
|
+
}))]
|
|
410
427
|
});
|
|
411
428
|
};
|
|
412
429
|
TypeUrl.displayName = 'JVR.TypeUrl';
|
|
413
|
-
export var TypeDate =
|
|
430
|
+
export var TypeDate = _ref0 => {
|
|
414
431
|
var {
|
|
415
432
|
children,
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
} =
|
|
433
|
+
keyName,
|
|
434
|
+
keys
|
|
435
|
+
} = _ref0;
|
|
419
436
|
var {
|
|
420
437
|
Date: CompData = {},
|
|
421
438
|
displayDataTypes
|
|
@@ -424,7 +441,7 @@ export var TypeDate = _ref10 => {
|
|
|
424
441
|
as,
|
|
425
442
|
render
|
|
426
443
|
} = CompData,
|
|
427
|
-
reset = _objectWithoutPropertiesLoose(CompData,
|
|
444
|
+
reset = _objectWithoutPropertiesLoose(CompData, _excluded0);
|
|
428
445
|
var Comp = as || 'span';
|
|
429
446
|
var style = _extends({}, defalutStyle, CompData.style || {});
|
|
430
447
|
var isRender = render && typeof render === 'function';
|
|
@@ -432,15 +449,19 @@ export var TypeDate = _ref10 => {
|
|
|
432
449
|
style
|
|
433
450
|
}), {
|
|
434
451
|
type: 'type',
|
|
435
|
-
value: children
|
|
452
|
+
value: children,
|
|
453
|
+
keyName,
|
|
454
|
+
keys
|
|
436
455
|
});
|
|
437
|
-
var childStr = children
|
|
456
|
+
var childStr = children instanceof Date ? children.toLocaleString() : children;
|
|
438
457
|
var child = isRender && render(_extends({}, reset, {
|
|
439
458
|
children: childStr,
|
|
440
459
|
className: 'w-rjv-value'
|
|
441
460
|
}), {
|
|
442
461
|
type: 'value',
|
|
443
|
-
value: children
|
|
462
|
+
value: children,
|
|
463
|
+
keyName,
|
|
464
|
+
keys
|
|
444
465
|
});
|
|
445
466
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
446
467
|
children: [displayDataTypes && (type || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
@@ -448,20 +469,16 @@ export var TypeDate = _ref10 => {
|
|
|
448
469
|
}))), child || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
449
470
|
className: "w-rjv-value",
|
|
450
471
|
children: childStr
|
|
451
|
-
}))
|
|
452
|
-
keyName: keyName,
|
|
453
|
-
value: children,
|
|
454
|
-
expandKey: expandKey
|
|
455
|
-
})]
|
|
472
|
+
}))]
|
|
456
473
|
});
|
|
457
474
|
};
|
|
458
475
|
TypeDate.displayName = 'JVR.TypeDate';
|
|
459
|
-
export var TypeUndefined =
|
|
476
|
+
export var TypeUndefined = _ref1 => {
|
|
460
477
|
var {
|
|
461
478
|
children,
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
} =
|
|
479
|
+
keyName,
|
|
480
|
+
keys
|
|
481
|
+
} = _ref1;
|
|
465
482
|
var {
|
|
466
483
|
Undefined = {},
|
|
467
484
|
displayDataTypes
|
|
@@ -470,7 +487,7 @@ export var TypeUndefined = _ref11 => {
|
|
|
470
487
|
as,
|
|
471
488
|
render
|
|
472
489
|
} = Undefined,
|
|
473
|
-
reset = _objectWithoutPropertiesLoose(Undefined,
|
|
490
|
+
reset = _objectWithoutPropertiesLoose(Undefined, _excluded1);
|
|
474
491
|
var Comp = as || 'span';
|
|
475
492
|
var style = _extends({}, defalutStyle, Undefined.style || {});
|
|
476
493
|
var isRender = render && typeof render === 'function';
|
|
@@ -478,32 +495,32 @@ export var TypeUndefined = _ref11 => {
|
|
|
478
495
|
style
|
|
479
496
|
}), {
|
|
480
497
|
type: 'type',
|
|
481
|
-
value: children
|
|
498
|
+
value: children,
|
|
499
|
+
keyName,
|
|
500
|
+
keys
|
|
482
501
|
});
|
|
483
502
|
var child = isRender && render(_extends({}, reset, {
|
|
484
503
|
children,
|
|
485
504
|
className: 'w-rjv-value'
|
|
486
505
|
}), {
|
|
487
506
|
type: 'value',
|
|
488
|
-
value: children
|
|
507
|
+
value: children,
|
|
508
|
+
keyName,
|
|
509
|
+
keys
|
|
489
510
|
});
|
|
490
511
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
491
512
|
children: [displayDataTypes && (type || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
492
513
|
style: style
|
|
493
|
-
}))), child
|
|
494
|
-
keyName: keyName,
|
|
495
|
-
value: children,
|
|
496
|
-
expandKey: expandKey
|
|
497
|
-
})]
|
|
514
|
+
}))), child]
|
|
498
515
|
});
|
|
499
516
|
};
|
|
500
517
|
TypeUndefined.displayName = 'JVR.TypeUndefined';
|
|
501
|
-
export var TypeNull =
|
|
518
|
+
export var TypeNull = _ref10 => {
|
|
502
519
|
var {
|
|
503
520
|
children,
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
} =
|
|
521
|
+
keyName,
|
|
522
|
+
keys
|
|
523
|
+
} = _ref10;
|
|
507
524
|
var {
|
|
508
525
|
Null = {},
|
|
509
526
|
displayDataTypes
|
|
@@ -512,7 +529,7 @@ export var TypeNull = _ref12 => {
|
|
|
512
529
|
as,
|
|
513
530
|
render
|
|
514
531
|
} = Null,
|
|
515
|
-
reset = _objectWithoutPropertiesLoose(Null,
|
|
532
|
+
reset = _objectWithoutPropertiesLoose(Null, _excluded10);
|
|
516
533
|
var Comp = as || 'span';
|
|
517
534
|
var style = _extends({}, defalutStyle, Null.style || {});
|
|
518
535
|
var isRender = render && typeof render === 'function';
|
|
@@ -520,32 +537,32 @@ export var TypeNull = _ref12 => {
|
|
|
520
537
|
style
|
|
521
538
|
}), {
|
|
522
539
|
type: 'type',
|
|
523
|
-
value: children
|
|
540
|
+
value: children,
|
|
541
|
+
keyName,
|
|
542
|
+
keys
|
|
524
543
|
});
|
|
525
544
|
var child = isRender && render(_extends({}, reset, {
|
|
526
545
|
children,
|
|
527
546
|
className: 'w-rjv-value'
|
|
528
547
|
}), {
|
|
529
548
|
type: 'value',
|
|
530
|
-
value: children
|
|
549
|
+
value: children,
|
|
550
|
+
keyName,
|
|
551
|
+
keys
|
|
531
552
|
});
|
|
532
553
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
533
554
|
children: [displayDataTypes && (type || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
534
555
|
style: style
|
|
535
|
-
}))), child
|
|
536
|
-
keyName: keyName,
|
|
537
|
-
value: children,
|
|
538
|
-
expandKey: expandKey
|
|
539
|
-
})]
|
|
556
|
+
}))), child]
|
|
540
557
|
});
|
|
541
558
|
};
|
|
542
559
|
TypeNull.displayName = 'JVR.TypeNull';
|
|
543
|
-
export var TypeNan =
|
|
560
|
+
export var TypeNan = _ref11 => {
|
|
544
561
|
var {
|
|
545
562
|
children,
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
} =
|
|
563
|
+
keyName,
|
|
564
|
+
keys
|
|
565
|
+
} = _ref11;
|
|
549
566
|
var {
|
|
550
567
|
Nan = {},
|
|
551
568
|
displayDataTypes
|
|
@@ -554,7 +571,7 @@ export var TypeNan = _ref13 => {
|
|
|
554
571
|
as,
|
|
555
572
|
render
|
|
556
573
|
} = Nan,
|
|
557
|
-
reset = _objectWithoutPropertiesLoose(Nan,
|
|
574
|
+
reset = _objectWithoutPropertiesLoose(Nan, _excluded11);
|
|
558
575
|
var Comp = as || 'span';
|
|
559
576
|
var style = _extends({}, defalutStyle, Nan.style || {});
|
|
560
577
|
var isRender = render && typeof render === 'function';
|
|
@@ -562,23 +579,23 @@ export var TypeNan = _ref13 => {
|
|
|
562
579
|
style
|
|
563
580
|
}), {
|
|
564
581
|
type: 'type',
|
|
565
|
-
value: children
|
|
582
|
+
value: children,
|
|
583
|
+
keyName,
|
|
584
|
+
keys
|
|
566
585
|
});
|
|
567
586
|
var child = isRender && render(_extends({}, reset, {
|
|
568
587
|
children: children == null ? void 0 : children.toString(),
|
|
569
588
|
className: 'w-rjv-value'
|
|
570
589
|
}), {
|
|
571
590
|
type: 'value',
|
|
572
|
-
value: children
|
|
591
|
+
value: children,
|
|
592
|
+
keyName,
|
|
593
|
+
keys
|
|
573
594
|
});
|
|
574
595
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
575
596
|
children: [displayDataTypes && (type || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
576
597
|
style: style
|
|
577
|
-
}))), child
|
|
578
|
-
keyName: keyName,
|
|
579
|
-
value: children,
|
|
580
|
-
expandKey: expandKey
|
|
581
|
-
})]
|
|
598
|
+
}))), child]
|
|
582
599
|
});
|
|
583
600
|
};
|
|
584
601
|
TypeNan.displayName = 'JVR.TypeNan';
|
package/esm/utils/useRender.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType, type TypesElement } from '../store/Types';
|
|
3
3
|
import { type SectionElement } from '../store/Section';
|
|
4
|
-
export declare function useSymbolsRender(currentProps: SymbolsElement<TagType>, props: SymbolsElement<
|
|
4
|
+
export declare function useSymbolsRender<K extends TagType>(currentProps: SymbolsElement<TagType>, props: SymbolsElement<K>, key: string): void;
|
|
5
5
|
export declare function useTypesRender<K extends TagType>(currentProps: TypesElement<TagType>, props: TypesElement<K>, key: string): void;
|
|
6
6
|
export declare function useSectionRender<K extends TagType>(currentProps: SectionElement<TagType>, props: SectionElement<K>, key: string): void;
|
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(' ');
|
package/githubDark.d.ts
ADDED
package/githubLight.d.ts
ADDED
package/gruvbox.d.ts
ADDED
package/light.d.ts
CHANGED
package/monokai.d.ts
ADDED
package/nord.d.ts
ADDED