@uiw/react-json-view 2.0.0-alpha.2 → 2.0.0-alpha.21
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 +146 -21
- package/basic.d.ts +3 -0
- package/cjs/Container.d.ts +2 -0
- package/cjs/Container.js +9 -4
- package/cjs/arrow/TriangleArrow.js +1 -1
- package/cjs/comps/Copied.d.ts +2 -3
- package/cjs/comps/Copied.js +29 -16
- package/cjs/comps/KeyValues.d.ts +2 -4
- package/cjs/comps/KeyValues.js +49 -24
- package/cjs/comps/NestedClose.js +3 -4
- package/cjs/comps/NestedOpen.d.ts +2 -3
- package/cjs/comps/NestedOpen.js +23 -17
- package/cjs/comps/Value.d.ts +1 -2
- package/cjs/comps/Value.js +16 -20
- package/cjs/editor/KeyName.d.ts +2 -0
- package/cjs/editor/KeyName.js +82 -0
- package/cjs/editor/index.d.ts +19 -0
- package/cjs/editor/index.js +44 -0
- package/cjs/editor/store.d.ts +28 -0
- package/cjs/editor/store.js +23 -0
- package/cjs/index.d.ts +5 -3
- package/cjs/index.js +11 -8
- package/cjs/section/Copied.d.ts +1 -1
- package/cjs/section/Copied.js +1 -2
- package/cjs/section/CountInfo.d.ts +10 -1
- package/cjs/section/CountInfo.js +42 -4
- package/cjs/section/CountInfoExtra.d.ts +10 -1
- package/cjs/section/CountInfoExtra.js +32 -4
- package/cjs/section/Ellipsis.d.ts +10 -0
- package/cjs/section/Ellipsis.js +30 -4
- package/cjs/section/KeyName.d.ts +8 -0
- package/cjs/section/KeyName.js +40 -4
- package/cjs/section/Row.d.ts +14 -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 +2 -2
- package/cjs/store/Symbols.js +2 -4
- package/cjs/store/Types.d.ts +28 -24
- package/cjs/store/Types.js +8 -8
- package/cjs/store.d.ts +7 -4
- 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/{esm/comps/ReRender/Symbols.d.ts → cjs/symbol/index.d.ts} +4 -6
- package/cjs/{comps/ReRender/Symbols.js → symbol/index.js} +32 -33
- package/cjs/theme/basic.js +4 -3
- package/cjs/theme/dark.js +2 -3
- package/cjs/theme/github.dark.js +2 -3
- package/cjs/theme/github.light.js +2 -3
- package/cjs/theme/gruvbox.js +2 -3
- package/cjs/theme/light.js +2 -3
- package/cjs/theme/monokai.js +2 -3
- package/cjs/theme/nord.js +2 -3
- 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/{esm/comps/ReRender/Types.d.ts → cjs/types/index.d.ts} +2 -2
- package/cjs/{comps/ReRender/Types.js → types/index.js} +92 -171
- package/cjs/utils/useHighlight.js +0 -1
- package/cjs/utils/useRender.d.ts +1 -1
- package/editor.d.ts +22 -20
- package/esm/Container.d.ts +2 -0
- package/esm/Container.js +10 -4
- package/esm/arrow/TriangleArrow.js +1 -1
- package/esm/comps/Copied.d.ts +2 -3
- package/esm/comps/Copied.js +27 -15
- package/esm/comps/KeyValues.d.ts +2 -4
- package/esm/comps/KeyValues.js +37 -15
- package/esm/comps/NestedClose.js +1 -1
- package/esm/comps/NestedOpen.d.ts +2 -3
- package/esm/comps/NestedOpen.js +18 -12
- package/esm/comps/Value.d.ts +1 -2
- package/esm/comps/Value.js +3 -5
- package/esm/editor/KeyName.d.ts +2 -0
- package/esm/editor/KeyName.js +77 -0
- package/esm/editor/index.d.ts +19 -0
- package/esm/editor/index.js +33 -0
- package/esm/editor/store.d.ts +28 -0
- package/esm/editor/store.js +13 -0
- package/esm/index.d.ts +5 -3
- package/esm/index.js +9 -6
- package/esm/section/Copied.d.ts +1 -1
- package/esm/section/CountInfo.d.ts +10 -1
- package/esm/section/CountInfo.js +43 -1
- package/esm/section/CountInfoExtra.d.ts +10 -1
- package/esm/section/CountInfoExtra.js +32 -1
- package/esm/section/Ellipsis.d.ts +10 -0
- package/esm/section/Ellipsis.js +31 -1
- package/esm/section/KeyName.d.ts +8 -0
- package/esm/section/KeyName.js +41 -1
- package/esm/section/Row.d.ts +14 -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 +2 -2
- package/esm/store/Types.d.ts +28 -24
- package/esm/store/Types.js +6 -4
- package/esm/store.d.ts +7 -4
- package/esm/symbol/Arrow.d.ts +1 -1
- package/esm/symbol/BraceLeft.d.ts +1 -1
- package/esm/symbol/BraceRight.d.ts +1 -1
- package/esm/symbol/BracketsLeft.d.ts +1 -1
- package/esm/symbol/BracketsRight.d.ts +1 -1
- package/esm/symbol/Colon.d.ts +1 -1
- package/esm/symbol/Quote.d.ts +1 -1
- package/esm/symbol/ValueQuote.d.ts +1 -1
- package/{cjs/comps/ReRender/Symbols.d.ts → esm/symbol/index.d.ts} +4 -6
- package/esm/{comps/ReRender/Symbols.js → symbol/index.js} +26 -24
- package/esm/theme/basic.js +2 -0
- package/esm/types/Bigint.d.ts +1 -1
- package/esm/types/Date.d.ts +1 -1
- package/esm/types/False.d.ts +1 -1
- package/esm/types/Float.d.ts +1 -1
- package/esm/types/Int.d.ts +1 -1
- package/esm/types/Map.d.ts +1 -1
- package/esm/types/Nan.d.ts +1 -1
- package/esm/types/Null.d.ts +1 -1
- package/esm/types/Set.d.ts +1 -1
- package/esm/types/String.d.ts +1 -1
- package/esm/types/True.d.ts +1 -1
- package/esm/types/Undefined.d.ts +1 -1
- package/esm/types/Url.d.ts +1 -1
- package/{cjs/comps/ReRender/Types.d.ts → esm/types/index.d.ts} +2 -2
- package/esm/{comps/ReRender/Types.js → types/index.js} +76 -148
- package/esm/utils/useHighlight.js +0 -1
- package/esm/utils/useRender.d.ts +1 -1
- package/githubDark.d.ts +3 -0
- package/githubLight.d.ts +3 -0
- package/gruvbox.d.ts +3 -0
- package/monokai.d.ts +3 -0
- package/nord.d.ts +3 -0
- package/package.json +11 -5
- package/vscode.d.ts +3 -0
- package/cjs/comps/CountInfo.d.ts +0 -19
- package/cjs/comps/CountInfo.js +0 -72
- package/cjs/comps/Ellipsis.d.ts +0 -10
- package/cjs/comps/Ellipsis.js +0 -35
- package/cjs/comps/Key.d.ts +0 -7
- package/cjs/comps/Key.js +0 -41
- package/esm/comps/CountInfo.d.ts +0 -19
- package/esm/comps/CountInfo.js +0 -70
- package/esm/comps/Ellipsis.d.ts +0 -10
- package/esm/comps/Ellipsis.js +0 -31
- package/esm/comps/Key.d.ts +0 -7
- package/esm/comps/Key.js +0 -37
|
@@ -4,15 +4,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.TypeUrl = exports.TypeUndefined = exports.TypeTrue = exports.TypeString = exports.TypeNull = exports.TypeNan = exports.TypeInt = exports.TypeFloat = exports.TypeFalse = exports.
|
|
7
|
+
exports.TypeUrl = exports.TypeUndefined = exports.TypeTrue = exports.TypeString = exports.TypeNull = exports.TypeNan = exports.TypeInt = exports.TypeFloat = exports.TypeFalse = exports.TypeDate = exports.TypeBigint = exports.SetComp = exports.MapComp = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _react = require("react");
|
|
12
|
-
var _Types = require("
|
|
13
|
-
var _store = require("
|
|
14
|
-
var
|
|
15
|
-
var _Copied = require("../Copied");
|
|
12
|
+
var _Types = require("../store/Types");
|
|
13
|
+
var _store = require("../store");
|
|
14
|
+
var _symbol = require("../symbol");
|
|
16
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
16
|
var _excluded = ["as", "render"],
|
|
18
17
|
_excluded2 = ["as", "render"],
|
|
@@ -26,10 +25,10 @@ var _excluded = ["as", "render"],
|
|
|
26
25
|
_excluded10 = ["as", "render"],
|
|
27
26
|
_excluded11 = ["as", "render"],
|
|
28
27
|
_excluded12 = ["as", "render"],
|
|
29
|
-
_excluded13 = ["as", "render"]
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
|
|
28
|
+
_excluded13 = ["as", "render"];
|
|
29
|
+
var SetComp = exports.SetComp = function SetComp(_ref) {
|
|
30
|
+
var value = _ref.value,
|
|
31
|
+
keyName = _ref.keyName;
|
|
33
32
|
var _useTypesStore = (0, _Types.useTypesStore)(),
|
|
34
33
|
_useTypesStore$Set = _useTypesStore.Set,
|
|
35
34
|
Comp = _useTypesStore$Set === void 0 ? {} : _useTypesStore$Set,
|
|
@@ -42,16 +41,17 @@ var SetComp = function SetComp(_ref) {
|
|
|
42
41
|
var isRender = render && typeof render === 'function';
|
|
43
42
|
var type = isRender && render(reset, {
|
|
44
43
|
type: 'type',
|
|
45
|
-
value: value
|
|
44
|
+
value: value,
|
|
45
|
+
keyName: keyName
|
|
46
46
|
});
|
|
47
47
|
if (type) return type;
|
|
48
48
|
var Elm = as || 'span';
|
|
49
49
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Elm, (0, _objectSpread2["default"])({}, reset));
|
|
50
50
|
};
|
|
51
|
-
exports.SetComp = SetComp;
|
|
52
51
|
SetComp.displayName = 'JVR.SetComp';
|
|
53
|
-
var MapComp = function MapComp(_ref2) {
|
|
54
|
-
var value = _ref2.value
|
|
52
|
+
var MapComp = exports.MapComp = function MapComp(_ref2) {
|
|
53
|
+
var value = _ref2.value,
|
|
54
|
+
keyName = _ref2.keyName;
|
|
55
55
|
var _useTypesStore2 = (0, _Types.useTypesStore)(),
|
|
56
56
|
_useTypesStore2$Map = _useTypesStore2.Map,
|
|
57
57
|
Comp = _useTypesStore2$Map === void 0 ? {} : _useTypesStore2$Map,
|
|
@@ -64,22 +64,21 @@ var MapComp = function MapComp(_ref2) {
|
|
|
64
64
|
var isRender = render && typeof render === 'function';
|
|
65
65
|
var type = isRender && render(reset, {
|
|
66
66
|
type: 'type',
|
|
67
|
-
value: value
|
|
67
|
+
value: value,
|
|
68
|
+
keyName: keyName
|
|
68
69
|
});
|
|
69
70
|
if (type) return type;
|
|
70
71
|
var Elm = as || 'span';
|
|
71
72
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Elm, (0, _objectSpread2["default"])({}, reset));
|
|
72
73
|
};
|
|
73
|
-
exports.MapComp = MapComp;
|
|
74
74
|
MapComp.displayName = 'JVR.MapComp';
|
|
75
75
|
var defalutStyle = {
|
|
76
76
|
opacity: 0.75,
|
|
77
77
|
paddingRight: 4
|
|
78
78
|
};
|
|
79
|
-
var TypeString = function TypeString(_ref3) {
|
|
79
|
+
var TypeString = exports.TypeString = function TypeString(_ref3) {
|
|
80
80
|
var _ref3$children = _ref3.children,
|
|
81
81
|
children = _ref3$children === void 0 ? '' : _ref3$children,
|
|
82
|
-
expandKey = _ref3.expandKey,
|
|
83
82
|
keyName = _ref3.keyName;
|
|
84
83
|
var _useTypesStore3 = (0, _Types.useTypesStore)(),
|
|
85
84
|
_useTypesStore3$Str = _useTypesStore3.Str,
|
|
@@ -87,7 +86,7 @@ var TypeString = function TypeString(_ref3) {
|
|
|
87
86
|
displayDataTypes = _useTypesStore3.displayDataTypes;
|
|
88
87
|
var _useStore = (0, _store.useStore)(),
|
|
89
88
|
_useStore$shortenText = _useStore.shortenTextAfterLength,
|
|
90
|
-
length = _useStore$shortenText === void 0 ?
|
|
89
|
+
length = _useStore$shortenText === void 0 ? 30 : _useStore$shortenText;
|
|
91
90
|
var as = Str.as,
|
|
92
91
|
render = Str.render,
|
|
93
92
|
reset = (0, _objectWithoutProperties2["default"])(Str, _excluded3);
|
|
@@ -96,6 +95,9 @@ var TypeString = function TypeString(_ref3) {
|
|
|
96
95
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
97
96
|
shorten = _useState2[0],
|
|
98
97
|
setShorten = _useState2[1];
|
|
98
|
+
(0, _react.useEffect)(function () {
|
|
99
|
+
return setShorten(length && childrenStr.length >= length);
|
|
100
|
+
}, [length]);
|
|
99
101
|
var Comp = as || 'span';
|
|
100
102
|
var style = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, defalutStyle), Str.style || {});
|
|
101
103
|
if (length > 0) {
|
|
@@ -104,7 +106,6 @@ var TypeString = function TypeString(_ref3) {
|
|
|
104
106
|
});
|
|
105
107
|
if (childrenStr.length > length) {
|
|
106
108
|
reset.onClick = function () {
|
|
107
|
-
if (length && childrenStr.length <= length) return setShorten(false);
|
|
108
109
|
setShorten(!shorten);
|
|
109
110
|
};
|
|
110
111
|
}
|
|
@@ -115,33 +116,31 @@ var TypeString = function TypeString(_ref3) {
|
|
|
115
116
|
style: style
|
|
116
117
|
}), {
|
|
117
118
|
type: 'type',
|
|
118
|
-
value: children
|
|
119
|
+
value: children,
|
|
120
|
+
keyName: keyName
|
|
119
121
|
});
|
|
120
122
|
var child = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
121
123
|
children: text,
|
|
122
124
|
className: 'w-rjv-value'
|
|
123
125
|
}), {
|
|
124
126
|
type: 'value',
|
|
125
|
-
value: children
|
|
127
|
+
value: children,
|
|
128
|
+
keyName: keyName
|
|
126
129
|
});
|
|
127
130
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
128
131
|
children: [displayDataTypes && (type || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
129
132
|
style: style
|
|
130
|
-
}))), child || /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
value: children,
|
|
136
|
-
expandKey: expandKey
|
|
133
|
+
}))), child || /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
134
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_symbol.ValueQuote, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
135
|
+
className: "w-rjv-value",
|
|
136
|
+
children: text
|
|
137
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_symbol.ValueQuote, {})]
|
|
137
138
|
})]
|
|
138
139
|
});
|
|
139
140
|
};
|
|
140
|
-
exports.TypeString = TypeString;
|
|
141
141
|
TypeString.displayName = 'JVR.TypeString';
|
|
142
|
-
var TypeTrue = function TypeTrue(_ref4) {
|
|
142
|
+
var TypeTrue = exports.TypeTrue = function TypeTrue(_ref4) {
|
|
143
143
|
var children = _ref4.children,
|
|
144
|
-
expandKey = _ref4.expandKey,
|
|
145
144
|
keyName = _ref4.keyName;
|
|
146
145
|
var _useTypesStore4 = (0, _Types.useTypesStore)(),
|
|
147
146
|
_useTypesStore4$True = _useTypesStore4.True,
|
|
@@ -157,14 +156,16 @@ var TypeTrue = function TypeTrue(_ref4) {
|
|
|
157
156
|
style: style
|
|
158
157
|
}), {
|
|
159
158
|
type: 'type',
|
|
160
|
-
value: children
|
|
159
|
+
value: children,
|
|
160
|
+
keyName: keyName
|
|
161
161
|
});
|
|
162
162
|
var child = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
163
163
|
children: children,
|
|
164
164
|
className: 'w-rjv-value'
|
|
165
165
|
}), {
|
|
166
166
|
type: 'value',
|
|
167
|
-
value: children
|
|
167
|
+
value: children,
|
|
168
|
+
keyName: keyName
|
|
168
169
|
});
|
|
169
170
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
170
171
|
children: [displayDataTypes && (type || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
@@ -172,18 +173,12 @@ var TypeTrue = function TypeTrue(_ref4) {
|
|
|
172
173
|
}))), child || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
173
174
|
className: "w-rjv-value",
|
|
174
175
|
children: children === null || children === void 0 ? void 0 : children.toString()
|
|
175
|
-
}))
|
|
176
|
-
keyName: keyName,
|
|
177
|
-
value: children,
|
|
178
|
-
expandKey: expandKey
|
|
179
|
-
})]
|
|
176
|
+
}))]
|
|
180
177
|
});
|
|
181
178
|
};
|
|
182
|
-
exports.TypeTrue = TypeTrue;
|
|
183
179
|
TypeTrue.displayName = 'JVR.TypeTrue';
|
|
184
|
-
var TypeFalse = function TypeFalse(_ref5) {
|
|
180
|
+
var TypeFalse = exports.TypeFalse = function TypeFalse(_ref5) {
|
|
185
181
|
var children = _ref5.children,
|
|
186
|
-
expandKey = _ref5.expandKey,
|
|
187
182
|
keyName = _ref5.keyName;
|
|
188
183
|
var _useTypesStore5 = (0, _Types.useTypesStore)(),
|
|
189
184
|
_useTypesStore5$False = _useTypesStore5.False,
|
|
@@ -199,14 +194,16 @@ var TypeFalse = function TypeFalse(_ref5) {
|
|
|
199
194
|
style: style
|
|
200
195
|
}), {
|
|
201
196
|
type: 'type',
|
|
202
|
-
value: children
|
|
197
|
+
value: children,
|
|
198
|
+
keyName: keyName
|
|
203
199
|
});
|
|
204
200
|
var child = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
205
201
|
children: children,
|
|
206
202
|
className: 'w-rjv-value'
|
|
207
203
|
}), {
|
|
208
204
|
type: 'value',
|
|
209
|
-
value: children
|
|
205
|
+
value: children,
|
|
206
|
+
keyName: keyName
|
|
210
207
|
});
|
|
211
208
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
212
209
|
children: [displayDataTypes && (type || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
@@ -214,18 +211,12 @@ var TypeFalse = function TypeFalse(_ref5) {
|
|
|
214
211
|
}))), child || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
215
212
|
className: "w-rjv-value",
|
|
216
213
|
children: children === null || children === void 0 ? void 0 : children.toString()
|
|
217
|
-
}))
|
|
218
|
-
keyName: keyName,
|
|
219
|
-
value: children,
|
|
220
|
-
expandKey: expandKey
|
|
221
|
-
})]
|
|
214
|
+
}))]
|
|
222
215
|
});
|
|
223
216
|
};
|
|
224
|
-
exports.TypeFalse = TypeFalse;
|
|
225
217
|
TypeFalse.displayName = 'JVR.TypeFalse';
|
|
226
|
-
var TypeFloat = function TypeFloat(_ref6) {
|
|
218
|
+
var TypeFloat = exports.TypeFloat = function TypeFloat(_ref6) {
|
|
227
219
|
var children = _ref6.children,
|
|
228
|
-
expandKey = _ref6.expandKey,
|
|
229
220
|
keyName = _ref6.keyName;
|
|
230
221
|
var _useTypesStore6 = (0, _Types.useTypesStore)(),
|
|
231
222
|
_useTypesStore6$Float = _useTypesStore6.Float,
|
|
@@ -241,14 +232,16 @@ var TypeFloat = function TypeFloat(_ref6) {
|
|
|
241
232
|
style: style
|
|
242
233
|
}), {
|
|
243
234
|
type: 'type',
|
|
244
|
-
value: children
|
|
235
|
+
value: children,
|
|
236
|
+
keyName: keyName
|
|
245
237
|
});
|
|
246
238
|
var child = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
247
239
|
children: children,
|
|
248
240
|
className: 'w-rjv-value'
|
|
249
241
|
}), {
|
|
250
242
|
type: 'value',
|
|
251
|
-
value: children
|
|
243
|
+
value: children,
|
|
244
|
+
keyName: keyName
|
|
252
245
|
});
|
|
253
246
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
254
247
|
children: [displayDataTypes && (type || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
@@ -256,18 +249,12 @@ var TypeFloat = function TypeFloat(_ref6) {
|
|
|
256
249
|
}))), child || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
257
250
|
className: "w-rjv-value",
|
|
258
251
|
children: children === null || children === void 0 ? void 0 : children.toString()
|
|
259
|
-
}))
|
|
260
|
-
keyName: keyName,
|
|
261
|
-
value: children,
|
|
262
|
-
expandKey: expandKey
|
|
263
|
-
})]
|
|
252
|
+
}))]
|
|
264
253
|
});
|
|
265
254
|
};
|
|
266
|
-
exports.TypeFloat = TypeFloat;
|
|
267
255
|
TypeFloat.displayName = 'JVR.TypeFloat';
|
|
268
|
-
var TypeInt = function TypeInt(_ref7) {
|
|
256
|
+
var TypeInt = exports.TypeInt = function TypeInt(_ref7) {
|
|
269
257
|
var children = _ref7.children,
|
|
270
|
-
expandKey = _ref7.expandKey,
|
|
271
258
|
keyName = _ref7.keyName;
|
|
272
259
|
var _useTypesStore7 = (0, _Types.useTypesStore)(),
|
|
273
260
|
_useTypesStore7$Int = _useTypesStore7.Int,
|
|
@@ -283,14 +270,16 @@ var TypeInt = function TypeInt(_ref7) {
|
|
|
283
270
|
style: style
|
|
284
271
|
}), {
|
|
285
272
|
type: 'type',
|
|
286
|
-
value: children
|
|
273
|
+
value: children,
|
|
274
|
+
keyName: keyName
|
|
287
275
|
});
|
|
288
276
|
var child = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
289
277
|
children: children,
|
|
290
278
|
className: 'w-rjv-value'
|
|
291
279
|
}), {
|
|
292
280
|
type: 'value',
|
|
293
|
-
value: children
|
|
281
|
+
value: children,
|
|
282
|
+
keyName: keyName
|
|
294
283
|
});
|
|
295
284
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
296
285
|
children: [displayDataTypes && (type || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
@@ -298,18 +287,12 @@ var TypeInt = function TypeInt(_ref7) {
|
|
|
298
287
|
}))), child || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
299
288
|
className: "w-rjv-value",
|
|
300
289
|
children: children === null || children === void 0 ? void 0 : children.toString()
|
|
301
|
-
}))
|
|
302
|
-
keyName: keyName,
|
|
303
|
-
value: children,
|
|
304
|
-
expandKey: expandKey
|
|
305
|
-
})]
|
|
290
|
+
}))]
|
|
306
291
|
});
|
|
307
292
|
};
|
|
308
|
-
exports.TypeInt = TypeInt;
|
|
309
293
|
TypeInt.displayName = 'JVR.TypeInt';
|
|
310
|
-
var TypeBigint = function TypeBigint(_ref8) {
|
|
294
|
+
var TypeBigint = exports.TypeBigint = function TypeBigint(_ref8) {
|
|
311
295
|
var children = _ref8.children,
|
|
312
|
-
expandKey = _ref8.expandKey,
|
|
313
296
|
keyName = _ref8.keyName;
|
|
314
297
|
var _useTypesStore8 = (0, _Types.useTypesStore)(),
|
|
315
298
|
_useTypesStore8$Bigin = _useTypesStore8.Bigint,
|
|
@@ -325,14 +308,16 @@ var TypeBigint = function TypeBigint(_ref8) {
|
|
|
325
308
|
style: style
|
|
326
309
|
}), {
|
|
327
310
|
type: 'type',
|
|
328
|
-
value: children
|
|
311
|
+
value: children,
|
|
312
|
+
keyName: keyName
|
|
329
313
|
});
|
|
330
314
|
var child = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
331
315
|
children: children,
|
|
332
316
|
className: 'w-rjv-value'
|
|
333
317
|
}), {
|
|
334
318
|
type: 'value',
|
|
335
|
-
value: children
|
|
319
|
+
value: children,
|
|
320
|
+
keyName: keyName
|
|
336
321
|
});
|
|
337
322
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
338
323
|
children: [displayDataTypes && (type || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
@@ -340,18 +325,12 @@ var TypeBigint = function TypeBigint(_ref8) {
|
|
|
340
325
|
}))), child || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
341
326
|
className: "w-rjv-value",
|
|
342
327
|
children: (children === null || children === void 0 ? void 0 : children.toString()) + 'n'
|
|
343
|
-
}))
|
|
344
|
-
keyName: keyName,
|
|
345
|
-
value: children,
|
|
346
|
-
expandKey: expandKey
|
|
347
|
-
})]
|
|
328
|
+
}))]
|
|
348
329
|
});
|
|
349
330
|
};
|
|
350
|
-
exports.TypeBigint = TypeBigint;
|
|
351
331
|
TypeBigint.displayName = 'JVR.TypeFloat';
|
|
352
|
-
var TypeUrl = function TypeUrl(_ref9) {
|
|
332
|
+
var TypeUrl = exports.TypeUrl = function TypeUrl(_ref9) {
|
|
353
333
|
var children = _ref9.children,
|
|
354
|
-
expandKey = _ref9.expandKey,
|
|
355
334
|
keyName = _ref9.keyName;
|
|
356
335
|
var _useTypesStore9 = (0, _Types.useTypesStore)(),
|
|
357
336
|
_useTypesStore9$Url = _useTypesStore9.Url,
|
|
@@ -367,14 +346,16 @@ var TypeUrl = function TypeUrl(_ref9) {
|
|
|
367
346
|
style: style
|
|
368
347
|
}), {
|
|
369
348
|
type: 'type',
|
|
370
|
-
value: children
|
|
349
|
+
value: children,
|
|
350
|
+
keyName: keyName
|
|
371
351
|
});
|
|
372
352
|
var child = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
373
353
|
children: children === null || children === void 0 ? void 0 : children.href,
|
|
374
354
|
className: 'w-rjv-value'
|
|
375
355
|
}), {
|
|
376
356
|
type: 'value',
|
|
377
|
-
value: children
|
|
357
|
+
value: children,
|
|
358
|
+
keyName: keyName
|
|
378
359
|
});
|
|
379
360
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
380
361
|
children: [displayDataTypes && (type || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
@@ -384,19 +365,13 @@ var TypeUrl = function TypeUrl(_ref9) {
|
|
|
384
365
|
target: "_blank"
|
|
385
366
|
}, reset), {}, {
|
|
386
367
|
className: "w-rjv-value",
|
|
387
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
388
|
-
}))
|
|
389
|
-
keyName: keyName,
|
|
390
|
-
value: children,
|
|
391
|
-
expandKey: expandKey
|
|
392
|
-
})]
|
|
368
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_symbol.ValueQuote, {}), children === null || children === void 0 ? void 0 : children.href, /*#__PURE__*/(0, _jsxRuntime.jsx)(_symbol.ValueQuote, {})]
|
|
369
|
+
}))]
|
|
393
370
|
});
|
|
394
371
|
};
|
|
395
|
-
exports.TypeUrl = TypeUrl;
|
|
396
372
|
TypeUrl.displayName = 'JVR.TypeUrl';
|
|
397
|
-
var TypeDate = function TypeDate(_ref10) {
|
|
373
|
+
var TypeDate = exports.TypeDate = function TypeDate(_ref10) {
|
|
398
374
|
var children = _ref10.children,
|
|
399
|
-
expandKey = _ref10.expandKey,
|
|
400
375
|
keyName = _ref10.keyName;
|
|
401
376
|
var _useTypesStore10 = (0, _Types.useTypesStore)(),
|
|
402
377
|
_useTypesStore10$Date = _useTypesStore10.Date,
|
|
@@ -412,15 +387,17 @@ var TypeDate = function TypeDate(_ref10) {
|
|
|
412
387
|
style: style
|
|
413
388
|
}), {
|
|
414
389
|
type: 'type',
|
|
415
|
-
value: children
|
|
390
|
+
value: children,
|
|
391
|
+
keyName: keyName
|
|
416
392
|
});
|
|
417
|
-
var childStr = children
|
|
393
|
+
var childStr = children instanceof Date ? children.toLocaleString() : children;
|
|
418
394
|
var child = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
419
395
|
children: childStr,
|
|
420
396
|
className: 'w-rjv-value'
|
|
421
397
|
}), {
|
|
422
398
|
type: 'value',
|
|
423
|
-
value: children
|
|
399
|
+
value: children,
|
|
400
|
+
keyName: keyName
|
|
424
401
|
});
|
|
425
402
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
426
403
|
children: [displayDataTypes && (type || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
@@ -428,18 +405,12 @@ var TypeDate = function TypeDate(_ref10) {
|
|
|
428
405
|
}))), child || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
429
406
|
className: "w-rjv-value",
|
|
430
407
|
children: childStr
|
|
431
|
-
}))
|
|
432
|
-
keyName: keyName,
|
|
433
|
-
value: children,
|
|
434
|
-
expandKey: expandKey
|
|
435
|
-
})]
|
|
408
|
+
}))]
|
|
436
409
|
});
|
|
437
410
|
};
|
|
438
|
-
exports.TypeDate = TypeDate;
|
|
439
411
|
TypeDate.displayName = 'JVR.TypeDate';
|
|
440
|
-
var TypeUndefined = function TypeUndefined(_ref11) {
|
|
412
|
+
var TypeUndefined = exports.TypeUndefined = function TypeUndefined(_ref11) {
|
|
441
413
|
var children = _ref11.children,
|
|
442
|
-
expandKey = _ref11.expandKey,
|
|
443
414
|
keyName = _ref11.keyName;
|
|
444
415
|
var _useTypesStore11 = (0, _Types.useTypesStore)(),
|
|
445
416
|
_useTypesStore11$Unde = _useTypesStore11.Undefined,
|
|
@@ -455,30 +426,26 @@ var TypeUndefined = function TypeUndefined(_ref11) {
|
|
|
455
426
|
style: style
|
|
456
427
|
}), {
|
|
457
428
|
type: 'type',
|
|
458
|
-
value: children
|
|
429
|
+
value: children,
|
|
430
|
+
keyName: keyName
|
|
459
431
|
});
|
|
460
432
|
var child = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
461
433
|
children: children,
|
|
462
434
|
className: 'w-rjv-value'
|
|
463
435
|
}), {
|
|
464
436
|
type: 'value',
|
|
465
|
-
value: children
|
|
437
|
+
value: children,
|
|
438
|
+
keyName: keyName
|
|
466
439
|
});
|
|
467
440
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
468
441
|
children: [displayDataTypes && (type || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
469
442
|
style: style
|
|
470
|
-
}))), child
|
|
471
|
-
keyName: keyName,
|
|
472
|
-
value: children,
|
|
473
|
-
expandKey: expandKey
|
|
474
|
-
})]
|
|
443
|
+
}))), child]
|
|
475
444
|
});
|
|
476
445
|
};
|
|
477
|
-
exports.TypeUndefined = TypeUndefined;
|
|
478
446
|
TypeUndefined.displayName = 'JVR.TypeUndefined';
|
|
479
|
-
var TypeNull = function TypeNull(_ref12) {
|
|
447
|
+
var TypeNull = exports.TypeNull = function TypeNull(_ref12) {
|
|
480
448
|
var children = _ref12.children,
|
|
481
|
-
expandKey = _ref12.expandKey,
|
|
482
449
|
keyName = _ref12.keyName;
|
|
483
450
|
var _useTypesStore12 = (0, _Types.useTypesStore)(),
|
|
484
451
|
_useTypesStore12$Null = _useTypesStore12.Null,
|
|
@@ -494,30 +461,26 @@ var TypeNull = function TypeNull(_ref12) {
|
|
|
494
461
|
style: style
|
|
495
462
|
}), {
|
|
496
463
|
type: 'type',
|
|
497
|
-
value: children
|
|
464
|
+
value: children,
|
|
465
|
+
keyName: keyName
|
|
498
466
|
});
|
|
499
467
|
var child = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
500
468
|
children: children,
|
|
501
469
|
className: 'w-rjv-value'
|
|
502
470
|
}), {
|
|
503
471
|
type: 'value',
|
|
504
|
-
value: children
|
|
472
|
+
value: children,
|
|
473
|
+
keyName: keyName
|
|
505
474
|
});
|
|
506
475
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
507
476
|
children: [displayDataTypes && (type || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
508
477
|
style: style
|
|
509
|
-
}))), child
|
|
510
|
-
keyName: keyName,
|
|
511
|
-
value: children,
|
|
512
|
-
expandKey: expandKey
|
|
513
|
-
})]
|
|
478
|
+
}))), child]
|
|
514
479
|
});
|
|
515
480
|
};
|
|
516
|
-
exports.TypeNull = TypeNull;
|
|
517
481
|
TypeNull.displayName = 'JVR.TypeNull';
|
|
518
|
-
var TypeNan = function TypeNan(_ref13) {
|
|
482
|
+
var TypeNan = exports.TypeNan = function TypeNan(_ref13) {
|
|
519
483
|
var children = _ref13.children,
|
|
520
|
-
expandKey = _ref13.expandKey,
|
|
521
484
|
keyName = _ref13.keyName;
|
|
522
485
|
var _useTypesStore13 = (0, _Types.useTypesStore)(),
|
|
523
486
|
_useTypesStore13$Nan = _useTypesStore13.Nan,
|
|
@@ -533,63 +496,21 @@ var TypeNan = function TypeNan(_ref13) {
|
|
|
533
496
|
style: style
|
|
534
497
|
}), {
|
|
535
498
|
type: 'type',
|
|
536
|
-
value: children
|
|
499
|
+
value: children,
|
|
500
|
+
keyName: keyName
|
|
537
501
|
});
|
|
538
502
|
var child = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
539
503
|
children: children === null || children === void 0 ? void 0 : children.toString(),
|
|
540
504
|
className: 'w-rjv-value'
|
|
541
505
|
}), {
|
|
542
506
|
type: 'value',
|
|
543
|
-
value: children
|
|
507
|
+
value: children,
|
|
508
|
+
keyName: keyName
|
|
544
509
|
});
|
|
545
510
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
546
511
|
children: [displayDataTypes && (type || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
547
512
|
style: style
|
|
548
|
-
}))), child
|
|
549
|
-
keyName: keyName,
|
|
550
|
-
value: children,
|
|
551
|
-
expandKey: expandKey
|
|
552
|
-
})]
|
|
553
|
-
});
|
|
554
|
-
};
|
|
555
|
-
exports.TypeNan = TypeNan;
|
|
556
|
-
TypeNan.displayName = 'JVR.TypeNan';
|
|
557
|
-
var TypeEmptyValue = function TypeEmptyValue(_ref14) {
|
|
558
|
-
var children = _ref14.children,
|
|
559
|
-
expandKey = _ref14.expandKey,
|
|
560
|
-
keyName = _ref14.keyName;
|
|
561
|
-
var _useTypesStore14 = (0, _Types.useTypesStore)(),
|
|
562
|
-
_useTypesStore14$Nan = _useTypesStore14.Nan,
|
|
563
|
-
Nan = _useTypesStore14$Nan === void 0 ? {} : _useTypesStore14$Nan,
|
|
564
|
-
displayDataTypes = _useTypesStore14.displayDataTypes;
|
|
565
|
-
var as = Nan.as,
|
|
566
|
-
render = Nan.render,
|
|
567
|
-
reset = (0, _objectWithoutProperties2["default"])(Nan, _excluded14);
|
|
568
|
-
var Comp = as || 'span';
|
|
569
|
-
var style = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, defalutStyle), Nan.style || {});
|
|
570
|
-
var isRender = render && typeof render === 'function';
|
|
571
|
-
var type = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
572
|
-
style: style
|
|
573
|
-
}), {
|
|
574
|
-
type: 'type',
|
|
575
|
-
value: children
|
|
576
|
-
});
|
|
577
|
-
var child = isRender && render((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
578
|
-
children: children,
|
|
579
|
-
className: 'w-rjv-value'
|
|
580
|
-
}), {
|
|
581
|
-
type: 'value',
|
|
582
|
-
value: children
|
|
583
|
-
});
|
|
584
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
585
|
-
children: [displayDataTypes && (type || /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, reset), {}, {
|
|
586
|
-
style: style
|
|
587
|
-
}))), child, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Copied.Copied, {
|
|
588
|
-
keyName: keyName,
|
|
589
|
-
value: children,
|
|
590
|
-
expandKey: expandKey
|
|
591
|
-
})]
|
|
513
|
+
}))), child]
|
|
592
514
|
});
|
|
593
515
|
};
|
|
594
|
-
|
|
595
|
-
TypeEmptyValue.displayName = 'JVR.TypeEmptyValue';
|
|
516
|
+
TypeNan.displayName = 'JVR.TypeNan';
|
|
@@ -45,7 +45,6 @@ function useHighlight(_ref) {
|
|
|
45
45
|
if (value !== prevValue) {
|
|
46
46
|
return true;
|
|
47
47
|
}
|
|
48
|
-
return false;
|
|
49
48
|
}, [highlightUpdates, value]);
|
|
50
49
|
(0, _react.useEffect)(function () {
|
|
51
50
|
if (highlightContainer && highlightContainer.current && isHighlight && 'animate' in highlightContainer.current) {
|
package/cjs/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/editor.d.ts
CHANGED
|
@@ -2,35 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
declare module '@uiw/react-json-view/editor' {
|
|
4
4
|
import { JsonViewProps } from '@uiw/react-json-view';
|
|
5
|
-
import type { CountInfoExtraProps } from '@uiw/react-json-view/cjs/editor/countInfoExtra';
|
|
5
|
+
// import type { CountInfoExtraProps } from '@uiw/react-json-view/cjs/editor/countInfoExtra';
|
|
6
6
|
type Option = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
value: string;
|
|
8
|
+
prevValue: string;
|
|
9
|
+
keyName: string | number;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export interface JsonViewEditorProps<T extends object> extends JsonViewProps<T> {
|
|
13
13
|
/** Callback when value edit functionality */
|
|
14
14
|
onEdit?: (option: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
value: unknown;
|
|
16
|
+
oldValue: unknown;
|
|
17
|
+
keyName?: string | number;
|
|
18
|
+
parentName?: string | number;
|
|
19
|
+
type?: 'value' | 'key';
|
|
20
20
|
}) => void;
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
onAdd?: CountInfoExtraProps<T>['onAdd'];
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
onDelete?: CountInfoExtraProps<T>['onDelete'];
|
|
21
|
+
// /**
|
|
22
|
+
// * When a callback function is passed in, add functionality is enabled. The callback is invoked before additions are completed.
|
|
23
|
+
// * @returns {boolean} Returning false from onAdd will prevent the change from being made.
|
|
24
|
+
// */
|
|
25
|
+
// onAdd?: CountInfoExtraProps<T>['onAdd'];
|
|
26
|
+
// /**
|
|
27
|
+
// * When a callback function is passed in, delete functionality is enabled. The callback is invoked before deletions are completed.
|
|
28
|
+
// * @returns Returning false from onDelete will prevent the change from being made.
|
|
29
|
+
// */
|
|
30
|
+
// onDelete?: CountInfoExtraProps<T>['onDelete'];
|
|
31
31
|
/** Whether enable edit feature. @default true */
|
|
32
32
|
editable?: boolean;
|
|
33
33
|
}
|
|
34
|
-
const JsonViewEditor: import(
|
|
34
|
+
const JsonViewEditor: import('react').ForwardRefExoticComponent<
|
|
35
|
+
Omit<JsonViewEditorProps<object>, 'ref'> & import('react').RefAttributes<HTMLDivElement>
|
|
36
|
+
>;
|
|
35
37
|
export default JsonViewEditor;
|
|
36
38
|
}
|
package/esm/Container.d.ts
CHANGED
|
@@ -6,5 +6,7 @@ export interface ContainerProps<T extends object> extends React.HTMLAttributes<H
|
|
|
6
6
|
level?: number;
|
|
7
7
|
value?: T;
|
|
8
8
|
initialValue?: T;
|
|
9
|
+
/** Index of the parent `keyName` */
|
|
10
|
+
keys?: (string | number)[];
|
|
9
11
|
}
|
|
10
12
|
export declare const Container: React.ForwardRefExoticComponent<ContainerProps<object> & React.RefAttributes<HTMLDivElement>>;
|