@uiw/react-json-view 2.0.0-alpha.42 → 2.0.0-alpha.44

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.
Files changed (81) hide show
  1. package/README.md +48 -30
  2. package/cjs/arrow/TriangleArrow.d.ts +1 -1
  3. package/cjs/arrow/TriangleSolidArrow.d.ts +1 -1
  4. package/cjs/comps/Copied.d.ts +1 -1
  5. package/cjs/comps/KeyValues.d.ts +3 -3
  6. package/cjs/comps/NestedClose.d.ts +1 -1
  7. package/cjs/comps/NestedOpen.d.ts +1 -1
  8. package/cjs/comps/Value.d.ts +1 -1
  9. package/cjs/index.d.ts +2 -0
  10. package/cjs/section/CountInfo.d.ts +1 -1
  11. package/cjs/section/CountInfoExtra.d.ts +1 -1
  12. package/cjs/section/Ellipsis.d.ts +1 -1
  13. package/cjs/section/KeyName.d.ts +1 -1
  14. package/cjs/section/Row.d.ts +1 -1
  15. package/cjs/store/Types.d.ts +1 -1
  16. package/cjs/store.d.ts +1 -1
  17. package/cjs/symbol/index.d.ts +6 -6
  18. package/esm/Container.js +11 -9
  19. package/esm/arrow/TriangleArrow.d.ts +1 -1
  20. package/esm/arrow/TriangleArrow.js +1 -3
  21. package/esm/arrow/TriangleSolidArrow.d.ts +1 -1
  22. package/esm/arrow/TriangleSolidArrow.js +1 -3
  23. package/esm/comps/Copied.d.ts +1 -1
  24. package/esm/comps/Copied.js +18 -20
  25. package/esm/comps/KeyValues.d.ts +3 -3
  26. package/esm/comps/KeyValues.js +34 -35
  27. package/esm/comps/NestedClose.d.ts +1 -1
  28. package/esm/comps/NestedClose.js +10 -12
  29. package/esm/comps/NestedOpen.d.ts +1 -1
  30. package/esm/comps/NestedOpen.js +12 -14
  31. package/esm/comps/Value.d.ts +1 -1
  32. package/esm/comps/Value.js +3 -5
  33. package/esm/editor/KeyName.js +12 -16
  34. package/esm/editor/index.js +9 -8
  35. package/esm/index.d.ts +2 -0
  36. package/esm/index.js +26 -19
  37. package/esm/section/Copied.js +3 -3
  38. package/esm/section/CountInfo.d.ts +1 -1
  39. package/esm/section/CountInfo.js +13 -17
  40. package/esm/section/CountInfoExtra.d.ts +1 -1
  41. package/esm/section/CountInfoExtra.js +11 -14
  42. package/esm/section/Ellipsis.d.ts +1 -1
  43. package/esm/section/Ellipsis.js +11 -15
  44. package/esm/section/KeyName.d.ts +1 -1
  45. package/esm/section/KeyName.js +13 -17
  46. package/esm/section/Row.d.ts +1 -1
  47. package/esm/section/Row.js +14 -17
  48. package/esm/store/Expands.js +3 -5
  49. package/esm/store/Section.js +3 -5
  50. package/esm/store/ShowTools.js +3 -5
  51. package/esm/store/Symbols.js +3 -5
  52. package/esm/store/Types.d.ts +1 -1
  53. package/esm/store/Types.js +3 -5
  54. package/esm/store.d.ts +1 -1
  55. package/esm/store.js +21 -11
  56. package/esm/symbol/Arrow.js +3 -3
  57. package/esm/symbol/BraceLeft.js +3 -3
  58. package/esm/symbol/BraceRight.js +3 -3
  59. package/esm/symbol/BracketsLeft.js +3 -3
  60. package/esm/symbol/BracketsRight.js +3 -3
  61. package/esm/symbol/Colon.js +3 -3
  62. package/esm/symbol/Quote.js +3 -3
  63. package/esm/symbol/ValueQuote.js +3 -3
  64. package/esm/symbol/index.d.ts +6 -6
  65. package/esm/symbol/index.js +65 -89
  66. package/esm/types/Bigint.js +3 -3
  67. package/esm/types/Date.js +3 -3
  68. package/esm/types/False.js +3 -3
  69. package/esm/types/Float.js +3 -3
  70. package/esm/types/Int.js +3 -3
  71. package/esm/types/Map.js +3 -3
  72. package/esm/types/Nan.js +3 -3
  73. package/esm/types/Null.js +3 -3
  74. package/esm/types/Set.js +3 -3
  75. package/esm/types/String.js +3 -3
  76. package/esm/types/True.js +3 -3
  77. package/esm/types/Undefined.js +3 -3
  78. package/esm/types/Url.js +3 -3
  79. package/esm/types/index.js +124 -172
  80. package/esm/utils/useHighlight.js +3 -5
  81. package/package.json +1 -1
@@ -5,19 +5,17 @@ import { BracketsClose } from "../symbol/index.js";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  export var NestedClose = props => {
7
7
  var _expands$expandKey;
8
- var {
9
- keyName,
10
- value,
11
- expandKey,
12
- parentValue,
13
- level,
14
- keys = []
15
- } = props;
8
+ var keyName = props.keyName,
9
+ value = props.value,
10
+ expandKey = props.expandKey,
11
+ parentValue = props.parentValue,
12
+ level = props.level,
13
+ _props$keys = props.keys,
14
+ keys = _props$keys === void 0 ? [] : _props$keys;
16
15
  var expands = useExpandsStore();
17
- var {
18
- collapsed,
19
- shouldExpandNodeInitially
20
- } = useStore();
16
+ var _useStore = useStore(),
17
+ collapsed = _useStore.collapsed,
18
+ shouldExpandNodeInitially = _useStore.shouldExpandNodeInitially;
21
19
  var defaultExpanded = typeof collapsed === 'boolean' ? collapsed : typeof collapsed === 'number' ? level > collapsed : false;
22
20
  var isExpanded = (_expands$expandKey = expands[expandKey]) != null ? _expands$expandKey : shouldExpandNodeInitially ? false : defaultExpanded;
23
21
  var shouldExpand = shouldExpandNodeInitially && shouldExpandNodeInitially(!isExpanded, {
@@ -5,6 +5,6 @@ export interface NestedOpenProps<T extends object> extends SectionElementResult<
5
5
  level: number;
6
6
  }
7
7
  export declare const NestedOpen: {
8
- <T extends object>(props: NestedOpenProps<T>): import("react/jsx-runtime").JSX.Element;
8
+ <T extends object>(props: NestedOpenProps<T>): import("react").JSX.Element;
9
9
  displayName: string;
10
10
  };
@@ -11,22 +11,20 @@ import { SetComp, MapComp } from "../types/index.js";
11
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
12
  export var NestedOpen = props => {
13
13
  var _expands$expandKey;
14
- var {
15
- keyName,
16
- expandKey,
17
- keys = [],
18
- initialValue,
19
- value,
20
- parentValue,
21
- level
22
- } = props;
14
+ var keyName = props.keyName,
15
+ expandKey = props.expandKey,
16
+ _props$keys = props.keys,
17
+ keys = _props$keys === void 0 ? [] : _props$keys,
18
+ initialValue = props.initialValue,
19
+ value = props.value,
20
+ parentValue = props.parentValue,
21
+ level = props.level;
23
22
  var expands = useExpandsStore();
24
23
  var dispatchExpands = useExpandsDispatch();
25
- var {
26
- onExpand,
27
- collapsed,
28
- shouldExpandNodeInitially
29
- } = useStore();
24
+ var _useStore = useStore(),
25
+ onExpand = _useStore.onExpand,
26
+ collapsed = _useStore.collapsed,
27
+ shouldExpandNodeInitially = _useStore.shouldExpandNodeInitially;
30
28
  var defaultExpanded = typeof collapsed === 'boolean' ? collapsed : typeof collapsed === 'number' ? level > collapsed : false;
31
29
  var isExpanded = (_expands$expandKey = expands[expandKey]) != null ? _expands$expandKey : shouldExpandNodeInitially ? false : defaultExpanded;
32
30
  var shouldExpand = shouldExpandNodeInitially && shouldExpandNodeInitially(!isExpanded, {
@@ -5,7 +5,7 @@ interface ValueProps {
5
5
  keys?: (string | number)[];
6
6
  }
7
7
  export declare const Value: {
8
- (props: ValueProps): import("react/jsx-runtime").JSX.Element | null;
8
+ (props: ValueProps): import("react").JSX.Element | null;
9
9
  displayName: string;
10
10
  };
11
11
  export {};
@@ -3,11 +3,9 @@ import { TypeString, TypeTrue, TypeNull, TypeFalse, TypeFloat, TypeBigint, TypeI
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  export var isFloat = n => Number(n) === n && n % 1 !== 0 || isNaN(n);
5
5
  export var Value = props => {
6
- var {
7
- value,
8
- keyName,
9
- keys
10
- } = props;
6
+ var value = props.value,
7
+ keyName = props.keyName,
8
+ keys = props.keys;
11
9
  var reset = {
12
10
  keyName,
13
11
  keys
@@ -6,15 +6,11 @@ import { useRef, useState } from 'react';
6
6
  import { useStore } from "./store.js";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  export var KeyNameRender = (_ref, _ref2) => {
9
- var {
10
- children
11
- } = _ref,
9
+ var children = _ref.children,
12
10
  reset = _objectWithoutPropertiesLoose(_ref, _excluded);
13
- var {
14
- value,
15
- parentValue,
16
- keyName
17
- } = _ref2;
11
+ var value = _ref2.value,
12
+ parentValue = _ref2.parentValue,
13
+ keyName = _ref2.keyName;
18
14
  if (typeof children === 'number') {
19
15
  return /*#__PURE__*/_jsx("span", _extends({}, reset, {
20
16
  children: children
@@ -28,16 +24,16 @@ export var KeyNameRender = (_ref, _ref2) => {
28
24
  }));
29
25
  };
30
26
  var Child = props => {
31
- var {
32
- value,
33
- keyName
34
- } = props,
27
+ var value = props.value,
28
+ parentValue = props.parentValue,
29
+ keyName = props.keyName,
35
30
  reset = _objectWithoutPropertiesLoose(props, _excluded2);
36
31
  var $dom = useRef(null);
37
- var [currentValue, setCurrentValue] = useState(props.children);
38
- var {
39
- onEdit
40
- } = useStore();
32
+ var _useState = useState(props.children),
33
+ currentValue = _useState[0],
34
+ setCurrentValue = _useState[1];
35
+ var _useStore = useStore(),
36
+ onEdit = _useStore.onEdit;
41
37
  var onKeyDown = evn => {
42
38
  if (evn.key === 'Enter') {
43
39
  var _$dom$current;
@@ -7,15 +7,16 @@ import { KeyNameRender } from "./KeyName.js";
7
7
  import { Context, Dispatch, useStoreReducer } from "./store.js";
8
8
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
9
  var JsonViewEditor = /*#__PURE__*/forwardRef((props, ref) => {
10
- var {
11
- children,
12
- onEdit,
13
- editable = true
14
- } = props,
10
+ var children = props.children,
11
+ onEdit = props.onEdit,
12
+ _props$editable = props.editable,
13
+ editable = _props$editable === void 0 ? true : _props$editable,
15
14
  reset = _objectWithoutPropertiesLoose(props, _excluded);
16
- var [state, dispatch] = useStoreReducer({
17
- onEdit
18
- });
15
+ var _useStoreReducer = useStoreReducer({
16
+ onEdit
17
+ }),
18
+ state = _useStoreReducer[0],
19
+ dispatch = _useStoreReducer[1];
19
20
  return /*#__PURE__*/_jsx(Context.Provider, {
20
21
  value: state,
21
22
  children: /*#__PURE__*/_jsx(Dispatch.Provider, {
package/esm/index.d.ts CHANGED
@@ -31,6 +31,8 @@ export * from './store/ShowTools';
31
31
  export * from './store/Symbols';
32
32
  export * from './store/Types';
33
33
  export * from './symbol/';
34
+ export type { SectionElement } from './store/Section';
35
+ export type { CopiedSectionElement } from './section/Copied';
34
36
  export type ShouldExpandNodeInitially<T extends object> = (isExpanded: boolean, props: {
35
37
  keyName?: string | number;
36
38
  value?: T;
package/esm/index.js CHANGED
@@ -39,25 +39,32 @@ export * from "./store/Symbols.js";
39
39
  export * from "./store/Types.js";
40
40
  export * from "./symbol/index.js";
41
41
  var JsonView = /*#__PURE__*/forwardRef((props, ref) => {
42
- var {
43
- className = '',
44
- style,
45
- value,
46
- children,
47
- collapsed = false,
48
- shouldExpandNodeInitially,
49
- indentWidth = 15,
50
- displayObjectSize = true,
51
- shortenTextAfterLength = 30,
52
- stringEllipsis,
53
- highlightUpdates = true,
54
- enableClipboard = true,
55
- displayDataTypes = true,
56
- objectSortKeys = false,
57
- onExpand,
58
- onCopied,
59
- beforeCopy
60
- } = props,
42
+ var _props$className = props.className,
43
+ className = _props$className === void 0 ? '' : _props$className,
44
+ style = props.style,
45
+ value = props.value,
46
+ children = props.children,
47
+ _props$collapsed = props.collapsed,
48
+ collapsed = _props$collapsed === void 0 ? false : _props$collapsed,
49
+ shouldExpandNodeInitially = props.shouldExpandNodeInitially,
50
+ _props$indentWidth = props.indentWidth,
51
+ indentWidth = _props$indentWidth === void 0 ? 15 : _props$indentWidth,
52
+ _props$displayObjectS = props.displayObjectSize,
53
+ displayObjectSize = _props$displayObjectS === void 0 ? true : _props$displayObjectS,
54
+ _props$shortenTextAft = props.shortenTextAfterLength,
55
+ shortenTextAfterLength = _props$shortenTextAft === void 0 ? 30 : _props$shortenTextAft,
56
+ stringEllipsis = props.stringEllipsis,
57
+ _props$highlightUpdat = props.highlightUpdates,
58
+ highlightUpdates = _props$highlightUpdat === void 0 ? true : _props$highlightUpdat,
59
+ _props$enableClipboar = props.enableClipboard,
60
+ enableClipboard = _props$enableClipboar === void 0 ? true : _props$enableClipboar,
61
+ _props$displayDataTyp = props.displayDataTypes,
62
+ displayDataTypes = _props$displayDataTyp === void 0 ? true : _props$displayDataTyp,
63
+ _props$objectSortKeys = props.objectSortKeys,
64
+ objectSortKeys = _props$objectSortKeys === void 0 ? false : _props$objectSortKeys,
65
+ onExpand = props.onExpand,
66
+ onCopied = props.onCopied,
67
+ beforeCopy = props.beforeCopy,
61
68
  elmProps = _objectWithoutPropertiesLoose(props, _excluded);
62
69
  var defaultStyle = _extends({
63
70
  lineHeight: 1.4,
@@ -1,9 +1,9 @@
1
1
  import { useSectionStore } from "../store/Section.js";
2
2
  import { useSectionRender } from "../utils/useRender.js";
3
3
  export var Copied = props => {
4
- var {
5
- Copied: Comp = {}
6
- } = useSectionStore();
4
+ var _useSectionStore = useSectionStore(),
5
+ _useSectionStore$Copi = _useSectionStore.Copied,
6
+ Comp = _useSectionStore$Copi === void 0 ? {} : _useSectionStore$Copi;
7
7
  useSectionRender(Comp, props, 'Copied');
8
8
  return null;
9
9
  };
@@ -9,6 +9,6 @@ export interface CountInfoCompProps<T extends object> {
9
9
  keyName: string | number;
10
10
  }
11
11
  export declare const CountInfoComp: {
12
- <K extends TagType, T extends object>(props: SectionElementProps<K> & CountInfoCompProps<T> & React.HTMLAttributes<HTMLElement>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
12
+ <K extends TagType, T extends object>(props: SectionElementProps<K> & CountInfoCompProps<T> & React.HTMLAttributes<HTMLElement>): string | number | true | Iterable<import("react").ReactNode> | import("react").JSX.Element | null;
13
13
  displayName: string;
14
14
  };
@@ -7,30 +7,26 @@ import { useSectionRender } from "../utils/useRender.js";
7
7
  import { useStore } from "../store.js";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  export var CountInfo = props => {
10
- var {
11
- CountInfo: Comp = {}
12
- } = useSectionStore();
10
+ var _useSectionStore = useSectionStore(),
11
+ _useSectionStore$Coun = _useSectionStore.CountInfo,
12
+ Comp = _useSectionStore$Coun === void 0 ? {} : _useSectionStore$Coun;
13
13
  useSectionRender(Comp, props, 'CountInfo');
14
14
  return null;
15
15
  };
16
16
  CountInfo.displayName = 'JVR.CountInfo';
17
17
  export var CountInfoComp = props => {
18
- var {
19
- value = {},
20
- keyName
21
- } = props,
18
+ var _props$value = props.value,
19
+ value = _props$value === void 0 ? {} : _props$value,
20
+ keyName = props.keyName,
22
21
  other = _objectWithoutPropertiesLoose(props, _excluded);
23
- var {
24
- displayObjectSize
25
- } = useStore();
26
- var {
27
- CountInfo: Comp = {}
28
- } = useSectionStore();
22
+ var _useStore = useStore(),
23
+ displayObjectSize = _useStore.displayObjectSize;
24
+ var _useSectionStore2 = useSectionStore(),
25
+ _useSectionStore2$Cou = _useSectionStore2.CountInfo,
26
+ Comp = _useSectionStore2$Cou === void 0 ? {} : _useSectionStore2$Cou;
29
27
  if (!displayObjectSize) return null;
30
- var {
31
- as,
32
- render
33
- } = Comp,
28
+ var as = Comp.as,
29
+ render = Comp.render,
34
30
  reset = _objectWithoutPropertiesLoose(Comp, _excluded2);
35
31
  var Elm = as || 'span';
36
32
  reset.style = _extends({}, reset.style, props.style);
@@ -9,6 +9,6 @@ export interface CountInfoExtraCompsProps<T extends object> {
9
9
  keyName: string | number;
10
10
  }
11
11
  export declare const CountInfoExtraComps: {
12
- <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;
12
+ <T extends object, K extends TagType>(props: SectionElementProps<K> & CountInfoExtraCompsProps<T>): string | number | true | Iterable<import("react").ReactNode> | import("react").JSX.Element | null;
13
13
  displayName: string;
14
14
  };
@@ -6,26 +6,23 @@ import { useSectionStore } from "../store/Section.js";
6
6
  import { useSectionRender } from "../utils/useRender.js";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  export var CountInfoExtra = props => {
9
- var {
10
- CountInfoExtra: Comp = {}
11
- } = useSectionStore();
9
+ var _useSectionStore = useSectionStore(),
10
+ _useSectionStore$Coun = _useSectionStore.CountInfoExtra,
11
+ Comp = _useSectionStore$Coun === void 0 ? {} : _useSectionStore$Coun;
12
12
  useSectionRender(Comp, props, 'CountInfoExtra');
13
13
  return null;
14
14
  };
15
15
  CountInfoExtra.displayName = 'JVR.CountInfoExtra';
16
16
  export var CountInfoExtraComps = props => {
17
- var {
18
- value = {},
19
- keyName
20
- } = props,
17
+ var _props$value = props.value,
18
+ value = _props$value === void 0 ? {} : _props$value,
19
+ keyName = props.keyName,
21
20
  other = _objectWithoutPropertiesLoose(props, _excluded);
22
- var {
23
- CountInfoExtra: Comp = {}
24
- } = useSectionStore();
25
- var {
26
- as,
27
- render
28
- } = Comp,
21
+ var _useSectionStore2 = useSectionStore(),
22
+ _useSectionStore2$Cou = _useSectionStore2.CountInfoExtra,
23
+ Comp = _useSectionStore2$Cou === void 0 ? {} : _useSectionStore2$Cou;
24
+ var as = Comp.as,
25
+ render = Comp.render,
29
26
  reset = _objectWithoutPropertiesLoose(Comp, _excluded2);
30
27
  if (!render && !reset.children) return null;
31
28
  var Elm = as || 'span';
@@ -10,6 +10,6 @@ export interface EllipsisCompProps<T extends object> {
10
10
  isExpanded: boolean;
11
11
  }
12
12
  export declare const EllipsisComp: {
13
- <T extends object>({ isExpanded, value, keyName }: EllipsisCompProps<T>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null;
13
+ <T extends object>({ isExpanded, value, keyName }: EllipsisCompProps<T>): string | number | true | Iterable<import("react").ReactNode> | import("react").JSX.Element | null;
14
14
  displayName: string;
15
15
  };
@@ -5,26 +5,22 @@ import { useSectionStore } from "../store/Section.js";
5
5
  import { useSectionRender } from "../utils/useRender.js";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  export var Ellipsis = props => {
8
- var {
9
- Ellipsis: Comp = {}
10
- } = useSectionStore();
8
+ var _useSectionStore = useSectionStore(),
9
+ _useSectionStore$Elli = _useSectionStore.Ellipsis,
10
+ Comp = _useSectionStore$Elli === void 0 ? {} : _useSectionStore$Elli;
11
11
  useSectionRender(Comp, props, 'Ellipsis');
12
12
  return null;
13
13
  };
14
14
  Ellipsis.displayName = 'JVR.Ellipsis';
15
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,
16
+ var isExpanded = _ref.isExpanded,
17
+ value = _ref.value,
18
+ keyName = _ref.keyName;
19
+ var _useSectionStore2 = useSectionStore(),
20
+ _useSectionStore2$Ell = _useSectionStore2.Ellipsis,
21
+ Comp = _useSectionStore2$Ell === void 0 ? {} : _useSectionStore2$Ell;
22
+ var as = Comp.as,
23
+ render = Comp.render,
28
24
  reset = _objectWithoutPropertiesLoose(Comp, _excluded);
29
25
  var Elm = as || 'span';
30
26
  var child = render && typeof render === 'function' && render(_extends({}, reset, {
@@ -9,6 +9,6 @@ export declare const KeyName: {
9
9
  export interface KeyNameCompProps<T extends object> extends React.HTMLAttributes<HTMLSpanElement>, SectionElementResult<T> {
10
10
  }
11
11
  export declare const KeyNameComp: {
12
- <T extends object>(props: PropsWithChildren<KeyNameCompProps<T>>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
12
+ <T extends object>(props: PropsWithChildren<KeyNameCompProps<T>>): string | number | true | Iterable<import("react").ReactNode> | import("react").JSX.Element;
13
13
  displayName: string;
14
14
  };
@@ -5,32 +5,28 @@ import { useSectionStore } from "../store/Section.js";
5
5
  import { useSectionRender } from "../utils/useRender.js";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  export var KeyName = props => {
8
- var {
9
- KeyName: Comp = {}
10
- } = useSectionStore();
8
+ var _useSectionStore = useSectionStore(),
9
+ _useSectionStore$KeyN = _useSectionStore.KeyName,
10
+ Comp = _useSectionStore$KeyN === void 0 ? {} : _useSectionStore$KeyN;
11
11
  useSectionRender(Comp, props, 'KeyName');
12
12
  return null;
13
13
  };
14
14
  KeyName.displayName = 'JVR.KeyName';
15
15
  export var KeyNameComp = props => {
16
- var {
17
- children,
18
- value,
19
- parentValue,
20
- keyName,
21
- keys
22
- } = props;
16
+ var children = props.children,
17
+ value = props.value,
18
+ parentValue = props.parentValue,
19
+ keyName = props.keyName,
20
+ keys = props.keys;
23
21
  var isNumber = typeof children === 'number';
24
22
  var style = {
25
23
  color: isNumber ? 'var(--w-rjv-key-number, #268bd2)' : 'var(--w-rjv-key-string, #002b36)'
26
24
  };
27
- var {
28
- KeyName: Comp = {}
29
- } = useSectionStore();
30
- var {
31
- as,
32
- render
33
- } = Comp,
25
+ var _useSectionStore2 = useSectionStore(),
26
+ _useSectionStore2$Key = _useSectionStore2.KeyName,
27
+ Comp = _useSectionStore2$Key === void 0 ? {} : _useSectionStore2$Key;
28
+ var as = Comp.as,
29
+ render = Comp.render,
34
30
  reset = _objectWithoutPropertiesLoose(Comp, _excluded);
35
31
  reset.style = _extends({}, reset.style, style);
36
32
  var Elm = as || 'span';
@@ -8,6 +8,6 @@ export declare const Row: {
8
8
  export interface RowCompProps<T extends object> extends React.HTMLAttributes<HTMLDivElement>, SectionElementResult<T> {
9
9
  }
10
10
  export declare const RowComp: {
11
- <T extends object>(props: React.PropsWithChildren<RowCompProps<T>>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
11
+ <T extends object>(props: React.PropsWithChildren<RowCompProps<T>>): string | number | true | Iterable<import("react").ReactNode> | import("react").JSX.Element;
12
12
  displayName: string;
13
13
  };
@@ -6,29 +6,26 @@ import { useSectionStore } from "../store/Section.js";
6
6
  import { useSectionRender } from "../utils/useRender.js";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  export var Row = props => {
9
- var {
10
- Row: Comp = {}
11
- } = useSectionStore();
9
+ var _useSectionStore = useSectionStore(),
10
+ _useSectionStore$Row = _useSectionStore.Row,
11
+ Comp = _useSectionStore$Row === void 0 ? {} : _useSectionStore$Row;
12
12
  useSectionRender(Comp, props, 'Row');
13
13
  return null;
14
14
  };
15
15
  Row.displayName = 'JVR.Row';
16
16
  export var RowComp = props => {
17
- var {
18
- children,
19
- value,
20
- parentValue,
21
- keyName,
22
- keys
23
- } = props,
17
+ var children = props.children,
18
+ value = props.value,
19
+ parentValue = props.parentValue,
20
+ keyName = props.keyName,
21
+ keys = props.keys,
24
22
  other = _objectWithoutPropertiesLoose(props, _excluded);
25
- var {
26
- Row: Comp = {}
27
- } = useSectionStore();
28
- var {
29
- as,
30
- render
31
- } = Comp,
23
+ var _useSectionStore2 = useSectionStore(),
24
+ _useSectionStore2$Row = _useSectionStore2.Row,
25
+ Comp = _useSectionStore2$Row === void 0 ? {} : _useSectionStore2$Row;
26
+ var as = Comp.as,
27
+ render = Comp.render,
28
+ _ = Comp.children,
32
29
  reset = _objectWithoutPropertiesLoose(Comp, _excluded2);
33
30
  var Elm = as || 'div';
34
31
  var child = render && typeof render === 'function' && render(_extends({}, other, reset, {
@@ -16,11 +16,9 @@ export function useExpandsDispatch() {
16
16
  return useContext(DispatchExpands);
17
17
  }
18
18
  export var Expands = _ref => {
19
- var {
20
- initial,
21
- dispatch,
22
- children
23
- } = _ref;
19
+ var initial = _ref.initial,
20
+ dispatch = _ref.dispatch,
21
+ children = _ref.children;
24
22
  return /*#__PURE__*/_jsx(Context.Provider, {
25
23
  value: initial,
26
24
  children: /*#__PURE__*/_jsx(DispatchExpands.Provider, {
@@ -61,11 +61,9 @@ export function useSectionDispatch() {
61
61
  return useContext(DispatchSection);
62
62
  }
63
63
  export var Section = _ref => {
64
- var {
65
- initial,
66
- dispatch,
67
- children
68
- } = _ref;
64
+ var initial = _ref.initial,
65
+ dispatch = _ref.dispatch,
66
+ children = _ref.children;
69
67
  return /*#__PURE__*/_jsx(Context.Provider, {
70
68
  value: initial,
71
69
  children: /*#__PURE__*/_jsx(DispatchSection.Provider, {
@@ -16,11 +16,9 @@ export function useShowToolsDispatch() {
16
16
  return useContext(DispatchShowTools);
17
17
  }
18
18
  export var ShowTools = _ref => {
19
- var {
20
- initial,
21
- dispatch,
22
- children
23
- } = _ref;
19
+ var initial = _ref.initial,
20
+ dispatch = _ref.dispatch,
21
+ children = _ref.children;
24
22
  return /*#__PURE__*/_jsx(Context.Provider, {
25
23
  value: initial,
26
24
  children: /*#__PURE__*/_jsx(DispatchShowTools.Provider, {
@@ -85,11 +85,9 @@ export function useSymbolsDispatch() {
85
85
  return useContext(DispatchSymbols);
86
86
  }
87
87
  export var Symbols = _ref => {
88
- var {
89
- initial,
90
- dispatch,
91
- children
92
- } = _ref;
88
+ var initial = _ref.initial,
89
+ dispatch = _ref.dispatch,
90
+ children = _ref.children;
93
91
  return /*#__PURE__*/_jsx(Context.Provider, {
94
92
  value: initial,
95
93
  children: /*#__PURE__*/_jsx(DispatchSymbols.Provider, {
@@ -50,7 +50,7 @@ interface TypesProps<T extends TagType> {
50
50
  initial: InitialTypesState<T>;
51
51
  dispatch: Dispatch<TagType>;
52
52
  }
53
- export declare function Types<T extends TagType>({ initial, dispatch, children }: PropsWithChildren<TypesProps<T>>): import("react/jsx-runtime").JSX.Element;
53
+ export declare function Types<T extends TagType>({ initial, dispatch, children }: PropsWithChildren<TypesProps<T>>): import("react").JSX.Element;
54
54
  export declare namespace Types {
55
55
  var displayName: string;
56
56
  }
@@ -136,11 +136,9 @@ export function useTypesDispatch() {
136
136
  return useContext(DispatchTypes);
137
137
  }
138
138
  export function Types(_ref) {
139
- var {
140
- initial,
141
- dispatch,
142
- children
143
- } = _ref;
139
+ var initial = _ref.initial,
140
+ dispatch = _ref.dispatch,
141
+ children = _ref.children;
144
142
  return /*#__PURE__*/_jsx(Context.Provider, {
145
143
  value: initial,
146
144
  children: /*#__PURE__*/_jsx(DispatchTypes.Provider, {
package/esm/store.d.ts CHANGED
@@ -28,7 +28,7 @@ export interface ProviderProps<T extends TagType> {
28
28
  initialTypes?: InitialTypesState<T>;
29
29
  }
30
30
  export declare const Provider: {
31
- <T extends TagType>({ children, initialState: init, initialTypes, }: PropsWithChildren<ProviderProps<T>>): import("react/jsx-runtime").JSX.Element;
31
+ <T extends TagType>({ children, initialState: init, initialTypes, }: PropsWithChildren<ProviderProps<T>>): React.JSX.Element;
32
32
  displayName: string;
33
33
  };
34
34
  export declare function useDispatch(): Dispatch;