Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
react-json-editor-ajrm
Advanced tools
A stylish, editor-like, modular, react component for viewing, editing, and debugging javascript object syntax!
A stylish, editor-like, modular, react component for viewing, editing, and debugging javascript object syntax!
$ npm i --save react-json-editor-ajrm
import JSONInput from 'react-json-editor-ajrm';
<JSONInput
id = 'a_unique_id'
placeholder = { sampleObject }
colors = { darktheme }
height = '550px'
/>
$ cd path/to/repo/react-json-editor-ajrm/example
$ npm i
$ npm start
http://localhost:8080
in the web browser'true'
or "null"
would be misidentified as actual primitive values true
and null
.Name | Description | Type | Required |
---|---|---|---|
id | A unique id to identify component. | string | Mandatory |
placeholder | Send a valid javascript object to be shown once when component is mounted. | object | Optional |
viewOnly | Send true if you would like for content shown not to be editable. | boolean | Optional |
onChange | Whenever onBlur or onKeyPress eventa take place, it will return content values. | object | Optional |
confirmGood | Send false if you would like for the checkmark to confirm good syntax to be hidden. | boolean | Optional |
height | A shorthand property to set a specific height for the entire component. | string | Optional |
width | A shorthand property to set a specific width for the entire component. | string | Optional |
onKeyPressUpdate | Send false if you would like for component not to automatically update on key press. | boolean | Optional |
waitAfterKeyPress | Amount of milliseconds to wait before re-rendering content after keypress. Value defaults to 1000 when not specified. In other words, component will update if there is no additional keystroke after the last one within 1 second. Less than 100 milliseconds does not makes a difference. | number | Optional |
theme | Specify which built-in theme to use. | stirng | Optional |
colors | Contains the following properties: | object | Optional |
colors.default | Hex color code for any symbols, like curly braces , and comma . | string | Optional |
colors.string | Hex color code for tokens identified as string values. | string | Optional |
colors.number | Hex color code for tokens identified as integeter , double , or float values. | string | Optional |
colors.colon | Hex color code for tokens identified as colon . | string | Optional |
colors.keys | Hex color code for tokens identified as keys or property names. | string | Optional |
colors.keys_whiteSpace | Hex color code for tokens identified as keys wrapped in quotes. | string | Optional |
colors.primitive | Hex color code for tokens identified as boolean values and null. | string | Optional |
colors.error | Hex color code for tokens marked with an error tag. | string | Optional |
colors.background | Hex color code for component's background. | string | Optional |
colors.background_warning | Hex color code for warning message displaying at the top in component. | string | Optional |
style | Contains the following properties: | object | Optional |
style.outerBox | Property to modify the default style of the outside container div of component. | string | Optional |
style.container | Property to modify the default style of the container of component. | string | Optional |
style.warningBox | Property to modify the default style of the container div of the warning message. | string | Optional |
style.errorMessage | Property to modify the default style of the warning message. | string | Optional |
style.body | Property to modify the default style of the container div of row labels and code. | string | Optional |
style.labelColumn | Property to modify the default style of the container div of row labels. | string | Optional |
style.labels | Property to modify the default style of each row label. | string | Optional |
style.contentBox | Property to modify the default style of the container div of the code. | string | Optional |
outerBox
+-- container
+--- warningBox
+---- errorMessage
+--- body
+---- labelColumn
+----- labels
+---- contentBox
+----- auto generated markup
Whenever RJEA re-renders its content, any function passed onto onChange
property will receive a single object parameter with the following keys and values:
Key | Description |
---|---|
plainText | A string representation of then content which includes linebreaks and indentation. Great to console.log() |
markupText | A string representation of the auto-generated markup used to render content. |
json | A JSON.stringify version of content. |
jsObject | A javascript object version of content. Will return undefined if the content's syntax is incorrect. |
lines | Number of lines rendered for content to be displayed. |
error | Returns false unless the content's syntax is incorrect, in which case returns an object with a token and a line number which corresponds to the location at which error occurred and a reason |
RJEA supports built-in theme. Here is the list.
The distribution version of this component has been transpiled down to ES5
, then minified
and uglified
for maximum compatability and performance.
You can check the source code here react-json-editor-ajrm/src/:
This project is licensed under the MIT License - see the LICENSE.md file for details.
FAQs
A stylish, editor-like, modular, react component for viewing, editing, and debugging javascript object syntax!
The npm package react-json-editor-ajrm receives a total of 37,696 weekly downloads. As such, react-json-editor-ajrm popularity was classified as popular.
We found that react-json-editor-ajrm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.