react-json-editor-ajrm
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -6,2 +6,3 @@ import React, { Component } from 'react'; | ||
super(props); | ||
if(!('id' in this.props)) console.error('An \'id\' property must be specified. Must be unique'); | ||
this.createMarkup = this.createMarkup .bind(this); | ||
@@ -157,3 +158,3 @@ this.rawTextContent = this.rawTextContent .bind(this); | ||
<div | ||
id = 'ared7_simple_jsonviewer_body' | ||
id = {'ared7_jsonviewer_body' + this.props.id} | ||
contentEditable = { true } | ||
@@ -244,3 +245,3 @@ style = {{ | ||
let | ||
rawText = document.getElementById('ared7_simple_jsonviewer_body').textContent, | ||
rawText = document.getElementById('ared7_jsonviewer_body' + this.props.id).textContent, | ||
noLineBreaks = rawText.replace(/\n/g, ''), | ||
@@ -601,3 +602,3 @@ noCarrigeReturn = noLineBreaks.replace(/\r/g, ''), | ||
var selection = window.getSelection(); | ||
var range = createRange(document.getElementById('ared7_simple_jsonviewer_body').parentNode, { count: chars }); | ||
var range = createRange(document.getElementById('ared7_jsonviewer_body' + this.props.id).parentNode, { count: chars }); | ||
if (range) { | ||
@@ -641,3 +642,3 @@ range.collapse(false); | ||
componentDidMount(){ | ||
document.getElementById('ared7_simple_jsonviewer_body').addEventListener('paste', e => { | ||
document.getElementById('ared7_jsonviewer_body' + this.props.id).addEventListener('paste', e => { | ||
e.preventDefault(); | ||
@@ -644,0 +645,0 @@ var text = e.clipboardData.getData('text/plain'); |
{ | ||
"name": "react-json-editor-ajrm", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A stylish, modular, react component for viewing, editing, json and more!", | ||
@@ -16,6 +16,3 @@ "author": "andrew.redican.mejia@gmail.com", | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/AndrewRedican/react-json-editor-ajrm.git" | ||
}, | ||
"repository": "git@github.com:AndrewRedican/react-json-editor-ajrm.git", | ||
"keywords": [ | ||
@@ -32,3 +29,5 @@ "react-json-editor-ajrm", | ||
"json viewer", | ||
"json editor" | ||
"json editor", | ||
"mitsuketajs.org", | ||
"mitsuketa" | ||
], | ||
@@ -35,0 +34,0 @@ "dependencies": { |
@@ -25,3 +25,7 @@ # react-json-editor-ajrm | ||
## Play | ||
## Latest Release Notes | ||
1. It is now required to pass an 'id' property to JSONInput component with a unique string. | ||
2. Tomorrow a website will be release so that you can interact with this component live. | ||
## Set Up | ||
If you'd like to interact with it right away. Follow these instructions. | ||
@@ -28,0 +32,0 @@ 1. Clone github repository |
@@ -6,2 +6,3 @@ import React, { Component } from 'react'; | ||
super(props); | ||
if(!('id' in this.props)) console.error('An \'id\' property must be specified. Must be unique'); | ||
this.createMarkup = this.createMarkup .bind(this); | ||
@@ -157,3 +158,3 @@ this.rawTextContent = this.rawTextContent .bind(this); | ||
<div | ||
id = 'ared7_simple_jsonviewer_body' | ||
id = {'ared7_jsonviewer_body' + this.props.id} | ||
contentEditable = { true } | ||
@@ -244,3 +245,3 @@ style = {{ | ||
let | ||
rawText = document.getElementById('ared7_simple_jsonviewer_body').textContent, | ||
rawText = document.getElementById('ared7_jsonviewer_body' + this.props.id).textContent, | ||
noLineBreaks = rawText.replace(/\n/g, ''), | ||
@@ -601,3 +602,3 @@ noCarrigeReturn = noLineBreaks.replace(/\r/g, ''), | ||
var selection = window.getSelection(); | ||
var range = createRange(document.getElementById('ared7_simple_jsonviewer_body').parentNode, { count: chars }); | ||
var range = createRange(document.getElementById('ared7_jsonviewer_body' + this.props.id).parentNode, { count: chars }); | ||
if (range) { | ||
@@ -641,3 +642,3 @@ range.collapse(false); | ||
componentDidMount(){ | ||
document.getElementById('ared7_simple_jsonviewer_body').addEventListener('paste', e => { | ||
document.getElementById('ared7_jsonviewer_body' + this.props.id).addEventListener('paste', e => { | ||
e.preventDefault(); | ||
@@ -644,0 +645,0 @@ var text = e.clipboardData.getData('text/plain'); |
@@ -114,2 +114,3 @@ import React, { Component } from 'react'; | ||
<JSONInput | ||
id = {'uniqueString-jsonInut'} | ||
placeholder = { sampleObject } | ||
@@ -116,0 +117,0 @@ colors = { darktheme } |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
91982
1888
56
1