@uiw/react-json-view 2.0.0-alpha.1 → 2.0.0-alpha.3
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 +21 -22
- package/cjs/Container.js +3 -6
- package/cjs/comps/KeyValues.js +10 -8
- package/cjs/comps/NestedClose.js +2 -2
- package/cjs/comps/NestedOpen.js +15 -14
- package/cjs/comps/Value.js +12 -12
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +5 -5
- package/cjs/section/CountInfo.d.ts +10 -1
- package/cjs/section/CountInfo.js +42 -2
- package/cjs/section/CountInfoExtra.d.ts +10 -1
- package/cjs/section/CountInfoExtra.js +32 -2
- package/cjs/section/Ellipsis.d.ts +10 -0
- package/cjs/section/Ellipsis.js +30 -2
- package/cjs/section/KeyName.d.ts +7 -0
- package/cjs/section/KeyName.js +36 -2
- package/cjs/store/Symbols.js +1 -0
- package/{esm/comps/ReRender/Symbols.d.ts → cjs/symbol/index.d.ts} +4 -6
- package/cjs/{comps/ReRender/Symbols.js → symbol/index.js} +26 -21
- package/{esm/comps/ReRender/Types.d.ts → cjs/types/index.d.ts} +6 -13
- package/cjs/{comps/ReRender/Types.js → types/index.js} +38 -72
- package/cjs/utils/useHighlight.js +0 -1
- package/esm/Container.js +4 -5
- package/esm/comps/KeyValues.js +7 -5
- package/esm/comps/NestedClose.js +1 -1
- package/esm/comps/NestedOpen.js +10 -9
- package/esm/comps/Value.js +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +2 -2
- 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 +7 -0
- package/esm/section/KeyName.js +37 -1
- package/esm/store/Symbols.js +1 -0
- 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/{cjs/comps/ReRender/Types.d.ts → esm/types/index.d.ts} +6 -13
- package/esm/{comps/ReRender/Types.js → types/index.js} +34 -71
- package/esm/utils/useHighlight.js +0 -1
- package/package.json +1 -1
- 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 -39
- package/cjs/type.d.ts +0 -50
- package/cjs/type.js +0 -57
- 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 -35
- package/esm/type.d.ts +0 -50
- package/esm/type.js +0 -50
package/esm/section/CountInfo.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["value", "keyName"],
|
|
4
|
+
_excluded2 = ["as", "render"];
|
|
1
5
|
import { useSectionStore } from '../store/Section';
|
|
2
6
|
import { useSectionRender } from '../utils/useRender';
|
|
7
|
+
import { useStore } from '../store';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
9
|
export var CountInfo = props => {
|
|
4
10
|
var {
|
|
5
11
|
CountInfo: Comp = {}
|
|
@@ -7,4 +13,40 @@ export var CountInfo = props => {
|
|
|
7
13
|
useSectionRender(Comp, props, 'CountInfo');
|
|
8
14
|
return null;
|
|
9
15
|
};
|
|
10
|
-
CountInfo.displayName = 'JVR.CountInfo';
|
|
16
|
+
CountInfo.displayName = 'JVR.CountInfo';
|
|
17
|
+
export var CountInfoComp = props => {
|
|
18
|
+
var {
|
|
19
|
+
value = {},
|
|
20
|
+
keyName
|
|
21
|
+
} = props,
|
|
22
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
23
|
+
var {
|
|
24
|
+
displayObjectSize
|
|
25
|
+
} = useStore();
|
|
26
|
+
var {
|
|
27
|
+
CountInfo: Comp = {}
|
|
28
|
+
} = useSectionStore();
|
|
29
|
+
if (!displayObjectSize) return null;
|
|
30
|
+
var {
|
|
31
|
+
as,
|
|
32
|
+
render
|
|
33
|
+
} = Comp,
|
|
34
|
+
reset = _objectWithoutPropertiesLoose(Comp, _excluded2);
|
|
35
|
+
var Elm = as || 'span';
|
|
36
|
+
reset.style = _extends({}, reset.style, props.style);
|
|
37
|
+
var len = Object.keys(value).length;
|
|
38
|
+
if (!reset.children) {
|
|
39
|
+
reset.children = len + " items";
|
|
40
|
+
}
|
|
41
|
+
var elmProps = _extends({}, reset, other);
|
|
42
|
+
var isRender = render && typeof render === 'function';
|
|
43
|
+
var child = isRender && render(_extends({}, elmProps, {
|
|
44
|
+
'data-length': len
|
|
45
|
+
}), {
|
|
46
|
+
value,
|
|
47
|
+
keyName
|
|
48
|
+
});
|
|
49
|
+
if (child) return child;
|
|
50
|
+
return /*#__PURE__*/_jsx(Elm, _extends({}, elmProps));
|
|
51
|
+
};
|
|
52
|
+
CountInfoComp.displayName = 'JVR.CountInfoComp';
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { type TagType } from '../store/Types';
|
|
2
|
-
import { type SectionElement } from '../store/Section';
|
|
3
|
+
import { type SectionElement, type SectionElementProps } from '../store/Section';
|
|
3
4
|
export declare const CountInfoExtra: {
|
|
4
5
|
<K extends TagType>(props: SectionElement<K>): null;
|
|
5
6
|
displayName: string;
|
|
6
7
|
};
|
|
8
|
+
export interface CountInfoExtraCompsProps<T extends object> {
|
|
9
|
+
value?: T;
|
|
10
|
+
keyName: string | number;
|
|
11
|
+
}
|
|
12
|
+
export declare const CountInfoExtraComps: {
|
|
13
|
+
<T extends object>(props: SectionElementProps<TagType> & CountInfoExtraCompsProps<T>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["value", "keyName"],
|
|
4
|
+
_excluded2 = ["as", "render"];
|
|
1
5
|
import { useSectionStore } from '../store/Section';
|
|
2
6
|
import { useSectionRender } from '../utils/useRender';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
8
|
export var CountInfoExtra = props => {
|
|
4
9
|
var {
|
|
5
10
|
CountInfoExtra: Comp = {}
|
|
@@ -7,4 +12,30 @@ export var CountInfoExtra = props => {
|
|
|
7
12
|
useSectionRender(Comp, props, 'CountInfoExtra');
|
|
8
13
|
return null;
|
|
9
14
|
};
|
|
10
|
-
CountInfoExtra.displayName = 'JVR.CountInfoExtra';
|
|
15
|
+
CountInfoExtra.displayName = 'JVR.CountInfoExtra';
|
|
16
|
+
export var CountInfoExtraComps = props => {
|
|
17
|
+
var {
|
|
18
|
+
value = {},
|
|
19
|
+
keyName
|
|
20
|
+
} = props,
|
|
21
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
22
|
+
var {
|
|
23
|
+
CountInfoExtra: Comp = {}
|
|
24
|
+
} = useSectionStore();
|
|
25
|
+
var {
|
|
26
|
+
as,
|
|
27
|
+
render
|
|
28
|
+
} = Comp,
|
|
29
|
+
reset = _objectWithoutPropertiesLoose(Comp, _excluded2);
|
|
30
|
+
if (!render && !reset.children) return null;
|
|
31
|
+
var Elm = as || 'span';
|
|
32
|
+
var isRender = render && typeof render === 'function';
|
|
33
|
+
var elmProps = _extends({}, reset, other);
|
|
34
|
+
var child = isRender && render(elmProps, {
|
|
35
|
+
value,
|
|
36
|
+
keyName
|
|
37
|
+
});
|
|
38
|
+
if (child) return child;
|
|
39
|
+
return /*#__PURE__*/_jsx(Elm, _extends({}, elmProps));
|
|
40
|
+
};
|
|
41
|
+
CountInfoExtraComps.displayName = 'JVR.CountInfoExtraComps';
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { type TagType } from '../store/Types';
|
|
2
3
|
import { type SectionElement } from '../store/Section';
|
|
3
4
|
export declare const Ellipsis: {
|
|
4
5
|
<K extends TagType>(props: SectionElement<K>): null;
|
|
5
6
|
displayName: string;
|
|
6
7
|
};
|
|
8
|
+
export interface EllipsisCompProps<T extends object> {
|
|
9
|
+
value?: T;
|
|
10
|
+
keyName: string | number;
|
|
11
|
+
isExpanded: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const EllipsisComp: {
|
|
14
|
+
<T extends object>({ isExpanded, value, keyName }: EllipsisCompProps<T>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
package/esm/section/Ellipsis.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["as", "render"];
|
|
1
4
|
import { useSectionStore } from '../store/Section';
|
|
2
5
|
import { useSectionRender } from '../utils/useRender';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
7
|
export var Ellipsis = props => {
|
|
4
8
|
var {
|
|
5
9
|
Ellipsis: Comp = {}
|
|
@@ -7,4 +11,30 @@ export var Ellipsis = props => {
|
|
|
7
11
|
useSectionRender(Comp, props, 'Ellipsis');
|
|
8
12
|
return null;
|
|
9
13
|
};
|
|
10
|
-
Ellipsis.displayName = 'JVR.Ellipsis';
|
|
14
|
+
Ellipsis.displayName = 'JVR.Ellipsis';
|
|
15
|
+
export var EllipsisComp = _ref => {
|
|
16
|
+
var {
|
|
17
|
+
isExpanded,
|
|
18
|
+
value,
|
|
19
|
+
keyName
|
|
20
|
+
} = _ref;
|
|
21
|
+
var {
|
|
22
|
+
Ellipsis: Comp = {}
|
|
23
|
+
} = useSectionStore();
|
|
24
|
+
var {
|
|
25
|
+
as,
|
|
26
|
+
render
|
|
27
|
+
} = Comp,
|
|
28
|
+
reset = _objectWithoutPropertiesLoose(Comp, _excluded);
|
|
29
|
+
var Elm = as || 'span';
|
|
30
|
+
var child = render && typeof render === 'function' && render(_extends({}, reset, {
|
|
31
|
+
'data-expanded': isExpanded
|
|
32
|
+
}), {
|
|
33
|
+
value,
|
|
34
|
+
keyName
|
|
35
|
+
});
|
|
36
|
+
if (child) return child;
|
|
37
|
+
if (!isExpanded) return null;
|
|
38
|
+
return /*#__PURE__*/_jsx(Elm, _extends({}, reset));
|
|
39
|
+
};
|
|
40
|
+
EllipsisComp.displayName = 'JVR.EllipsisComp';
|
package/esm/section/KeyName.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { type FC, type PropsWithChildren } from 'react';
|
|
1
2
|
import { type TagType } from '../store/Types';
|
|
2
3
|
import { type SectionElement } from '../store/Section';
|
|
3
4
|
export declare const KeyName: {
|
|
4
5
|
<K extends TagType>(props: SectionElement<K>): null;
|
|
5
6
|
displayName: string;
|
|
6
7
|
};
|
|
8
|
+
type KeyNameCompProps = {
|
|
9
|
+
keyName: string | number;
|
|
10
|
+
value?: unknown;
|
|
11
|
+
};
|
|
12
|
+
export declare const KeyNameComp: FC<PropsWithChildren<KeyNameCompProps>>;
|
|
13
|
+
export {};
|
package/esm/section/KeyName.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
+
var _excluded = ["as", "render"];
|
|
1
4
|
import { useSectionStore } from '../store/Section';
|
|
2
5
|
import { useSectionRender } from '../utils/useRender';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
7
|
export var KeyName = props => {
|
|
4
8
|
var {
|
|
5
9
|
KeyName: Comp = {}
|
|
@@ -7,4 +11,36 @@ export var KeyName = props => {
|
|
|
7
11
|
useSectionRender(Comp, props, 'KeyName');
|
|
8
12
|
return null;
|
|
9
13
|
};
|
|
10
|
-
KeyName.displayName = 'JVR.KeyName';
|
|
14
|
+
KeyName.displayName = 'JVR.KeyName';
|
|
15
|
+
export var KeyNameComp = props => {
|
|
16
|
+
var {
|
|
17
|
+
children,
|
|
18
|
+
value,
|
|
19
|
+
keyName
|
|
20
|
+
} = props;
|
|
21
|
+
var isNumber = typeof children === 'number';
|
|
22
|
+
var style = {
|
|
23
|
+
color: isNumber ? 'var(--w-rjv-key-number, #268bd2)' : 'var(--w-rjv-key-string, #002b36)'
|
|
24
|
+
};
|
|
25
|
+
var {
|
|
26
|
+
KeyName: Comp = {}
|
|
27
|
+
} = useSectionStore();
|
|
28
|
+
var {
|
|
29
|
+
as,
|
|
30
|
+
render
|
|
31
|
+
} = Comp,
|
|
32
|
+
reset = _objectWithoutPropertiesLoose(Comp, _excluded);
|
|
33
|
+
reset.style = _extends({}, reset.style, style);
|
|
34
|
+
var Elm = as || 'span';
|
|
35
|
+
var child = render && typeof render === 'function' && render(_extends({}, reset, {
|
|
36
|
+
children
|
|
37
|
+
}), {
|
|
38
|
+
value,
|
|
39
|
+
keyName
|
|
40
|
+
});
|
|
41
|
+
if (child) return child;
|
|
42
|
+
return /*#__PURE__*/_jsx(Elm, _extends({}, reset, {
|
|
43
|
+
children: children
|
|
44
|
+
}));
|
|
45
|
+
};
|
|
46
|
+
KeyNameComp.displayName = 'JVR.KeyNameComp';
|
package/esm/store/Symbols.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type SymbolsElement } from '
|
|
3
|
-
import { type TagType } from '
|
|
2
|
+
import { type SymbolsElement } from '../store/Symbols';
|
|
3
|
+
import { type TagType } from '../store/Types';
|
|
4
4
|
export declare const Quote: {
|
|
5
5
|
(props: {
|
|
6
6
|
isNumber?: boolean | undefined;
|
|
7
|
-
}): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
} & import("react").HTMLAttributes<HTMLElement>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
8
8
|
displayName: string;
|
|
9
9
|
};
|
|
10
10
|
export declare const ValueQuote: {
|
|
11
|
-
(props:
|
|
12
|
-
isNumber?: boolean | undefined;
|
|
13
|
-
}): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
(props: React.HTMLAttributes<HTMLElement>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
|
|
14
12
|
displayName: string;
|
|
15
13
|
};
|
|
16
14
|
export declare const Colon: {
|
|
@@ -1,52 +1,54 @@
|
|
|
1
|
+
import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["
|
|
4
|
+
var _excluded = ["isNumber"],
|
|
4
5
|
_excluded2 = ["as", "render"],
|
|
5
6
|
_excluded3 = ["as", "render"],
|
|
6
|
-
_excluded4 = ["as", "
|
|
7
|
-
_excluded5 = ["as", "render"],
|
|
7
|
+
_excluded4 = ["as", "render"],
|
|
8
|
+
_excluded5 = ["as", "style", "render"],
|
|
8
9
|
_excluded6 = ["as", "render"],
|
|
9
10
|
_excluded7 = ["as", "render"],
|
|
10
|
-
_excluded8 = ["as", "render"]
|
|
11
|
-
|
|
12
|
-
import {
|
|
11
|
+
_excluded8 = ["as", "render"],
|
|
12
|
+
_excluded9 = ["as", "render"];
|
|
13
|
+
import { useSymbolsStore } from '../store/Symbols';
|
|
14
|
+
import { useExpandsStore } from '../store/Expands';
|
|
13
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
16
|
export var Quote = props => {
|
|
15
17
|
var {
|
|
16
18
|
Quote: Comp = {}
|
|
17
19
|
} = useSymbolsStore();
|
|
18
20
|
var {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
isNumber
|
|
22
|
+
} = props,
|
|
23
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
21
24
|
if (isNumber) return null;
|
|
22
25
|
var {
|
|
23
26
|
as,
|
|
24
27
|
render
|
|
25
28
|
} = Comp,
|
|
26
|
-
reset = _objectWithoutPropertiesLoose(Comp,
|
|
29
|
+
reset = _objectWithoutPropertiesLoose(Comp, _excluded2);
|
|
27
30
|
var Elm = as || 'span';
|
|
28
|
-
var
|
|
31
|
+
var elmProps = _extends({}, other, reset);
|
|
32
|
+
var child = render && typeof render === 'function' && render(elmProps);
|
|
29
33
|
if (child) return child;
|
|
30
|
-
return /*#__PURE__*/_jsx(Elm, _extends({},
|
|
34
|
+
return /*#__PURE__*/_jsx(Elm, _extends({}, elmProps));
|
|
31
35
|
};
|
|
32
36
|
Quote.displayName = 'JVR.Quote';
|
|
33
37
|
export var ValueQuote = props => {
|
|
34
38
|
var {
|
|
35
39
|
ValueQuote: Comp = {}
|
|
36
40
|
} = useSymbolsStore();
|
|
37
|
-
var {
|
|
38
|
-
isNumber
|
|
39
|
-
} = props;
|
|
40
|
-
if (isNumber) return null;
|
|
41
|
+
var other = _extends({}, (_objectDestructuringEmpty(props), props));
|
|
41
42
|
var {
|
|
42
43
|
as,
|
|
43
44
|
render
|
|
44
45
|
} = Comp,
|
|
45
|
-
reset = _objectWithoutPropertiesLoose(Comp,
|
|
46
|
+
reset = _objectWithoutPropertiesLoose(Comp, _excluded3);
|
|
46
47
|
var Elm = as || 'span';
|
|
47
|
-
var
|
|
48
|
+
var elmProps = _extends({}, other, reset);
|
|
49
|
+
var child = render && typeof render === 'function' && render(elmProps);
|
|
48
50
|
if (child) return child;
|
|
49
|
-
return /*#__PURE__*/_jsx(Elm, _extends({},
|
|
51
|
+
return /*#__PURE__*/_jsx(Elm, _extends({}, elmProps));
|
|
50
52
|
};
|
|
51
53
|
ValueQuote.displayName = 'JVR.ValueQuote';
|
|
52
54
|
export var Colon = () => {
|
|
@@ -57,7 +59,7 @@ export var Colon = () => {
|
|
|
57
59
|
as,
|
|
58
60
|
render
|
|
59
61
|
} = Comp,
|
|
60
|
-
reset = _objectWithoutPropertiesLoose(Comp,
|
|
62
|
+
reset = _objectWithoutPropertiesLoose(Comp, _excluded4);
|
|
61
63
|
var Elm = as || 'span';
|
|
62
64
|
var child = render && typeof render === 'function' && render(reset);
|
|
63
65
|
if (child) return child;
|
|
@@ -78,7 +80,7 @@ export var Arrow = props => {
|
|
|
78
80
|
style,
|
|
79
81
|
render
|
|
80
82
|
} = Comp,
|
|
81
|
-
reset = _objectWithoutPropertiesLoose(Comp,
|
|
83
|
+
reset = _objectWithoutPropertiesLoose(Comp, _excluded5);
|
|
82
84
|
var Elm = as || 'span';
|
|
83
85
|
var isRender = render && typeof render === 'function';
|
|
84
86
|
var child = isRender && render(_extends({}, reset, {
|
|
@@ -104,7 +106,7 @@ export var BracketsOpen = _ref => {
|
|
|
104
106
|
as,
|
|
105
107
|
render: _render
|
|
106
108
|
} = BracketsLeft,
|
|
107
|
-
reset = _objectWithoutPropertiesLoose(BracketsLeft,
|
|
109
|
+
reset = _objectWithoutPropertiesLoose(BracketsLeft, _excluded6);
|
|
108
110
|
var BracketsLeftComp = as || 'span';
|
|
109
111
|
var _child = _render && typeof _render === 'function' && _render(reset);
|
|
110
112
|
if (_child) return _child;
|
|
@@ -114,7 +116,7 @@ export var BracketsOpen = _ref => {
|
|
|
114
116
|
as: elm,
|
|
115
117
|
render
|
|
116
118
|
} = BraceLeft,
|
|
117
|
-
props = _objectWithoutPropertiesLoose(BraceLeft,
|
|
119
|
+
props = _objectWithoutPropertiesLoose(BraceLeft, _excluded7);
|
|
118
120
|
var BraceLeftComp = elm || 'span';
|
|
119
121
|
var child = render && typeof render === 'function' && render(props);
|
|
120
122
|
if (child) return child;
|
|
@@ -136,7 +138,7 @@ export var BracketsClose = _ref2 => {
|
|
|
136
138
|
as,
|
|
137
139
|
render: _render2
|
|
138
140
|
} = BracketsRight,
|
|
139
|
-
_reset = _objectWithoutPropertiesLoose(BracketsRight,
|
|
141
|
+
_reset = _objectWithoutPropertiesLoose(BracketsRight, _excluded8);
|
|
140
142
|
var BracketsRightComp = as || 'span';
|
|
141
143
|
var _child2 = _render2 && typeof _render2 === 'function' && _render2(_reset);
|
|
142
144
|
if (_child2) return _child2;
|
|
@@ -146,7 +148,7 @@ export var BracketsClose = _ref2 => {
|
|
|
146
148
|
as: elm,
|
|
147
149
|
render
|
|
148
150
|
} = BraceRight,
|
|
149
|
-
reset = _objectWithoutPropertiesLoose(BraceRight,
|
|
151
|
+
reset = _objectWithoutPropertiesLoose(BraceRight, _excluded9);
|
|
150
152
|
var BraceRightComp = elm || 'span';
|
|
151
153
|
var child = render && typeof render === 'function' && render(reset);
|
|
152
154
|
if (child) return child;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
export declare const SetComp: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
export declare const MapComp: {
|
|
9
|
-
({ isMap }: {
|
|
10
|
-
isMap: boolean;
|
|
11
|
-
}): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
-
displayName: string;
|
|
13
|
-
};
|
|
2
|
+
export declare const SetComp: FC<PropsWithChildren<{
|
|
3
|
+
value: unknown;
|
|
4
|
+
}>>;
|
|
5
|
+
export declare const MapComp: FC<PropsWithChildren<{
|
|
6
|
+
value: unknown;
|
|
7
|
+
}>>;
|
|
14
8
|
type TypeProps = PropsWithChildren<{
|
|
15
9
|
expandKey: string;
|
|
16
10
|
keyName: string | number;
|
|
@@ -32,5 +26,4 @@ export declare const TypeDate: FC<{
|
|
|
32
26
|
export declare const TypeUndefined: FC<TypeProps>;
|
|
33
27
|
export declare const TypeNull: FC<TypeProps>;
|
|
34
28
|
export declare const TypeNan: FC<TypeProps>;
|
|
35
|
-
export declare const TypeEmptyValue: FC<TypeProps>;
|
|
36
29
|
export {};
|
|
@@ -12,59 +12,62 @@ var _excluded = ["as", "render"],
|
|
|
12
12
|
_excluded10 = ["as", "render"],
|
|
13
13
|
_excluded11 = ["as", "render"],
|
|
14
14
|
_excluded12 = ["as", "render"],
|
|
15
|
-
_excluded13 = ["as", "render"]
|
|
16
|
-
_excluded14 = ["as", "render"];
|
|
15
|
+
_excluded13 = ["as", "render"];
|
|
17
16
|
import { Fragment, useState } from 'react';
|
|
18
|
-
import { useTypesStore } from '
|
|
19
|
-
import { useStore } from '
|
|
20
|
-
import { ValueQuote } from '
|
|
21
|
-
import { Copied } from '../Copied';
|
|
17
|
+
import { useTypesStore } from '../store/Types';
|
|
18
|
+
import { useStore } from '../store';
|
|
19
|
+
import { ValueQuote } from '../symbol';
|
|
20
|
+
import { Copied } from '../comps/Copied';
|
|
22
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
22
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
23
|
export var SetComp = _ref => {
|
|
25
24
|
var {
|
|
26
|
-
|
|
25
|
+
value
|
|
27
26
|
} = _ref;
|
|
28
27
|
var {
|
|
29
|
-
Set = {},
|
|
28
|
+
Set: Comp = {},
|
|
30
29
|
displayDataTypes
|
|
31
30
|
} = useTypesStore();
|
|
31
|
+
var isSet = value instanceof Set;
|
|
32
32
|
if (!isSet || !displayDataTypes) return null;
|
|
33
33
|
var {
|
|
34
34
|
as,
|
|
35
35
|
render
|
|
36
|
-
} =
|
|
37
|
-
reset = _objectWithoutPropertiesLoose(
|
|
36
|
+
} = Comp,
|
|
37
|
+
reset = _objectWithoutPropertiesLoose(Comp, _excluded);
|
|
38
38
|
var isRender = render && typeof render === 'function';
|
|
39
39
|
var type = isRender && render(reset, {
|
|
40
|
-
type: 'type'
|
|
40
|
+
type: 'type',
|
|
41
|
+
value
|
|
41
42
|
});
|
|
42
43
|
if (type) return type;
|
|
43
|
-
var
|
|
44
|
-
return /*#__PURE__*/_jsx(
|
|
44
|
+
var Elm = as || 'span';
|
|
45
|
+
return /*#__PURE__*/_jsx(Elm, _extends({}, reset));
|
|
45
46
|
};
|
|
46
47
|
SetComp.displayName = 'JVR.SetComp';
|
|
47
48
|
export var MapComp = _ref2 => {
|
|
48
49
|
var {
|
|
49
|
-
|
|
50
|
+
value
|
|
50
51
|
} = _ref2;
|
|
51
52
|
var {
|
|
52
|
-
Map = {},
|
|
53
|
+
Map: Comp = {},
|
|
53
54
|
displayDataTypes
|
|
54
55
|
} = useTypesStore();
|
|
56
|
+
var isMap = value instanceof Map;
|
|
55
57
|
if (!isMap || !displayDataTypes) return null;
|
|
56
58
|
var {
|
|
57
59
|
as,
|
|
58
60
|
render
|
|
59
|
-
} =
|
|
60
|
-
reset = _objectWithoutPropertiesLoose(
|
|
61
|
+
} = Comp,
|
|
62
|
+
reset = _objectWithoutPropertiesLoose(Comp, _excluded2);
|
|
61
63
|
var isRender = render && typeof render === 'function';
|
|
62
64
|
var type = isRender && render(reset, {
|
|
63
|
-
type: 'type'
|
|
65
|
+
type: 'type',
|
|
66
|
+
value
|
|
64
67
|
});
|
|
65
68
|
if (type) return type;
|
|
66
|
-
var
|
|
67
|
-
return /*#__PURE__*/_jsx(
|
|
69
|
+
var Elm = as || 'span';
|
|
70
|
+
return /*#__PURE__*/_jsx(Elm, _extends({}, reset));
|
|
68
71
|
};
|
|
69
72
|
MapComp.displayName = 'JVR.MapComp';
|
|
70
73
|
var defalutStyle = {
|
|
@@ -99,7 +102,6 @@ export var TypeString = _ref3 => {
|
|
|
99
102
|
});
|
|
100
103
|
if (childrenStr.length > length) {
|
|
101
104
|
reset.onClick = () => {
|
|
102
|
-
if (length && childrenStr.length <= length) return setShorten(false);
|
|
103
105
|
setShorten(!shorten);
|
|
104
106
|
};
|
|
105
107
|
}
|
|
@@ -122,10 +124,12 @@ export var TypeString = _ref3 => {
|
|
|
122
124
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
123
125
|
children: [displayDataTypes && (type || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
124
126
|
style: style
|
|
125
|
-
}))), child || /*#__PURE__*/_jsxs(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
}))), child || /*#__PURE__*/_jsxs(Fragment, {
|
|
128
|
+
children: [/*#__PURE__*/_jsx(ValueQuote, {}), /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
129
|
+
className: "w-rjv-value",
|
|
130
|
+
children: text
|
|
131
|
+
})), /*#__PURE__*/_jsx(ValueQuote, {})]
|
|
132
|
+
}), /*#__PURE__*/_jsx(Copied, {
|
|
129
133
|
keyName: keyName,
|
|
130
134
|
value: children,
|
|
131
135
|
expandKey: expandKey
|
|
@@ -383,7 +387,7 @@ export var TypeUrl = _ref9 => {
|
|
|
383
387
|
value: children
|
|
384
388
|
});
|
|
385
389
|
var child = isRender && render(_extends({}, reset, {
|
|
386
|
-
children,
|
|
390
|
+
children: children == null ? void 0 : children.href,
|
|
387
391
|
className: 'w-rjv-value'
|
|
388
392
|
}), {
|
|
389
393
|
type: 'value',
|
|
@@ -430,8 +434,9 @@ export var TypeDate = _ref10 => {
|
|
|
430
434
|
type: 'type',
|
|
431
435
|
value: children
|
|
432
436
|
});
|
|
437
|
+
var childStr = children == null ? void 0 : children.toString();
|
|
433
438
|
var child = isRender && render(_extends({}, reset, {
|
|
434
|
-
children,
|
|
439
|
+
children: childStr,
|
|
435
440
|
className: 'w-rjv-value'
|
|
436
441
|
}), {
|
|
437
442
|
type: 'value',
|
|
@@ -442,7 +447,7 @@ export var TypeDate = _ref10 => {
|
|
|
442
447
|
style: style
|
|
443
448
|
}))), child || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
444
449
|
className: "w-rjv-value",
|
|
445
|
-
children:
|
|
450
|
+
children: childStr
|
|
446
451
|
})), /*#__PURE__*/_jsx(Copied, {
|
|
447
452
|
keyName: keyName,
|
|
448
453
|
value: children,
|
|
@@ -560,49 +565,7 @@ export var TypeNan = _ref13 => {
|
|
|
560
565
|
value: children
|
|
561
566
|
});
|
|
562
567
|
var child = isRender && render(_extends({}, reset, {
|
|
563
|
-
children,
|
|
564
|
-
className: 'w-rjv-value'
|
|
565
|
-
}), {
|
|
566
|
-
type: 'value',
|
|
567
|
-
value: children
|
|
568
|
-
});
|
|
569
|
-
return /*#__PURE__*/_jsxs(Fragment, {
|
|
570
|
-
children: [displayDataTypes && (type || /*#__PURE__*/_jsx(Comp, _extends({}, reset, {
|
|
571
|
-
style: style
|
|
572
|
-
}))), child, /*#__PURE__*/_jsx(Copied, {
|
|
573
|
-
keyName: keyName,
|
|
574
|
-
value: children,
|
|
575
|
-
expandKey: expandKey
|
|
576
|
-
})]
|
|
577
|
-
});
|
|
578
|
-
};
|
|
579
|
-
TypeNan.displayName = 'JVR.TypeNan';
|
|
580
|
-
export var TypeEmptyValue = _ref14 => {
|
|
581
|
-
var {
|
|
582
|
-
children,
|
|
583
|
-
expandKey,
|
|
584
|
-
keyName
|
|
585
|
-
} = _ref14;
|
|
586
|
-
var {
|
|
587
|
-
Nan = {},
|
|
588
|
-
displayDataTypes
|
|
589
|
-
} = useTypesStore();
|
|
590
|
-
var {
|
|
591
|
-
as,
|
|
592
|
-
render
|
|
593
|
-
} = Nan,
|
|
594
|
-
reset = _objectWithoutPropertiesLoose(Nan, _excluded14);
|
|
595
|
-
var Comp = as || 'span';
|
|
596
|
-
var style = _extends({}, defalutStyle, Nan.style || {});
|
|
597
|
-
var isRender = render && typeof render === 'function';
|
|
598
|
-
var type = isRender && render(_extends({}, reset, {
|
|
599
|
-
style
|
|
600
|
-
}), {
|
|
601
|
-
type: 'type',
|
|
602
|
-
value: children
|
|
603
|
-
});
|
|
604
|
-
var child = isRender && render(_extends({}, reset, {
|
|
605
|
-
children,
|
|
568
|
+
children: children == null ? void 0 : children.toString(),
|
|
606
569
|
className: 'w-rjv-value'
|
|
607
570
|
}), {
|
|
608
571
|
type: 'value',
|
|
@@ -38,7 +38,6 @@ export function useHighlight(_ref) {
|
|
|
38
38
|
if (value !== prevValue) {
|
|
39
39
|
return true;
|
|
40
40
|
}
|
|
41
|
-
return false;
|
|
42
41
|
}, [highlightUpdates, value]);
|
|
43
42
|
useEffect(() => {
|
|
44
43
|
if (highlightContainer && highlightContainer.current && isHighlight && 'animate' in highlightContainer.current) {
|
package/package.json
CHANGED
package/cjs/comps/CountInfo.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { type SectionElementProps } from '../store/Section';
|
|
3
|
-
import { type TagType } from '../store/Types';
|
|
4
|
-
export interface CountInfoProps<T extends object> {
|
|
5
|
-
value?: T;
|
|
6
|
-
keyName: string | number;
|
|
7
|
-
}
|
|
8
|
-
export declare const CountInfo: {
|
|
9
|
-
<T extends object>(props: SectionElementProps<TagType> & CountInfoProps<T> & import("react").HTMLAttributes<HTMLElement>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
-
displayName: string;
|
|
11
|
-
};
|
|
12
|
-
export interface CountInfoExtraProps<T extends object> {
|
|
13
|
-
value?: T;
|
|
14
|
-
keyName: string | number;
|
|
15
|
-
}
|
|
16
|
-
export declare const CountInfoExtra: {
|
|
17
|
-
<T extends object>(props: SectionElementProps<TagType> & CountInfoExtraProps<T>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
displayName: string;
|
|
19
|
-
};
|