Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uiw/react-json-view

Package Overview
Dependencies
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uiw/react-json-view - npm Package Compare versions

Comparing version 2.0.0-alpha.13 to 2.0.0-alpha.14

6

cjs/comps/KeyValues.d.ts

@@ -1,5 +0,3 @@

interface KeyValuesProps<T extends object> {
keyName?: string | number;
value?: T;
parentValue?: T;
import { type SectionElementResult } from '../store/Section';
interface KeyValuesProps<T extends object> extends SectionElementResult<T> {
expandKey?: string;

@@ -6,0 +4,0 @@ level: number;

@@ -11,2 +11,3 @@ "use strict";

var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

@@ -29,3 +30,5 @@ var _react = require("react");

expandKey = _props$expandKey === void 0 ? '' : _props$expandKey,
level = props.level;
level = props.level,
_props$keys = props.keys,
keys = _props$keys === void 0 ? [] : _props$keys;
var expands = (0, _Expands.useExpandsStore)();

@@ -77,2 +80,3 @@ var _useStore = (0, _store.useStore)(),

keyName: key,
keys: [].concat((0, _toConsumableArray2["default"])(keys), [key]),
value: val,

@@ -122,3 +126,5 @@ level: level

_props$level = props.level,
level = _props$level === void 0 ? 0 : _props$level;
level = _props$level === void 0 ? 0 : _props$level,
_props$keys2 = props.keys,
keys = _props$keys2 === void 0 ? [] : _props$keys2;
var dispatch = (0, _ShowTools.useShowToolsDispatch)();

@@ -140,2 +146,3 @@ var subkeyid = (0, _react.useId)();

initialValue: value,
keys: keys,
level: level + 1

@@ -156,2 +163,3 @@ });

keyName: keyName,
keys: keys,
parentValue: parentValue

@@ -158,0 +166,0 @@ }, reset), {}, {

@@ -9,3 +9,5 @@ import React from 'react';

initialValue?: T;
/** Index of the parent `keyName` */
keys?: (string | number)[];
}
export declare const Container: React.ForwardRefExoticComponent<ContainerProps<object> & React.RefAttributes<HTMLDivElement>>;

@@ -18,3 +18,3 @@ "use strict";

var _jsxRuntime = require("react/jsx-runtime");
var _excluded = ["className", "children", "parentValue", "keyid", "level", "value", "initialValue", "keyName"];
var _excluded = ["className", "children", "parentValue", "keyid", "level", "value", "initialValue", "keys", "keyName"];
var Container = exports.Container = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {

@@ -30,2 +30,3 @@ var _props$className = props.className,

initialValue = props.initialValue,
keys = props.keys,
keyName = props.keyName,

@@ -57,3 +58,4 @@ elmProps = (0, _objectWithoutProperties2["default"])(props, _excluded);

value: value,
level: level
level: level,
keys: keys
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_NestedClose.NestedClose, {

@@ -60,0 +62,0 @@ expandKey: subkeyid,

@@ -1,4 +0,5 @@

import { type FC, type PropsWithChildren } from 'react';
import { type PropsWithChildren } from 'react';
import { type TagType } from '../store/Types';
import { type SectionElement } from '../store/Section';
import { type SectionElementResult } from '../store/Section';
export declare const KeyName: {

@@ -8,8 +9,7 @@ <K extends TagType>(props: SectionElement<K>): null;

};
type KeyNameCompProps = {
keyName: string | number;
value?: unknown;
parentValue?: unknown;
export interface KeyNameCompProps<T extends object> extends React.HTMLAttributes<HTMLSpanElement>, SectionElementResult<T> {
}
export declare const KeyNameComp: {
<T extends object>(props: PropsWithChildren<KeyNameCompProps<T>>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
displayName: string;
};
export declare const KeyNameComp: FC<PropsWithChildren<KeyNameCompProps>>;
export {};

@@ -26,3 +26,4 @@ "use strict";

parentValue = props.parentValue,
keyName = props.keyName;
keyName = props.keyName,
keys = props.keys;
var isNumber = typeof children === 'number';

@@ -45,3 +46,4 @@ var style = {

parentValue: parentValue,
keyName: keyName
keyName: keyName,
keys: keys
});

@@ -48,0 +50,0 @@ if (child) return child;

/// <reference types="react" />
import { type TagType } from '../store/Types';
import { type SectionElement } from '../store/Section';
import { type SectionElementResult } from '../store/Section';
export declare const Row: {

@@ -8,10 +9,7 @@ <K extends TagType>(props: SectionElement<K>): null;

};
export interface RowCompProps<T extends object> extends React.HTMLAttributes<HTMLDivElement> {
value?: T;
keyName?: string | number;
parentValue?: unknown;
export interface RowCompProps<T extends object> extends React.HTMLAttributes<HTMLDivElement>, SectionElementResult<T> {
}
export declare const RowComp: {
<T extends object>({ children, value, keyName, parentValue, ...other }: import("react").PropsWithChildren<RowCompProps<T>>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
<T extends object>(props: import("react").PropsWithChildren<RowCompProps<T>>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
displayName: string;
};

@@ -13,3 +13,3 @@ "use strict";

var _jsxRuntime = require("react/jsx-runtime");
var _excluded = ["children", "value", "keyName", "parentValue"],
var _excluded = ["children", "value", "parentValue", "keyName", "keys"],
_excluded2 = ["as", "render", "children"];

@@ -24,9 +24,9 @@ var Row = exports.Row = function Row(props) {

Row.displayName = 'JVR.Row';
var RowComp = exports.RowComp = function RowComp(_ref) {
var children = _ref.children,
value = _ref.value,
_ref$keyName = _ref.keyName,
keyName = _ref$keyName === void 0 ? '' : _ref$keyName,
parentValue = _ref.parentValue,
other = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
var RowComp = exports.RowComp = function RowComp(props) {
var children = props.children,
value = props.value,
parentValue = props.parentValue,
keyName = props.keyName,
keys = props.keys,
other = (0, _objectWithoutProperties2["default"])(props, _excluded);
var _useSectionStore2 = (0, _Section.useSectionStore)(),

@@ -45,3 +45,4 @@ _useSectionStore2$Row = _useSectionStore2.Row,

keyName: keyName,
parentValue: parentValue
parentValue: parentValue,
keys: keys
});

@@ -48,0 +49,0 @@ if (child) return child;

import React, { FC, PropsWithChildren, ComponentPropsWithoutRef } from 'react';
import { type TagType } from './Types';
export interface SectionElementResult<T extends object, K = string | number> {
value?: T;
parentValue?: T;
keyName?: K;
/** Index of the parent `keyName` */
keys?: K[];
}
export type SectionElementProps<T extends TagType = 'span'> = {
as?: T;
render?: (props: SectionElement<T>, result: {
value: unknown;
parentValue?: unknown;
keyName: string | number;
}) => React.ReactNode;
render?: (props: SectionElement<T>, result: SectionElementResult<object>) => React.ReactNode;
};

@@ -11,0 +14,0 @@ export type SectionElement<T extends TagType = 'span'> = SectionElementProps<T> & ComponentPropsWithoutRef<T>;

@@ -1,5 +0,3 @@

interface KeyValuesProps<T extends object> {
keyName?: string | number;
value?: T;
parentValue?: T;
import { type SectionElementResult } from '../store/Section';
interface KeyValuesProps<T extends object> extends SectionElementResult<T> {
expandKey?: string;

@@ -6,0 +4,0 @@ level: number;

@@ -19,3 +19,4 @@ import _extends from "@babel/runtime/helpers/extends";

expandKey = '',
level
level,
keys = []
} = props;

@@ -59,2 +60,3 @@ var expands = useExpandsStore();

keyName: key,
keys: [...keys, key],
value: val,

@@ -107,3 +109,4 @@ level: level

parentValue,
level = 0
level = 0,
keys = []
} = props;

@@ -126,2 +129,3 @@ var dispatch = useShowToolsDispatch();

initialValue: value,
keys: keys,
level: level + 1

@@ -142,2 +146,3 @@ });

keyName: keyName,
keys: keys,
parentValue: parentValue

@@ -144,0 +149,0 @@ }, reset, {

@@ -9,3 +9,5 @@ import React from 'react';

initialValue?: T;
/** Index of the parent `keyName` */
keys?: (string | number)[];
}
export declare const Container: React.ForwardRefExoticComponent<ContainerProps<object> & React.RefAttributes<HTMLDivElement>>;
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _excluded = ["className", "children", "parentValue", "keyid", "level", "value", "initialValue", "keyName"];
var _excluded = ["className", "children", "parentValue", "keyid", "level", "value", "initialValue", "keys", "keyName"];
import React, { forwardRef, useId } from 'react';

@@ -17,2 +17,3 @@ import { NestedClose } from './comps/NestedClose';

initialValue,
keys,
keyName

@@ -45,3 +46,4 @@ } = props,

value: value,
level: level
level: level,
keys: keys
}), /*#__PURE__*/_jsx(NestedClose, {

@@ -48,0 +50,0 @@ expandKey: subkeyid,

@@ -1,4 +0,5 @@

import { type FC, type PropsWithChildren } from 'react';
import { type PropsWithChildren } from 'react';
import { type TagType } from '../store/Types';
import { type SectionElement } from '../store/Section';
import { type SectionElementResult } from '../store/Section';
export declare const KeyName: {

@@ -8,8 +9,7 @@ <K extends TagType>(props: SectionElement<K>): null;

};
type KeyNameCompProps = {
keyName: string | number;
value?: unknown;
parentValue?: unknown;
export interface KeyNameCompProps<T extends object> extends React.HTMLAttributes<HTMLSpanElement>, SectionElementResult<T> {
}
export declare const KeyNameComp: {
<T extends object>(props: PropsWithChildren<KeyNameCompProps<T>>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
displayName: string;
};
export declare const KeyNameComp: FC<PropsWithChildren<KeyNameCompProps>>;
export {};

@@ -20,3 +20,4 @@ import _extends from "@babel/runtime/helpers/extends";

parentValue,
keyName
keyName,
keys
} = props;

@@ -42,3 +43,4 @@ var isNumber = typeof children === 'number';

parentValue,
keyName
keyName,
keys
});

@@ -45,0 +47,0 @@ if (child) return child;

/// <reference types="react" />
import { type TagType } from '../store/Types';
import { type SectionElement } from '../store/Section';
import { type SectionElementResult } from '../store/Section';
export declare const Row: {

@@ -8,10 +9,7 @@ <K extends TagType>(props: SectionElement<K>): null;

};
export interface RowCompProps<T extends object> extends React.HTMLAttributes<HTMLDivElement> {
value?: T;
keyName?: string | number;
parentValue?: unknown;
export interface RowCompProps<T extends object> extends React.HTMLAttributes<HTMLDivElement>, SectionElementResult<T> {
}
export declare const RowComp: {
<T extends object>({ children, value, keyName, parentValue, ...other }: import("react").PropsWithChildren<RowCompProps<T>>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
<T extends object>(props: import("react").PropsWithChildren<RowCompProps<T>>): string | number | true | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element;
displayName: string;
};
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _excluded = ["children", "value", "keyName", "parentValue"],
var _excluded = ["children", "value", "parentValue", "keyName", "keys"],
_excluded2 = ["as", "render", "children"];

@@ -16,10 +16,11 @@ import { useSectionStore } from '../store/Section';

Row.displayName = 'JVR.Row';
export var RowComp = _ref => {
export var RowComp = props => {
var {
children,
value,
keyName = '',
parentValue
} = _ref,
other = _objectWithoutPropertiesLoose(_ref, _excluded);
parentValue,
keyName,
keys
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
var {

@@ -39,3 +40,4 @@ Row: Comp = {}

keyName,
parentValue
parentValue,
keys
});

@@ -42,0 +44,0 @@ if (child) return child;

import React, { FC, PropsWithChildren, ComponentPropsWithoutRef } from 'react';
import { type TagType } from './Types';
export interface SectionElementResult<T extends object, K = string | number> {
value?: T;
parentValue?: T;
keyName?: K;
/** Index of the parent `keyName` */
keys?: K[];
}
export type SectionElementProps<T extends TagType = 'span'> = {
as?: T;
render?: (props: SectionElement<T>, result: {
value: unknown;
parentValue?: unknown;
keyName: string | number;
}) => React.ReactNode;
render?: (props: SectionElement<T>, result: SectionElementResult<object>) => React.ReactNode;
};

@@ -11,0 +14,0 @@ export type SectionElement<T extends TagType = 'span'> = SectionElementProps<T> & ComponentPropsWithoutRef<T>;

{
"name": "@uiw/react-json-view",
"version": "2.0.0-alpha.13",
"version": "2.0.0-alpha.14",
"description": "JSON viewer for react.",

@@ -5,0 +5,0 @@ "main": "cjs/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc