@uiw/react-json-view 2.0.0-alpha.4 → 2.0.0-alpha.6
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 +4 -0
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/section/Copied.d.ts +1 -1
- package/cjs/section/CountInfo.d.ts +1 -1
- package/cjs/section/CountInfoExtra.d.ts +1 -1
- package/cjs/store/Section.d.ts +2 -2
- package/cjs/store/Symbols.d.ts +2 -2
- package/cjs/symbol/Arrow.d.ts +1 -1
- package/cjs/symbol/BraceLeft.d.ts +1 -1
- package/cjs/symbol/BraceRight.d.ts +1 -1
- package/cjs/symbol/BracketsLeft.d.ts +1 -1
- package/cjs/symbol/BracketsRight.d.ts +1 -1
- package/cjs/symbol/Colon.d.ts +1 -1
- package/cjs/symbol/Quote.d.ts +1 -1
- package/cjs/symbol/ValueQuote.d.ts +1 -1
- package/cjs/types/Bigint.d.ts +1 -1
- package/cjs/types/Date.d.ts +1 -1
- package/cjs/types/False.d.ts +1 -1
- package/cjs/types/Float.d.ts +1 -1
- package/cjs/types/Int.d.ts +1 -1
- package/cjs/types/Map.d.ts +1 -1
- package/cjs/types/Nan.d.ts +1 -1
- package/cjs/types/Null.d.ts +1 -1
- package/cjs/types/Set.d.ts +1 -1
- package/cjs/types/String.d.ts +1 -1
- package/cjs/types/True.d.ts +1 -1
- package/cjs/types/Undefined.d.ts +1 -1
- package/cjs/types/Url.d.ts +1 -1
- package/cjs/types/index.js +4 -1
- package/cjs/utils/useRender.d.ts +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/section/Copied.d.ts +1 -1
- package/esm/section/CountInfo.d.ts +1 -1
- package/esm/section/CountInfoExtra.d.ts +1 -1
- package/esm/store/Section.d.ts +2 -2
- package/esm/store/Symbols.d.ts +2 -2
- 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/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/esm/types/index.js +3 -2
- package/esm/utils/useRender.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -696,8 +696,12 @@ export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps
|
|
|
696
696
|
displayDataTypes?: boolean;
|
|
697
697
|
/** The user can copy objects and arrays to clipboard by clicking on the clipboard icon. @default true */
|
|
698
698
|
enableClipboard?: boolean;
|
|
699
|
+
/** When set to true, all nodes will be collapsed by default. Use an integer value to collapse at a particular depth. @default false */
|
|
700
|
+
collapsed?: boolean | number;
|
|
699
701
|
/** Whether to highlight updates. @default true */
|
|
700
702
|
highlightUpdates?: boolean;
|
|
703
|
+
/** Shorten long JSON strings, Set to `0` to disable this feature @default 30 */
|
|
704
|
+
shortenTextAfterLength?: number;
|
|
701
705
|
/** Callback function for when a treeNode is expanded or collapsed */
|
|
702
706
|
onExpand?: (props: {
|
|
703
707
|
expand: boolean;
|
package/cjs/index.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps
|
|
|
50
50
|
collapsed?: boolean | number;
|
|
51
51
|
/** Whether to highlight updates. @default true */
|
|
52
52
|
highlightUpdates?: boolean;
|
|
53
|
-
/** Shorten long JSON strings, Set to `0` to disable this feature @default
|
|
53
|
+
/** Shorten long JSON strings, Set to `0` to disable this feature @default 30 */
|
|
54
54
|
shortenTextAfterLength?: number;
|
|
55
55
|
/** Callback function for when a treeNode is expanded or collapsed */
|
|
56
56
|
onExpand?: (props: {
|
package/cjs/index.js
CHANGED
|
@@ -122,7 +122,7 @@ var JsonView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
122
122
|
_props$displayObjectS = props.displayObjectSize,
|
|
123
123
|
displayObjectSize = _props$displayObjectS === void 0 ? true : _props$displayObjectS,
|
|
124
124
|
_props$shortenTextAft = props.shortenTextAfterLength,
|
|
125
|
-
shortenTextAfterLength = _props$shortenTextAft === void 0 ?
|
|
125
|
+
shortenTextAfterLength = _props$shortenTextAft === void 0 ? 30 : _props$shortenTextAft,
|
|
126
126
|
_props$highlightUpdat = props.highlightUpdates,
|
|
127
127
|
highlightUpdates = _props$highlightUpdat === void 0 ? true : _props$highlightUpdat,
|
|
128
128
|
_props$enableClipboar = props.enableClipboard,
|
package/cjs/section/Copied.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TagType } from '../store/Types';
|
|
2
2
|
import { type SectionElement } from '../store/Section';
|
|
3
3
|
export declare const Copied: {
|
|
4
|
-
(props: SectionElement<
|
|
4
|
+
<K extends TagType = "svg">(props: SectionElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -10,6 +10,6 @@ export interface CountInfoCompProps<T extends object> {
|
|
|
10
10
|
keyName: string | number;
|
|
11
11
|
}
|
|
12
12
|
export declare const CountInfoComp: {
|
|
13
|
-
<T extends object>(props: SectionElementProps<
|
|
13
|
+
<K extends TagType, T extends object>(props: SectionElementProps<K> & CountInfoCompProps<T> & import("react").HTMLAttributes<HTMLElement>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
14
14
|
displayName: string;
|
|
15
15
|
};
|
|
@@ -10,6 +10,6 @@ export interface CountInfoExtraCompsProps<T extends object> {
|
|
|
10
10
|
keyName: string | number;
|
|
11
11
|
}
|
|
12
12
|
export declare const CountInfoExtraComps: {
|
|
13
|
-
<T extends object>(props: SectionElementProps<
|
|
13
|
+
<T extends object, K extends TagType>(props: SectionElementProps<K> & CountInfoExtraCompsProps<T>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
14
14
|
displayName: string;
|
|
15
15
|
};
|
package/cjs/store/Section.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { FC, PropsWithChildren, ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import { type TagType } from './Types';
|
|
3
|
-
export type SectionElementProps<T extends TagType> = {
|
|
3
|
+
export type SectionElementProps<T extends TagType = 'span'> = {
|
|
4
4
|
as?: T;
|
|
5
5
|
render?: (props: SectionElement<T>, result: {
|
|
6
6
|
value: unknown;
|
|
7
7
|
keyName: string | number;
|
|
8
8
|
}) => React.ReactNode;
|
|
9
9
|
};
|
|
10
|
-
export type SectionElement<T extends TagType> = SectionElementProps<T> & ComponentPropsWithoutRef<T>;
|
|
10
|
+
export type SectionElement<T extends TagType = 'span'> = SectionElementProps<T> & ComponentPropsWithoutRef<T>;
|
|
11
11
|
type InitialState<T extends TagType> = {
|
|
12
12
|
Copied?: SectionElement<T>;
|
|
13
13
|
CountInfo?: SectionElement<T>;
|
package/cjs/store/Symbols.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FC, PropsWithChildren, ElementType, ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import { type TagType } from './Types';
|
|
3
|
-
type SymbolsElementProps<T extends TagType> = {
|
|
3
|
+
type SymbolsElementProps<T extends TagType = 'span'> = {
|
|
4
4
|
as?: T;
|
|
5
5
|
render?: (props: SymbolsElement<T>) => React.ReactNode;
|
|
6
6
|
'data-type'?: string;
|
|
7
7
|
};
|
|
8
|
-
export type SymbolsElement<T extends TagType> = SymbolsElementProps<T> & ComponentPropsWithoutRef<T>;
|
|
8
|
+
export type SymbolsElement<T extends TagType = 'span'> = SymbolsElementProps<T> & ComponentPropsWithoutRef<T>;
|
|
9
9
|
type InitialState<T extends ElementType = 'span'> = {
|
|
10
10
|
Arrow?: SymbolsElement<T>;
|
|
11
11
|
Colon?: SymbolsElement<T>;
|
package/cjs/symbol/Arrow.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const Arrow: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const BraceLeft: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const BraceRight: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const BracketsLeft: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const BracketsRight: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
package/cjs/symbol/Colon.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const Colon: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
package/cjs/symbol/Quote.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const Quote: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const ValueQuote: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
package/cjs/types/Bigint.d.ts
CHANGED
package/cjs/types/Date.d.ts
CHANGED
package/cjs/types/False.d.ts
CHANGED
package/cjs/types/Float.d.ts
CHANGED
package/cjs/types/Int.d.ts
CHANGED
package/cjs/types/Map.d.ts
CHANGED
package/cjs/types/Nan.d.ts
CHANGED
package/cjs/types/Null.d.ts
CHANGED
package/cjs/types/Set.d.ts
CHANGED
package/cjs/types/String.d.ts
CHANGED
package/cjs/types/True.d.ts
CHANGED
package/cjs/types/Undefined.d.ts
CHANGED
package/cjs/types/Url.d.ts
CHANGED
package/cjs/types/index.js
CHANGED
|
@@ -86,7 +86,7 @@ var TypeString = function TypeString(_ref3) {
|
|
|
86
86
|
displayDataTypes = _useTypesStore3.displayDataTypes;
|
|
87
87
|
var _useStore = (0, _store.useStore)(),
|
|
88
88
|
_useStore$shortenText = _useStore.shortenTextAfterLength,
|
|
89
|
-
length = _useStore$shortenText === void 0 ?
|
|
89
|
+
length = _useStore$shortenText === void 0 ? 30 : _useStore$shortenText;
|
|
90
90
|
var as = Str.as,
|
|
91
91
|
render = Str.render,
|
|
92
92
|
reset = (0, _objectWithoutProperties2["default"])(Str, _excluded3);
|
|
@@ -95,6 +95,9 @@ var TypeString = function TypeString(_ref3) {
|
|
|
95
95
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
96
96
|
shorten = _useState2[0],
|
|
97
97
|
setShorten = _useState2[1];
|
|
98
|
+
(0, _react.useEffect)(function () {
|
|
99
|
+
return setShorten(length && childrenStr.length >= length);
|
|
100
|
+
}, [length]);
|
|
98
101
|
var Comp = as || 'span';
|
|
99
102
|
var style = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, defalutStyle), Str.style || {});
|
|
100
103
|
if (length > 0) {
|
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/esm/index.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export interface JsonViewProps<T extends object> extends React.DetailedHTMLProps
|
|
|
50
50
|
collapsed?: boolean | number;
|
|
51
51
|
/** Whether to highlight updates. @default true */
|
|
52
52
|
highlightUpdates?: boolean;
|
|
53
|
-
/** Shorten long JSON strings, Set to `0` to disable this feature @default
|
|
53
|
+
/** Shorten long JSON strings, Set to `0` to disable this feature @default 30 */
|
|
54
54
|
shortenTextAfterLength?: number;
|
|
55
55
|
/** Callback function for when a treeNode is expanded or collapsed */
|
|
56
56
|
onExpand?: (props: {
|
package/esm/index.js
CHANGED
|
@@ -47,7 +47,7 @@ var JsonView = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
47
47
|
collapsed,
|
|
48
48
|
indentWidth = 15,
|
|
49
49
|
displayObjectSize = true,
|
|
50
|
-
shortenTextAfterLength =
|
|
50
|
+
shortenTextAfterLength = 30,
|
|
51
51
|
highlightUpdates = true,
|
|
52
52
|
enableClipboard = true,
|
|
53
53
|
displayDataTypes = true,
|
package/esm/section/Copied.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TagType } from '../store/Types';
|
|
2
2
|
import { type SectionElement } from '../store/Section';
|
|
3
3
|
export declare const Copied: {
|
|
4
|
-
(props: SectionElement<
|
|
4
|
+
<K extends TagType = "svg">(props: SectionElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -10,6 +10,6 @@ export interface CountInfoCompProps<T extends object> {
|
|
|
10
10
|
keyName: string | number;
|
|
11
11
|
}
|
|
12
12
|
export declare const CountInfoComp: {
|
|
13
|
-
<T extends object>(props: SectionElementProps<
|
|
13
|
+
<K extends TagType, T extends object>(props: SectionElementProps<K> & CountInfoCompProps<T> & import("react").HTMLAttributes<HTMLElement>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
14
14
|
displayName: string;
|
|
15
15
|
};
|
|
@@ -10,6 +10,6 @@ export interface CountInfoExtraCompsProps<T extends object> {
|
|
|
10
10
|
keyName: string | number;
|
|
11
11
|
}
|
|
12
12
|
export declare const CountInfoExtraComps: {
|
|
13
|
-
<T extends object>(props: SectionElementProps<
|
|
13
|
+
<T extends object, K extends TagType>(props: SectionElementProps<K> & CountInfoExtraCompsProps<T>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
14
14
|
displayName: string;
|
|
15
15
|
};
|
package/esm/store/Section.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { FC, PropsWithChildren, ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import { type TagType } from './Types';
|
|
3
|
-
export type SectionElementProps<T extends TagType> = {
|
|
3
|
+
export type SectionElementProps<T extends TagType = 'span'> = {
|
|
4
4
|
as?: T;
|
|
5
5
|
render?: (props: SectionElement<T>, result: {
|
|
6
6
|
value: unknown;
|
|
7
7
|
keyName: string | number;
|
|
8
8
|
}) => React.ReactNode;
|
|
9
9
|
};
|
|
10
|
-
export type SectionElement<T extends TagType> = SectionElementProps<T> & ComponentPropsWithoutRef<T>;
|
|
10
|
+
export type SectionElement<T extends TagType = 'span'> = SectionElementProps<T> & ComponentPropsWithoutRef<T>;
|
|
11
11
|
type InitialState<T extends TagType> = {
|
|
12
12
|
Copied?: SectionElement<T>;
|
|
13
13
|
CountInfo?: SectionElement<T>;
|
package/esm/store/Symbols.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FC, PropsWithChildren, ElementType, ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import { type TagType } from './Types';
|
|
3
|
-
type SymbolsElementProps<T extends TagType> = {
|
|
3
|
+
type SymbolsElementProps<T extends TagType = 'span'> = {
|
|
4
4
|
as?: T;
|
|
5
5
|
render?: (props: SymbolsElement<T>) => React.ReactNode;
|
|
6
6
|
'data-type'?: string;
|
|
7
7
|
};
|
|
8
|
-
export type SymbolsElement<T extends TagType> = SymbolsElementProps<T> & ComponentPropsWithoutRef<T>;
|
|
8
|
+
export type SymbolsElement<T extends TagType = 'span'> = SymbolsElementProps<T> & ComponentPropsWithoutRef<T>;
|
|
9
9
|
type InitialState<T extends ElementType = 'span'> = {
|
|
10
10
|
Arrow?: SymbolsElement<T>;
|
|
11
11
|
Colon?: SymbolsElement<T>;
|
package/esm/symbol/Arrow.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const Arrow: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const BraceLeft: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const BraceRight: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const BracketsLeft: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const BracketsRight: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
package/esm/symbol/Colon.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const Colon: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
package/esm/symbol/Quote.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const Quote: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SymbolsElement } from '../store/Symbols';
|
|
2
2
|
import { type TagType } from '../store/Types';
|
|
3
3
|
export declare const ValueQuote: {
|
|
4
|
-
(props: SymbolsElement<
|
|
4
|
+
<K extends TagType = "span">(props: SymbolsElement<K>): null;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
package/esm/types/Bigint.d.ts
CHANGED
package/esm/types/Date.d.ts
CHANGED
package/esm/types/False.d.ts
CHANGED
package/esm/types/Float.d.ts
CHANGED
package/esm/types/Int.d.ts
CHANGED
package/esm/types/Map.d.ts
CHANGED
package/esm/types/Nan.d.ts
CHANGED
package/esm/types/Null.d.ts
CHANGED
package/esm/types/Set.d.ts
CHANGED
package/esm/types/String.d.ts
CHANGED
package/esm/types/True.d.ts
CHANGED
package/esm/types/Undefined.d.ts
CHANGED
package/esm/types/Url.d.ts
CHANGED
package/esm/types/index.js
CHANGED
|
@@ -13,7 +13,7 @@ var _excluded = ["as", "render"],
|
|
|
13
13
|
_excluded11 = ["as", "render"],
|
|
14
14
|
_excluded12 = ["as", "render"],
|
|
15
15
|
_excluded13 = ["as", "render"];
|
|
16
|
-
import { Fragment, useState } from 'react';
|
|
16
|
+
import { Fragment, useEffect, useState } from 'react';
|
|
17
17
|
import { useTypesStore } from '../store/Types';
|
|
18
18
|
import { useStore } from '../store';
|
|
19
19
|
import { ValueQuote } from '../symbol';
|
|
@@ -85,7 +85,7 @@ export var TypeString = _ref3 => {
|
|
|
85
85
|
displayDataTypes
|
|
86
86
|
} = useTypesStore();
|
|
87
87
|
var {
|
|
88
|
-
shortenTextAfterLength: length =
|
|
88
|
+
shortenTextAfterLength: length = 30
|
|
89
89
|
} = useStore();
|
|
90
90
|
var {
|
|
91
91
|
as,
|
|
@@ -94,6 +94,7 @@ export var TypeString = _ref3 => {
|
|
|
94
94
|
reset = _objectWithoutPropertiesLoose(Str, _excluded3);
|
|
95
95
|
var childrenStr = children;
|
|
96
96
|
var [shorten, setShorten] = useState(length && childrenStr.length >= length);
|
|
97
|
+
useEffect(() => setShorten(length && childrenStr.length >= length), [length]);
|
|
97
98
|
var Comp = as || 'span';
|
|
98
99
|
var style = _extends({}, defalutStyle, Str.style || {});
|
|
99
100
|
if (length > 0) {
|
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;
|